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

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

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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/SkPaint.cpp ('k') | src/core/SkPixmap.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 "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
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 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPixmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698