Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/core/SkDraw.cpp

Issue 1790303002: Avoid unneeded ref churn in SkDraw::drawVertices (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 70eb5732e13e7361b815b7494fce08c60c04433c..c35247bd99fc68925deaff6a73ec76a79a5b55b0 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1894,7 +1894,6 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count,
}
// setup the custom shader (if needed)
- sk_sp<SkShader> composeShader;
if (colors) {
if (nullptr == textures) {
// just colors (no texture)
@@ -1908,8 +1907,7 @@ void SkDraw::drawVertices(SkCanvas::VertexMode vmode, int count,
xmode = SkXfermode::Create(SkXfermode::kModulate_Mode);
releaseMode = true;
}
- composeShader = sk_make_sp<SkComposeShader>(triShader, sk_ref_sp(shader), xmode);
- p.setShader(composeShader);
+ p.setShader(sk_make_sp<SkComposeShader>(triShader, sk_ref_sp(shader), xmode));
if (releaseMode) {
xmode->unref();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698