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

Unified Diff: gm/shadertext2.cpp

Issue 245963010: Move SkShader::fLocalMatrix into SkShader constructor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove wrapper Created 6 years, 8 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
Index: gm/shadertext2.cpp
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index f839161dae395787ba507467ab5b855a43df3330..4bedd77ac7e39890c899e1121a6eaac7778a6d94 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -95,6 +95,8 @@ protected:
makebm(&bmp, kPointSize / 2, kPointSize / 2);
}
+ // TODO(dominikg): Do we still need to create this shader here?
+ // The only place where it may be used is in fillPaint.measureText().
SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp,
SkShader::kMirror_TileMode,
SkShader::kRepeat_TileMode));
Dominik Grewe 2014/04/25 17:50:15 I think we can delete this shader here. Wdyt?
scroggo 2014/04/25 17:58:32 I agree. I can't imagine measureText needs to look
@@ -158,7 +160,10 @@ protected:
canvas->translate(0, kPadY / 2 + kPointSize);
columnH += kPadY / 2 + kPointSize;
for (int lm = 0; lm < localMatrices.count(); ++lm) {
- shader->setLocalMatrix(localMatrices[lm].fMatrix);
+ paint.setShader(SkShader::CreateBitmapShader(bmp,
+ SkShader::kMirror_TileMode,
+ SkShader::kRepeat_TileMode,
+ &localMatrices[lm].fMatrix));
canvas->save();
canvas->concat(matrices[m].fMatrix);
« no previous file with comments | « gm/shaderbounds.cpp ('k') | gm/shadertext3.cpp » ('j') | include/core/SkColorShader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698