aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2014-07-16 13:46:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-16 13:46:06 -0700
commite194c495e95cbe92dfb9ed04515904a417fe7e9b (patch)
treee07d866e3a7669ae9ef14bf37217390b99996a42
parentee5da55477d1679eaf50b56b6017cbfc07af02a7 (diff)
Remove ambiguous operator= on AutoCFRelease.
The operator= is ambiguous as to the state of the reference count. Until we have rvalue assignment operators, just use 'reset' as the name of the reference stealing assignment to AutoCFRelease. R=reed@google.com, mtklein@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/400453002
-rwxr-xr-xsrc/ports/SkFontHost_mac.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 7f3a3c1ef4..a8e1b5793e 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -88,11 +88,6 @@ public:
}
}
- AutoCFRelease& operator =(CFRef that) {
- reset(that);
- return *this;
- }
-
operator CFRef() const { return fCFRef; }
CFRef get() const { return fCFRef; }
@@ -750,16 +745,16 @@ SkScalerContext_Mac::SkScalerContext_Mac(SkTypeface_Mac* typeface,
AutoCFRelease<CFNumberRef> cfVertical(CFNumberCreate(
kCFAllocatorDefault, kCFNumberSInt32Type, &ctOrientation));
CFDictionaryAddValue(cfAttributes, kCTFontOrientationAttribute, cfVertical);
- ctFontDesc = CTFontDescriptorCreateWithAttributes(cfAttributes);
+ ctFontDesc.reset(CTFontDescriptorCreateWithAttributes(cfAttributes));
}
}
// Since our matrix includes everything, we pass 1 for size.
- fCTFont = CTFontCreateCopyWithAttributes(ctFont, 1, &transform, ctFontDesc);
- fCGFont = CTFontCopyGraphicsFont(fCTFont, NULL);
+ fCTFont.reset(CTFontCreateCopyWithAttributes(ctFont, 1, &transform, ctFontDesc));
+ fCGFont.reset(CTFontCopyGraphicsFont(fCTFont, NULL));
if (fVertical) {
CGAffineTransform rotateLeft = CGAffineTransformMake(0, -1, 1, 0, 0, 0);
transform = CGAffineTransformConcat(rotateLeft, transform);
- fCTVerticalFont = CTFontCreateCopyWithAttributes(ctFont, 1, &transform, NULL);
+ fCTVerticalFont.reset(CTFontCreateCopyWithAttributes(ctFont, 1, &transform, NULL));
}
SkScalar emPerFUnit = SkScalarInvert(SkIntToScalar(CGFontGetUnitsPerEm(fCGFont)));
@@ -773,7 +768,7 @@ CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph&
//It doesn't appear to matter what color space is specified.
//Regular blends and antialiased text are always (s*a + d*(1-a))
//and smoothed text is always g=2.0.
- fRGBSpace = CGColorSpaceCreateDeviceRGB();
+ fRGBSpace.reset(CGColorSpaceCreateDeviceRGB());
}
// default to kBW_Format
@@ -802,8 +797,8 @@ CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph&
rowBytes = fSize.fWidth * sizeof(CGRGBPixel);
void* image = fImageStorage.reset(rowBytes * fSize.fHeight);
- fCG = CGBitmapContextCreate(image, fSize.fWidth, fSize.fHeight, 8,
- rowBytes, fRGBSpace, BITMAP_INFO_RGB);
+ fCG.reset(CGBitmapContextCreate(image, fSize.fWidth, fSize.fHeight, 8,
+ rowBytes, fRGBSpace, BITMAP_INFO_RGB));
// skia handles quantization itself, so we disable this for cg to get
// full fractional data from them.