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

Side by Side Diff: src/ports/SkImageDecoder_CG.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontHost_FreeType_common.cpp ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 61 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
62 62
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);
72 71
73 bm->setInfo(skinfo); 72 bm->setInfo(SkImageInfo::MakeN32Premul(width, height));
74 if (SkImageDecoder::kDecodeBounds_Mode == mode) { 73 if (SkImageDecoder::kDecodeBounds_Mode == mode) {
75 return true; 74 return true;
76 } 75 }
77 76
78 if (!this->allocPixelRef(bm, NULL)) { 77 if (!this->allocPixelRef(bm, NULL)) {
79 return false; 78 return false;
80 } 79 }
81 80
82 SkAutoLockPixels alp(*bm); 81 SkAutoLockPixels alp(*bm);
83 82
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 282
284 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); 283 SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc);
285 const CFStringRef name = CGImageSourceGetType(imageSrc); 284 const CFStringRef name = CGImageSourceGetType(imageSrc);
286 if (NULL == name) { 285 if (NULL == name) {
287 return SkImageDecoder::kUnknown_Format; 286 return SkImageDecoder::kUnknown_Format;
288 } 287 }
289 return UTType_to_Format(name); 288 return UTType_to_Format(name);
290 } 289 }
291 290
292 static SkImageDecoder_FormatReg gFormatReg(get_format_cg); 291 static SkImageDecoder_FormatReg gFormatReg(get_format_cg);
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_FreeType_common.cpp ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698