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

Unified Diff: src/pipe/SkPipeCanvas.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/pdf/SkPDFGraphicState.cpp ('k') | src/pipe/SkPipeFormat.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkPipeCanvas.cpp
diff --git a/src/pipe/SkPipeCanvas.cpp b/src/pipe/SkPipeCanvas.cpp
index a01237fbbb5c9ec5fcb232e39a43f2332d473697..3b636a23c0579f81bffeb7f32540b83e2f5d47e6 100644
--- a/src/pipe/SkPipeCanvas.cpp
+++ b/src/pipe/SkPipeCanvas.cpp
@@ -81,7 +81,6 @@ static uint16_t compute_nondef(const SkPaint& paint, PaintUsage usage) {
bits |= (paint.getMaskFilter() ? kMaskFilter_NonDef : 0);
}
- bits |= (paint.getXfermode() ? kXfermode_NonDef : 0);
bits |= (paint.getColorFilter() ? kColorFilter_NonDef : 0);
bits |= (paint.getImageFilter() ? kImageFilter_NonDef : 0);
bits |= (paint.getDrawLooper() ? kDrawLooper_NonDef : 0);
@@ -150,15 +149,8 @@ static void write_paint(SkWriteBuffer& writer, const SkPaint& paint, unsigned us
writer.write32(packedFlags);
unsigned nondef = compute_nondef(paint, (PaintUsage)usage);
- SkXfermode::Mode mode;
- if (SkXfermode::AsMode(paint.getXfermode(), &mode)) {
- nondef &= ~kXfermode_NonDef; // don't need to store a pointer since we have an enum
- } else {
- SkASSERT(nondef & kXfermode_NonDef);
- mode = (SkXfermode::Mode)0;
- }
const uint8_t pad = 0;
- writer.write32((nondef << 16) | ((unsigned)mode << 8) | pad);
+ writer.write32((nondef << 16) | ((unsigned)paint.getBlendMode() << 8) | pad);
CHECK_WRITE_SCALAR(writer, nondef, paint, TextSize);
CHECK_WRITE_SCALAR(writer, nondef, paint, TextScaleX);
@@ -179,7 +171,6 @@ static void write_paint(SkWriteBuffer& writer, const SkPaint& paint, unsigned us
CHECK_WRITE_FLATTENABLE(writer, nondef, paint, PathEffect);
CHECK_WRITE_FLATTENABLE(writer, nondef, paint, Shader);
- CHECK_WRITE_FLATTENABLE(writer, nondef, paint, Xfermode);
CHECK_WRITE_FLATTENABLE(writer, nondef, paint, MaskFilter);
CHECK_WRITE_FLATTENABLE(writer, nondef, paint, ColorFilter);
CHECK_WRITE_FLATTENABLE(writer, nondef, paint, Rasterizer);
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/pipe/SkPipeFormat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698