summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorNader Jawad <njawad@google.com>2020-07-29 22:48:59 -0700
committerNader Jawad <njawad@google.com>2020-08-14 19:46:05 -0700
commitfc42a99ea5712883c9872d34a523d972c26c9d6f (patch)
tree3aedc91a5a7d411dd44b6533bd6df7a2f8edf3d6 /libs/hwui/VectorDrawable.cpp
parent7fc13e85b4478b7d04f36e40fc0a75a4fc25fc23 (diff)
Create wrapper around Shader native implementation
Created Shader classes to wrap existing shader classes in the framework in order to handle creation of either an SkShader or SkImageFilter. Updated native Paint implementation to optionally configure the currently configured SkShader or SkImageFilter Bug: 143468037 Test: re-ran CtsGraphicsTestCases and CtsUiRenderingTestCases Change-Id: I7663b92766c912ab3866cf4e39b268f6dcf5d8e2
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index cd908354aea5..0f566e4b494a 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -23,7 +23,6 @@
#include "PathParser.h"
#include "SkColorFilter.h"
#include "SkImageInfo.h"
-#include "SkShader.h"
#include "hwui/Paint.h"
#ifdef __ANDROID__
@@ -159,10 +158,10 @@ void FullPath::draw(SkCanvas* outCanvas, bool useStagingData) {
// Draw path's fill, if fill color or gradient is valid
bool needsFill = false;
- SkPaint paint;
+ Paint paint;
if (properties.getFillGradient() != nullptr) {
paint.setColor(applyAlpha(SK_ColorBLACK, properties.getFillAlpha()));
- paint.setShader(sk_sp<SkShader>(SkSafeRef(properties.getFillGradient())));
+ paint.setShader(sk_sp<Shader>(SkSafeRef(properties.getFillGradient())));
needsFill = true;
} else if (properties.getFillColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getFillColor(), properties.getFillAlpha()));
@@ -179,7 +178,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<SkShader>(SkSafeRef(properties.getStrokeGradient())));
+ paint.setShader(sk_sp<Shader>(SkSafeRef(properties.getStrokeGradient())));
needsStroke = true;
} else if (properties.getStrokeColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getStrokeColor(), properties.getStrokeAlpha()));