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/core/SkBitmapDevice.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/SkBitmap.cpp ('k') | src/core/SkConfig8888.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDeviceProperties.h" 10 #include "SkDeviceProperties.h"
11 #include "SkDraw.h" 11 #include "SkDraw.h"
12 #include "SkRasterClip.h" 12 #include "SkRasterClip.h"
13 #include "SkShader.h" 13 #include "SkShader.h"
14 #include "SkSurface.h" 14 #include "SkSurface.h"
15 15
16 #define CHECK_FOR_ANNOTATION(paint) \ 16 #define CHECK_FOR_ANNOTATION(paint) \
17 do { if (paint.getAnnotation()) { return; } } while (0) 17 do { if (paint.getAnnotation()) { return; } } while (0)
18 18
19 static bool valid_for_bitmap_device(const SkImageInfo& info, 19 static bool valid_for_bitmap_device(const SkImageInfo& info,
20 SkAlphaType* newAlphaType) { 20 SkAlphaType* newAlphaType) {
21 if (info.width() < 0 || info.height() < 0) { 21 if (info.width() < 0 || info.height() < 0) {
22 return false; 22 return false;
23 } 23 }
24 24
25 // TODO: can we stop supporting kUnknown in SkBitmkapDevice? 25 // TODO: can we stop supporting kUnknown in SkBitmkapDevice?
26 if (kUnknown_SkColorType == info.colorType()) { 26 if (kUnknown_SkColorType == info.colorType()) {
27 if (newAlphaType) { 27 if (newAlphaType) {
28 *newAlphaType = kIgnore_SkAlphaType; 28 *newAlphaType = kUnknown_SkAlphaType;
29 } 29 }
30 return true; 30 return true;
31 } 31 }
32 32
33 switch (info.alphaType()) { 33 switch (info.alphaType()) {
34 case kPremul_SkAlphaType: 34 case kPremul_SkAlphaType:
35 case kOpaque_SkAlphaType: 35 case kOpaque_SkAlphaType:
36 break; 36 break;
37 default: 37 default:
38 return false; 38 return false;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 paint.getRasterizer() || 376 paint.getRasterizer() ||
377 paint.getPathEffect() || 377 paint.getPathEffect() ||
378 paint.isFakeBoldText() || 378 paint.isFakeBoldText() ||
379 paint.getStyle() != SkPaint::kFill_Style || 379 paint.getStyle() != SkPaint::kFill_Style ||
380 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 380 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
381 { 381 {
382 return true; 382 return true;
383 } 383 }
384 return false; 384 return false;
385 } 385 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkConfig8888.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698