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

Unified Diff: src/core/SkBlitter_A8.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_A8.cpp
diff --git a/src/core/SkBlitter_A8.cpp b/src/core/SkBlitter_A8.cpp
index 66976143c8f3df7fe9e8fdd5496c9e99ec02c9a5..cb7d718f54009c254ba33d1c6d7f3688b9806faf 100644
--- a/src/core/SkBlitter_A8.cpp
+++ b/src/core/SkBlitter_A8.cpp
@@ -230,10 +230,8 @@ SkA8_Shader_Blitter::SkA8_Shader_Blitter(const SkPixmap& device, const SkPaint&
SkShader::Context* shaderContext)
: INHERITED(device, paint, shaderContext)
{
- if ((fXfermode = paint.getXfermode()) != nullptr) {
- fXfermode->ref();
- SkASSERT(fShaderContext);
- }
+ fXfermode = SkXfermode::Peek(paint.getBlendMode());
+ SkASSERT(!fXfermode || fShaderContext);
int width = device.width();
fBuffer = (SkPMColor*)sk_malloc_throw(sizeof(SkPMColor) * (width + (SkAlign4(width) >> 2)));
@@ -241,7 +239,6 @@ SkA8_Shader_Blitter::SkA8_Shader_Blitter(const SkPixmap& device, const SkPaint&
}
SkA8_Shader_Blitter::~SkA8_Shader_Blitter() {
- if (fXfermode) SkSafeUnref(fXfermode);
sk_free(fBuffer);
}
@@ -355,7 +352,7 @@ void SkA8_Shader_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) {
SkA8_Coverage_Blitter::SkA8_Coverage_Blitter(const SkPixmap& device,
const SkPaint& paint) : SkRasterBlitter(device) {
SkASSERT(nullptr == paint.getShader());
- SkASSERT(nullptr == paint.getXfermode());
+ SkASSERT(paint.isSrcOver());
SkASSERT(nullptr == paint.getColorFilter());
}
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698