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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkPaintPriv.h" | 10 #include "SkPaintPriv.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 opacityType = SkXfermode::kOpaque_SrcColorOpacity; | 34 opacityType = SkXfermode::kOpaque_SrcColorOpacity; |
35 } else if (0 == paintAlpha) { | 35 } else if (0 == paintAlpha) { |
36 if (overrideOpacity == kNone_ShaderOverrideOpacity && !paint->getSha
der()) { | 36 if (overrideOpacity == kNone_ShaderOverrideOpacity && !paint->getSha
der()) { |
37 opacityType = SkXfermode::kTransparentBlack_SrcColorOpacity; | 37 opacityType = SkXfermode::kTransparentBlack_SrcColorOpacity; |
38 } else { | 38 } else { |
39 opacityType = SkXfermode::kTransparentAlpha_SrcColorOpacity; | 39 opacityType = SkXfermode::kTransparentAlpha_SrcColorOpacity; |
40 } | 40 } |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 return SkXfermode::IsOpaque(paint->getXfermode(), opacityType); | 44 return SkXfermode::IsOpaque(paint->getBlendMode(), opacityType); |
45 } | 45 } |
46 | 46 |
47 bool SkPaintPriv::Overwrites(const SkBitmap& bitmap, const SkPaint* paint) { | 47 bool SkPaintPriv::Overwrites(const SkBitmap& bitmap, const SkPaint* paint) { |
48 return Overwrites(paint, bitmap.isOpaque() ? kOpaque_ShaderOverrideOpacity | 48 return Overwrites(paint, bitmap.isOpaque() ? kOpaque_ShaderOverrideOpacity |
49 : kNotOpaque_ShaderOverrideOpacit
y); | 49 : kNotOpaque_ShaderOverrideOpacit
y); |
50 } | 50 } |
51 | 51 |
52 bool SkPaintPriv::Overwrites(const SkImage* image, const SkPaint* paint) { | 52 bool SkPaintPriv::Overwrites(const SkImage* image, const SkPaint* paint) { |
53 return Overwrites(paint, image->isOpaque() ? kOpaque_ShaderOverrideOpacity | 53 return Overwrites(paint, image->isOpaque() ? kOpaque_ShaderOverrideOpacity |
54 : kNotOpaque_ShaderOverrideOpacit
y); | 54 : kNotOpaque_ShaderOverrideOpacit
y); |
55 } | 55 } |
OLD | NEW |