OLD | NEW |
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 = kUnknown_SkAlphaType; | 28 *newAlphaType = kIgnore_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 Loading... |
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 } |
OLD | NEW |