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

Side by Side Diff: src/image/SkSurface_Raster.cpp

Issue 233813004: Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/image/SkSurface_Picture.cpp ('k') | src/images/SkDecodingImageGenerator.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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 29 matching lines...) Expand all
40 static const size_t kMaxTotalSize = SK_MaxS32; 40 static const size_t kMaxTotalSize = SK_MaxS32;
41 41
42 int shift = 0; 42 int shift = 0;
43 switch (info.fColorType) { 43 switch (info.fColorType) {
44 case kAlpha_8_SkColorType: 44 case kAlpha_8_SkColorType:
45 shift = 0; 45 shift = 0;
46 break; 46 break;
47 case kRGB_565_SkColorType: 47 case kRGB_565_SkColorType:
48 shift = 1; 48 shift = 1;
49 break; 49 break;
50 case kPMColor_SkColorType: 50 case kN32_SkColorType:
51 shift = 2; 51 shift = 2;
52 break; 52 break;
53 default: 53 default:
54 return false; 54 return false;
55 } 55 }
56 56
57 if (kIgnoreRowBytesValue == rowBytes) { 57 if (kIgnoreRowBytesValue == rowBytes) {
58 return true; 58 return true;
59 } 59 }
60 60
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (!SkSurface_Raster::Valid(info)) { 152 if (!SkSurface_Raster::Valid(info)) {
153 return NULL; 153 return NULL;
154 } 154 }
155 155
156 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL)); 156 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewAllocate(info, 0, NULL));
157 if (NULL == pr.get()) { 157 if (NULL == pr.get()) {
158 return NULL; 158 return NULL;
159 } 159 }
160 return SkNEW_ARGS(SkSurface_Raster, (pr)); 160 return SkNEW_ARGS(SkSurface_Raster, (pr));
161 } 161 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Picture.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698