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

Unified Diff: gm/shadertext3.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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 07ecd7184b7305b117ed7667a799cf60370fd79a..0d1c03e345a20846d3f77cf1d6b9e382bcf02547 100644
--- a/gm/shadertext3.cpp
+++ b/gm/shadertext3.cpp
@@ -26,11 +26,11 @@ static void makebm(SkBitmap* bm, int w, int h) {
SkPaint paint;
- paint.setShader(SkGradientShader::CreateLinear(kPts0, kColors0, kPos,
- SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode))->unref();
+ paint.setShader(SkGradientShader::MakeLinear(kPts0, kColors0, kPos,
+ SK_ARRAY_COUNT(kColors0), SkShader::kClamp_TileMode));
canvas.drawPaint(paint);
- paint.setShader(SkGradientShader::CreateLinear(kPts1, kColors1, kPos,
- SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode))->unref();
+ paint.setShader(SkGradientShader::MakeLinear(kPts1, kColors1, kPos,
+ SK_ARRAY_COUNT(kColors1), SkShader::kClamp_TileMode));
canvas.drawPaint(paint);
}
@@ -100,17 +100,13 @@ protected:
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(shader);
+ fillPaint.setShader(SkShader::MakeBitmapShader(fBmp, kTileModes[tm0],
+ kTileModes[tm1], &localM));
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