diff options
author | 2020-09-25 00:27:29 -0700 | |
---|---|---|
committer | 2020-09-30 11:55:48 -0700 | |
commit | 5bed1f5332c54924368d9692c6b104fd5373576a (patch) | |
tree | fdf4d84a5aad01c5679b32577cc0087ae42163fd /libs/hwui/SkiaCanvas.cpp | |
parent | 2740724e58c90da7c320e5c6e6b95bf05930a19a (diff) |
Revert "Create wrapper around Shader native implementation"
This reverts commit fc42a99ea5712883c9872d34a523d972c26c9d6f.
Because we are moving away from a wrapper class to delegate
between SkImageFilter and SkShader and instead adding
RenderEffect on RenderNode, this wrapper implementation
is no longer necessary. There are some behavioral
differences between SkShader and SkImageFilter that
would lead to additional complexity in conversions
between these objects and potential bugs.
To simplify this, RenderEffect will be added
directly to RenderNode to support better
caching of rasterization layers that is necessary
for various visual effects like blur.
Test: N/A
Change-Id: I65dc9f8bd26aed8761af13491ae3f6d583208377
Diffstat (limited to 'libs/hwui/SkiaCanvas.cpp')
-rw-r--r-- | libs/hwui/SkiaCanvas.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp index a690840e91a9..1dbce58fb7c9 100644 --- a/libs/hwui/SkiaCanvas.cpp +++ b/libs/hwui/SkiaCanvas.cpp @@ -42,8 +42,6 @@ #include <SkTextBlob.h> #include <SkVertices.h> -#include <shader/BitmapShader.h> - #include <memory> #include <optional> #include <utility> @@ -51,7 +49,6 @@ namespace android { using uirenderer::PaintUtils; -using uirenderer::BitmapShader; Canvas* Canvas::create_canvas(const SkBitmap& bitmap) { return new SkiaCanvas(bitmap); @@ -684,9 +681,7 @@ void SkiaCanvas::drawBitmapMesh(Bitmap& bitmap, int meshWidth, int meshHeight, if (paint) { pnt = *paint; } - - pnt.setShader(sk_ref_sp(new BitmapShader( - bitmap.makeImage(), SkTileMode::kClamp, SkTileMode::kClamp, nullptr))); + pnt.setShader(bitmap.makeImage()->makeShader()); auto v = builder.detach(); apply_looper(&pnt, [&](const SkPaint& p) { mCanvas->drawVertices(v, SkBlendMode::kModulate, p); |