summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils_ios.mm
diff options
context:
space:
mode:
Diffstat (limited to 'skia/ext/skia_utils_ios.mm')
-rw-r--r--skia/ext/skia_utils_ios.mm23
1 files changed, 13 insertions, 10 deletions
diff --git a/skia/ext/skia_utils_ios.mm b/skia/ext/skia_utils_ios.mm
index 72c69a0..80c50fd 100644
--- a/skia/ext/skia_utils_ios.mm
+++ b/skia/ext/skia_utils_ios.mm
@@ -31,13 +31,16 @@ SkBitmap CGImageToSkBitmap(CGImageRef image, CGSize size, bool is_opaque) {
(SK_A32_SHIFT == (a) && SK_R32_SHIFT == (r) \
&& SK_G32_SHIFT == (g) && SK_B32_SHIFT == (b))
#if defined(SK_CPU_LENDIAN) && HAS_ARGB_SHIFTS(24, 16, 8, 0)
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
- base::mac::ScopedCFTypeRef<CGContextRef> context(
- CGBitmapContextCreate(data, size.width, size.height, 8, size.width*4,
- color_space,
- kCGImageAlphaPremultipliedFirst |
- kCGBitmapByteOrder32Host));
+ base::ScopedCFTypeRef<CGContextRef> context(CGBitmapContextCreate(
+ data,
+ size.width,
+ size.height,
+ 8,
+ size.width * 4,
+ color_space,
+ kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
#else
#error We require that Skia's and CoreGraphics's recommended \
image memory layout match.
@@ -62,7 +65,7 @@ UIImage* SkBitmapToUIImageWithColorSpace(const SkBitmap& skia_bitmap,
return nil;
// First convert SkBitmap to CGImageRef.
- base::mac::ScopedCFTypeRef<CGImageRef> cg_image(
+ base::ScopedCFTypeRef<CGImageRef> cg_image(
SkCreateCGImageRefWithColorspace(skia_bitmap, color_space));
// Now convert to UIImage.
@@ -73,16 +76,16 @@ UIImage* SkBitmapToUIImageWithColorSpace(const SkBitmap& skia_bitmap,
std::vector<SkBitmap> ImageDataToSkBitmaps(NSData* image_data) {
DCHECK(image_data);
- base::mac::ScopedCFTypeRef<CFDictionaryRef> empty_dictionary(
+ base::ScopedCFTypeRef<CFDictionaryRef> empty_dictionary(
CFDictionaryCreate(NULL, NULL, NULL, 0, NULL, NULL));
std::vector<SkBitmap> frames;
- base::mac::ScopedCFTypeRef<CGImageSourceRef> source(
+ base::ScopedCFTypeRef<CGImageSourceRef> source(
CGImageSourceCreateWithData((CFDataRef)image_data, empty_dictionary));
size_t count = CGImageSourceGetCount(source);
for (size_t index = 0; index < count; ++index) {
- base::mac::ScopedCFTypeRef<CGImageRef> cg_image(
+ base::ScopedCFTypeRef<CGImageRef> cg_image(
CGImageSourceCreateImageAtIndex(source, index, empty_dictionary));
CGSize size = CGSizeMake(CGImageGetWidth(cg_image),