From 374772bd61951f01bf84fe17bf53d8867681c9ae Mon Sep 17 00:00:00 2001 From: reed Date: Wed, 5 Oct 2016 17:33:02 -0700 Subject: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" This reverts commit c245574ba3d0e2ade6c94b2812de3baa383bf4c4. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2396953002 TBR= Review-Url: https://codereview.chromium.org/2396953002 --- src/pipe/SkPipeCanvas.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/pipe/SkPipeCanvas.cpp') diff --git a/src/pipe/SkPipeCanvas.cpp b/src/pipe/SkPipeCanvas.cpp index a01237fbbb..3b636a23c0 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); -- cgit v1.2.3