summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2016-10-07 15:59:20 -0400
committerMike Reed <reed@google.com>2016-10-13 17:14:52 -0400
commit260ab726486317496bc12a57d599ea96dcde3284 (patch)
treebe150530fd0597507dddf3a670f2480563dd1e00 /libs/hwui/VectorDrawable.cpp
parentccbc5c183067ae988f57725cfafda855bafa47ec (diff)
use SkBlendMode instead of SkXfermode
use sk_sp versions of paint setters/getters Change-Id: I86591a0a8ec92e6039776cbf00424ea24f585b28
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index a2f3cb6b3d85..715681d5fca6 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -201,10 +201,7 @@ void FullPath::drawPath(SkCanvas* outCanvas, SkPath& renderPath, float strokeSca
SkPaint paint;
if (properties.getFillGradient() != nullptr) {
paint.setColor(applyAlpha(SK_ColorBLACK, properties.getFillAlpha()));
- SkShader* newShader = properties.getFillGradient()->newWithLocalMatrix(matrix);
- // newWithLocalMatrix(...) creates a new SkShader and returns a bare pointer. We need to
- // remove the extra ref so that the ref count is correctly managed.
- paint.setShader(newShader)->unref();
+ paint.setShader(properties.getFillGradient()->makeWithLocalMatrix(matrix));
needsFill = true;
} else if (properties.getFillColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getFillColor(), properties.getFillAlpha()));
@@ -223,10 +220,7 @@ void FullPath::drawPath(SkCanvas* outCanvas, SkPath& renderPath, float strokeSca
bool needsStroke = false;
if (properties.getStrokeGradient() != nullptr) {
paint.setColor(applyAlpha(SK_ColorBLACK, properties.getStrokeAlpha()));
- SkShader* newShader = properties.getStrokeGradient()->newWithLocalMatrix(matrix);
- // newWithLocalMatrix(...) creates a new SkShader and returns a bare pointer. We need to
- // remove the extra ref so that the ref count is correctly managed.
- paint.setShader(newShader)->unref();
+ paint.setShader(properties.getStrokeGradient()->makeWithLocalMatrix(matrix));
needsStroke = true;
} else if (properties.getStrokeColor() != SK_ColorTRANSPARENT) {
paint.setColor(applyAlpha(properties.getStrokeColor(), properties.getStrokeAlpha()));
@@ -534,7 +528,7 @@ SkPaint* Tree::updatePaint(SkPaint* outPaint, TreeProperties* prop) {
if (prop->getRootAlpha() == 1.0f && prop->getColorFilter() == nullptr) {
return nullptr;
} else {
- outPaint->setColorFilter(prop->getColorFilter());
+ outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter()));
outPaint->setFilterQuality(kLow_SkFilterQuality);
outPaint->setAlpha(prop->getRootAlpha() * 255);
return outPaint;