diff options
author | Derek Sollenberger <djsollen@google.com> | 2019-04-22 16:28:09 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2019-05-02 13:04:20 -0400 |
commit | ac33a487516196e9f1cf830e78313806e6daf777 (patch) | |
tree | f1738f2d3e8dd3e467b4e5b697590bf912cfb702 /libs/hwui/RecordingCanvas.cpp | |
parent | f06967c08e48143192b136cd4d5d5f805631752e (diff) |
Fix fading edge effect from impacting neighboring pixels
Bug: 129117085
Test: skia unit tests and test cases described in the bug
Change-Id: Ieaa7c831dd6298ac0565e6f1837b1c1dbd4545da
Diffstat (limited to 'libs/hwui/RecordingCanvas.cpp')
-rw-r--r-- | libs/hwui/RecordingCanvas.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp index 85947665839a..e58fbbe8e667 100644 --- a/libs/hwui/RecordingCanvas.cpp +++ b/libs/hwui/RecordingCanvas.cpp @@ -20,6 +20,7 @@ #include "SkAndroidFrameworkUtils.h" #include "SkCanvas.h" +#include "SkCanvasPriv.h" #include "SkData.h" #include "SkDrawShadowInfo.h" #include "SkImage.h" @@ -187,6 +188,12 @@ struct DrawPaint final : Op { SkPaint paint; void draw(SkCanvas* c, const SkMatrix&) const { c->drawPaint(paint); } }; +struct DrawBehind final : Op { + static const auto kType = Type::DrawBehind; + DrawBehind(const SkPaint& paint) : paint(paint) {} + SkPaint paint; + void draw(SkCanvas* c, const SkMatrix&) const { SkCanvasPriv::DrawBehind(c, paint); } +}; struct DrawPath final : Op { static const auto kType = Type::DrawPath; DrawPath(const SkPath& path, const SkPaint& paint) : path(path), paint(paint) {} @@ -565,6 +572,9 @@ void DisplayListData::clipRegion(const SkRegion& region, SkClipOp op) { void DisplayListData::drawPaint(const SkPaint& paint) { this->push<DrawPaint>(0, paint); } +void DisplayListData::drawBehind(const SkPaint& paint) { + this->push<DrawBehind>(0, paint); +} void DisplayListData::drawPath(const SkPath& path, const SkPaint& paint) { this->push<DrawPath>(0, path, paint); } @@ -834,6 +844,9 @@ void RecordingCanvas::onClipRegion(const SkRegion& region, SkClipOp op) { void RecordingCanvas::onDrawPaint(const SkPaint& paint) { fDL->drawPaint(paint); } +void RecordingCanvas::onDrawBehind(const SkPaint& paint) { + fDL->drawBehind(paint); +} void RecordingCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { fDL->drawPath(path, paint); } |