summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorNader Jawad <njawad@google.com>2020-09-25 00:27:29 -0700
committerNader Jawad <njawad@google.com>2020-09-30 11:55:48 -0700
commit5bed1f5332c54924368d9692c6b104fd5373576a (patch)
treefdf4d84a5aad01c5679b32577cc0087ae42163fd /libs/hwui/VectorDrawable.cpp
parent2740724e58c90da7c320e5c6e6b95bf05930a19a (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/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index 0f566e4b494a..cd908354aea5 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -23,6 +23,7 @@
#include "PathParser.h"
#include "SkColorFilter.h"
#include "SkImageInfo.h"
+#include "SkShader.h"
#include "hwui/Paint.h"
#ifdef __ANDROID__
@@ -158,10 +159,10 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) {
// Draw path's fill, if fill color or gradient is valid
bool needsFill = false;
- Paint paint;
+ SkPaint paint;
if (properties.getFillGradient() != nullptr) {
paint.setColor(applyAlpha(SK_ColorBLACK, properties.getFillAlpha()));
- paint.setShader(sk_sp<Shader>(SkSafeRef(properties.getFillGradient())));
+ paint.setShader(sk_sp<SkShader>(SkSafeRef(properties.getFillGradient())));
needsFill = true;
} else if (properties.getFillColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getFillColor(), properties.getFillAlpha()));
@@ -178,7 +179,7 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) {
bool needsStroke = false;
if (properties.getStrokeGradient() != nullptr) {
paint.setColor(applyAlpha(SK_ColorBLACK, properties.getStrokeAlpha()));
- paint.setShader(sk_sp<Shader>(SkSafeRef(properties.getStrokeGradient())));
+ paint.setShader(sk_sp<SkShader>(SkSafeRef(properties.getStrokeGradient())));
needsStroke = true;
} else if (properties.getStrokeColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getStrokeColor(), properties.getStrokeAlpha()));