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

Side by Side Diff: src/image/SkImage.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/gpu/SkGr.cpp ('k') | src/image/SkImagePriv.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImagePriv.h" 10 #include "SkImagePriv.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (as_IB(this)->getROPixels(&bm)) { 83 if (as_IB(this)->getROPixels(&bm)) {
84 return SkImageEncoder::EncodeData(bm, type, quality); 84 return SkImageEncoder::EncodeData(bm, type, quality);
85 } 85 }
86 return NULL; 86 return NULL;
87 } 87 }
88 88
89 /////////////////////////////////////////////////////////////////////////////// 89 ///////////////////////////////////////////////////////////////////////////////
90 90
91 static bool raster_canvas_supports(const SkImageInfo& info) { 91 static bool raster_canvas_supports(const SkImageInfo& info) {
92 switch (info.fColorType) { 92 switch (info.fColorType) {
93 case kPMColor_SkColorType: 93 case kN32_SkColorType:
94 return kUnpremul_SkAlphaType != info.fAlphaType; 94 return kUnpremul_SkAlphaType != info.fAlphaType;
95 case kRGB_565_SkColorType: 95 case kRGB_565_SkColorType:
96 return true; 96 return true;
97 case kAlpha_8_SkColorType: 97 case kAlpha_8_SkColorType:
98 return true; 98 return true;
99 default: 99 default:
100 break; 100 break;
101 } 101 }
102 return false; 102 return false;
103 } 103 }
(...skipping 25 matching lines...) Expand all
129 129
130 SkCanvas canvas(*bitmap); 130 SkCanvas canvas(*bitmap);
131 131
132 SkPaint paint; 132 SkPaint paint;
133 paint.setXfermodeMode(SkXfermode::kClear_Mode); 133 paint.setXfermodeMode(SkXfermode::kClear_Mode);
134 canvas.drawRect(dstR, paint); 134 canvas.drawRect(dstR, paint);
135 135
136 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL ); 136 const_cast<SkImage_Base*>(this)->onDrawRectToRect(&canvas, &srcR, dstR, NULL );
137 return true; 137 return true;
138 } 138 }
OLDNEW
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/image/SkImagePriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698