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

Unified Diff: src/core/SkBlitter_RGB16.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_PM4f.cpp ('k') | src/core/SkBlitter_Sprite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_RGB16.cpp
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index 066ec616de674ac90a0727eb6f7a32f6ea4cabae..7860b7cb6c03c82f27b888071b411eec760b72a4 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -160,7 +160,7 @@ SkRGB16_Black_Blitter::SkRGB16_Black_Blitter(const SkPixmap& device, const SkPai
: INHERITED(device, paint) {
SkASSERT(paint.getShader() == nullptr);
SkASSERT(paint.getColorFilter() == nullptr);
- SkASSERT(paint.getXfermode() == nullptr);
+ SkASSERT(paint.isSrcOver());
SkASSERT(paint.getColor() == SK_ColorBLACK);
}
@@ -683,7 +683,7 @@ SkRGB16_Shader_Blitter::SkRGB16_Shader_Blitter(const SkPixmap& device,
SkShader::Context* shaderContext)
: INHERITED(device, paint, shaderContext)
{
- SkASSERT(paint.getXfermode() == nullptr);
+ SkASSERT(paint.isSrcOver());
fBuffer = (SkPMColor*)sk_malloc_throw(device.width() * sizeof(SkPMColor));
@@ -809,9 +809,8 @@ SkRGB16_Shader_Xfermode_Blitter::SkRGB16_Shader_Xfermode_Blitter(
SkShader::Context* shaderContext)
: INHERITED(device, paint, shaderContext)
{
- fXfermode = paint.getXfermode();
+ fXfermode = SkXfermode::Peek(paint.getBlendMode());
SkASSERT(fXfermode);
- fXfermode->ref();
int width = device.width();
fBuffer = (SkPMColor*)sk_malloc_throw((width + (SkAlign4(width) >> 2)) * sizeof(SkPMColor));
@@ -819,7 +818,6 @@ SkRGB16_Shader_Xfermode_Blitter::SkRGB16_Shader_Xfermode_Blitter(
}
SkRGB16_Shader_Xfermode_Blitter::~SkRGB16_Shader_Xfermode_Blitter() {
- fXfermode->unref();
sk_free(fBuffer);
}
@@ -897,14 +895,14 @@ SkBlitter* SkBlitter_ChooseD565(const SkPixmap& device, const SkPaint& paint,
SkBlitter* blitter;
SkShader* shader = paint.getShader();
- SkXfermode* mode = paint.getXfermode();
+ bool is_srcover = paint.isSrcOver();
// we require a shader if there is an xfermode, handled by our caller
- SkASSERT(nullptr == mode || shader);
+ SkASSERT(is_srcover || shader);
if (shader) {
SkASSERT(shaderContext != nullptr);
- if (mode) {
+ if (!is_srcover) {
blitter = allocator->createT<SkRGB16_Shader_Xfermode_Blitter>(device, paint,
shaderContext);
} else {
« no previous file with comments | « src/core/SkBlitter_PM4f.cpp ('k') | src/core/SkBlitter_Sprite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698