Skip to content

Commit

Permalink
Cleanup in quartz module
Browse files Browse the repository at this point in the history
Remove outdated or useless 'TODO's.
  • Loading branch information
TimurP committed Nov 4, 2016
1 parent 63ca8a8 commit b55314f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions graf2d/quartz/inc/QuartzFillArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ namespace Quartz {
Bool_t SetFillColor(CGContextRef ctx, Color_t colorIndex);
Bool_t SetFillAreaParameters(CGContextRef ctx, unsigned *patternIndex);

//TODO: fix this crap - x1x2 x3 etc. - CGRect!
void DrawBox(CGContextRef ctx, Int_t x1, Int_t y1, Int_t x2, Int_t y2, bool hollow);
void DrawFillArea(CGContextRef ctx, Int_t n, TPoint *xy, Bool_t drawShadow);

//
void DrawPolygonWithGradientFill(CGContextRef ctx, const TColorGradient *extendedColor, const CGSize &sizeOfDrawable,
Int_t nPoints, const TPoint *xy, Bool_t drawShadow);

Expand Down
6 changes: 1 addition & 5 deletions graf2d/quartz/src/QuartzFillArea.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#include "TError.h"
#include "TROOT.h"

//TODO: either use Color_t or use gVirtualX->GetLine/Fill/Color -
//not both, it's a complete mess now!

namespace ROOT {
namespace Quartz {

Expand All @@ -50,7 +47,7 @@ static CGGradientRef CreateGradient(CGColorSpaceRef colorSpace,
assert(extendedColor != nullptr &&
"GradientFactory::CreateGradient, parameter 'extendedColor' is null");
const SRC *compStart = extendedColor->GetColors();
const SRC *compEnd = compStart + extendedColor->GetNumberOfSteps() * 4;//TODO: this assumes RGBA.
const SRC *compEnd = compStart + extendedColor->GetNumberOfSteps() * 4;
const std::vector<DST> convertedComponents(compStart, compEnd);
const SRC *posStart = extendedColor->GetColorPositions();
const SRC *posEnd = posStart + extendedColor->GetNumberOfSteps();
Expand Down Expand Up @@ -500,7 +497,6 @@ void DrawPolygonWithGradientFill(CGContextRef ctx, const TColorGradient *extende
}

//Create a gradient.
//TODO: must be a generic RGB color space???
const CFScopeGuard<CGColorSpaceRef> baseSpace(CGColorSpaceCreateDeviceRGB());
if (!baseSpace.Get()) {
::Error("DrawPolygonWithGradientFill", "CGColorSpaceCreateDeviceRGB failed");
Expand Down
11 changes: 0 additions & 11 deletions graf2d/quartz/src/QuartzText.mm
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ CGRect BBoxForCTRun(CTFontRef font, CTRunRef run)
: fCTLine(0),
fCTFont(font)
{
//TODO: why don't I have asserts on parameters here?

//Create attributed string with one attribue: the font.
CFStringRef keys[] = {kCTFontAttributeName};
CFTypeRef values[] = {font};
Expand All @@ -91,8 +89,6 @@ CGRect BBoxForCTRun(CTFontRef font, CTRunRef run)
fCTFont(font)

{
//TODO: why don't I have asserts on parameters here?

//Create attributed string with one attribue: the font.
CFStringRef keys[] = {kCTFontAttributeName};
CFTypeRef values[] = {font};
Expand All @@ -105,8 +101,6 @@ CGRect BBoxForCTRun(CTFontRef font, CTRunRef run)
: fCTLine(0),
fCTFont(font)
{
//TODO: why don't I have asserts on parameters here?

//Create attributed string with font and color.
using MacOSX::Util::CFScopeGuard;

Expand All @@ -132,8 +126,6 @@ CGRect BBoxForCTRun(CTFontRef font, CTRunRef run)
: fCTLine(0),
fCTFont(font)
{
//TODO: why don't I have asserts on parameters here?

//Create attributed string with font and color.
using ROOT::MacOSX::Util::CFScopeGuard;
CFScopeGuard<CGColorSpaceRef> rgbColorSpace(CGColorSpaceCreateDeviceRGB());
Expand All @@ -155,10 +147,7 @@ CGRect BBoxForCTRun(CTFontRef font, CTRunRef run)
: fCTLine(0),
fCTFont(font)
{
//TODO: why don't I have asserts on parameters here?

//Create attributed string with font and color.
//TODO: Make code more general, this constructor is copy&paste.
using MacOSX::Util::CFScopeGuard;

const CFScopeGuard<CGColorSpaceRef> rgbColorSpace(CGColorSpaceCreateDeviceRGB());
Expand Down

0 comments on commit b55314f

Please sign in to comment.