OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCGUtils.h" | 8 #include "SkCGUtils.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 CGImageRef image = CGImageSourceCreateImageAtIndex(imageSrc, 0, NULL); | 63 CGImageRef image = CGImageSourceCreateImageAtIndex(imageSrc, 0, NULL); |
64 if (NULL == image) { | 64 if (NULL == image) { |
65 return false; | 65 return false; |
66 } | 66 } |
67 SkAutoTCallVProc<CGImage, CGImageRelease> arimage(image); | 67 SkAutoTCallVProc<CGImage, CGImageRelease> arimage(image); |
68 | 68 |
69 const int width = SkToInt(CGImageGetWidth(image)); | 69 const int width = SkToInt(CGImageGetWidth(image)); |
70 const int height = SkToInt(CGImageGetHeight(image)); | 70 const int height = SkToInt(CGImageGetHeight(image)); |
71 SkImageInfo skinfo = SkImageInfo::MakeN32Premul(width, height); | 71 SkImageInfo skinfo = SkImageInfo::MakeN32Premul(width, height); |
72 | 72 |
73 bm->setInfo(skinfo); | 73 bm->setConfig(skinfo); |
74 if (SkImageDecoder::kDecodeBounds_Mode == mode) { | 74 if (SkImageDecoder::kDecodeBounds_Mode == mode) { |
75 return true; | 75 return true; |
76 } | 76 } |
77 | 77 |
78 if (!this->allocPixelRef(bm, NULL)) { | 78 if (!this->allocPixelRef(bm, NULL)) { |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
82 SkAutoLockPixels alp(*bm); | 82 SkAutoLockPixels alp(*bm); |
83 | 83 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); | 284 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); |
285 const CFStringRef name = CGImageSourceGetType(imageSrc); | 285 const CFStringRef name = CGImageSourceGetType(imageSrc); |
286 if (NULL == name) { | 286 if (NULL == name) { |
287 return SkImageDecoder::kUnknown_Format; | 287 return SkImageDecoder::kUnknown_Format; |
288 } | 288 } |
289 return UTType_to_Format(name); | 289 return UTType_to_Format(name); |
290 } | 290 } |
291 | 291 |
292 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); | 292 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); |
OLD | NEW |