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

Unified Diff: gm/shadertext3.cpp

Issue 1790353002: Revert of more shader-->sp conversions (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 | « gm/shadertext2.cpp ('k') | gm/shadows.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shadertext3.cpp
diff --git a/gm/shadertext3.cpp b/gm/shadertext3.cpp
index 0d1c03e345a20846d3f77cf1d6b9e382bcf02547..07ecd7184b7305b117ed7667a799cf60370fd79a 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -26,11 +26,11 @@
SkPaint paint;
- paint.setShader(SkGradientShader::MakeLinear(kPts0, kColors0, kPos,
- SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode));
+ paint.setShader(SkGradientShader::CreateLinear(kPts0, kColors0, kPos,
+ SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode))->unref();
canvas.drawPaint(paint);
- paint.setShader(SkGradientShader::MakeLinear(kPts1, kColors1, kPos,
- SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode));
+ paint.setShader(SkGradientShader::CreateLinear(kPts1, kColors1, kPos,
+ SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode))->unref();
canvas.drawPaint(paint);
}
@@ -100,13 +100,17 @@
localM.postRotate(20);
localM.postScale(1.15f, .85f);
+ SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(fBmp,
+ kTileModes[tm0],
+ kTileModes[tm1],
+ &localM));
+
SkPaint fillPaint;
fillPaint.setAntiAlias(true);
sk_tool_utils::set_portable_typeface(&fillPaint);
fillPaint.setTextSize(SkIntToScalar(kPointSize));
fillPaint.setFilterQuality(kLow_SkFilterQuality);
- fillPaint.setShader(SkShader::MakeBitmapShader(fBmp, kTileModes[tm0],
- kTileModes[tm1], &localM));
+ fillPaint.setShader(shader);
canvas->drawText(kText, kTextLen, 0, 0, fillPaint);
canvas->drawText(kText, kTextLen, 0, 0, outlinePaint);
« no previous file with comments | « gm/shadertext2.cpp ('k') | gm/shadows.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698