Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 400453002: Remove ambiguous operator= on AutoCFRelease. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 7f3a3c1ef4d86871d8fac7ddf4f8ddf2c640bac7..a8e1b5793e604cca91f4fdbda1bf6dd8a27731ed 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698