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

Side by Side Diff: src/core/SkConfig8888.cpp

Issue 964613002: replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/core/SkBitmapDevice.cpp ('k') | src/core/SkImageInfo.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 2014 Google Inc. 2 * Copyright 2014 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 "SkConfig8888.h" 10 #include "SkConfig8888.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 for (int i = 0; i < count; ++i) { 47 for (int i = 0; i < count; ++i) {
48 dst[i] = convert32<doSwapRB, doAlpha>(src[i]); 48 dst[i] = convert32<doSwapRB, doAlpha>(src[i]);
49 } 49 }
50 } 50 }
51 51
52 static bool is_32bit_colortype(SkColorType ct) { 52 static bool is_32bit_colortype(SkColorType ct) {
53 return kRGBA_8888_SkColorType == ct || kBGRA_8888_SkColorType == ct; 53 return kRGBA_8888_SkColorType == ct || kBGRA_8888_SkColorType == ct;
54 } 54 }
55 55
56 static AlphaVerb compute_AlphaVerb(SkAlphaType src, SkAlphaType dst) { 56 static AlphaVerb compute_AlphaVerb(SkAlphaType src, SkAlphaType dst) {
57 SkASSERT(kIgnore_SkAlphaType != src); 57 SkASSERT(kUnknown_SkAlphaType != src);
58 SkASSERT(kIgnore_SkAlphaType != dst); 58 SkASSERT(kUnknown_SkAlphaType != dst);
59 59
60 if (kOpaque_SkAlphaType == src || kOpaque_SkAlphaType == dst || src == dst) { 60 if (kOpaque_SkAlphaType == src || kOpaque_SkAlphaType == dst || src == dst) {
61 return kNothing_AlphaVerb; 61 return kNothing_AlphaVerb;
62 } 62 }
63 if (kPremul_SkAlphaType == dst) { 63 if (kPremul_SkAlphaType == dst) {
64 SkASSERT(kUnpremul_SkAlphaType == src); 64 SkASSERT(kUnpremul_SkAlphaType == src);
65 return kPremul_AlphaVerb; 65 return kPremul_AlphaVerb;
66 } else { 66 } else {
67 SkASSERT(kPremul_SkAlphaType == src); 67 SkASSERT(kPremul_SkAlphaType == src);
68 SkASSERT(kUnpremul_SkAlphaType == dst); 68 SkASSERT(kUnpremul_SkAlphaType == dst);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 SkPaint paint; 247 SkPaint paint;
248 paint.setDither(true); 248 paint.setDither(true);
249 249
250 canvas->clear(0); 250 canvas->clear(0);
251 canvas->drawBitmap(bm, 0, 0, &paint); 251 canvas->drawBitmap(bm, 0, 0, &paint);
252 return true; 252 return true;
253 } 253 }
254 } 254 }
255 255
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkImageInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698