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

Unified Diff: src/utils/SkNinePatch.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (Closed) Base URL: https://skia.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 | « src/utils/SkMeshUtils.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkNinePatch.cpp
diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp
index 5ee488e44b6a2cce5c0d48211749a1e81aaa6cd1..aeb65b1e2815d00a6bb992c30af9fd529cd5447a 100644
--- a/src/utils/SkNinePatch.cpp
+++ b/src/utils/SkNinePatch.cpp
@@ -236,14 +236,13 @@ void SkNinePatch::DrawMesh(SkCanvas* canvas, const SkRect& bounds,
fillRow(verts, texs, bounds.fBottom, SkIntToScalar(bitmap.height()),
bounds, xDivs, numXDivs, stretchX, bitmap.width());
- SkShader* shader = SkShader::CreateBitmapShader(bitmap,
- SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode);
SkPaint p;
if (paint) {
p = *paint;
}
- p.setShader(shader)->unref();
+ p.setShader(SkShader::MakeBitmapShader(bitmap,
+ SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode));
canvas->drawVertices(SkCanvas::kTriangles_VertexMode, vCount,
mesh.fVerts, mesh.fTexs, mesh.fColors, nullptr,
mesh.fIndices, indexCount, p);
« no previous file with comments | « src/utils/SkMeshUtils.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698