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

Unified Diff: gm/pictureimagegenerator.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/perspshaders.cpp ('k') | gm/pictureshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pictureimagegenerator.cpp
diff --git a/gm/pictureimagegenerator.cpp b/gm/pictureimagegenerator.cpp
index 829006d80876e86759b020b1f90af659a1522edc..2d50f3a6bedde651d0a90c2bcf9930314512cf19 100644
--- a/gm/pictureimagegenerator.cpp
+++ b/gm/pictureimagegenerator.cpp
@@ -68,10 +68,8 @@ static void draw_vector_logo(SkCanvas* canvas, const SkRect& viewBox) {
const SkScalar pos1[] = { 0, 0.75f };
const SkColor colors1[] = { SK_ColorTRANSPARENT, SK_ColorBLACK };
SkASSERT(SK_ARRAY_COUNT(pos1) == SK_ARRAY_COUNT(colors1));
- SkAutoTUnref<SkShader> gradient1(SkGradientShader::CreateLinear(pts1, colors1, pos1,
- SK_ARRAY_COUNT(pos1),
- SkShader::kClamp_TileMode));
- paint.setShader(gradient1.get());
+ paint.setShader(SkGradientShader::MakeLinear(pts1, colors1, pos1, SK_ARRAY_COUNT(pos1),
+ SkShader::kClamp_TileMode));
canvas->drawRect(underlineRect, paint);
const SkPoint pts2[] = { SkPoint::Make(iBox.x() - iBox.width() * kGradientPad, 0),
@@ -88,10 +86,8 @@ static void draw_vector_logo(SkCanvas* canvas, const SkRect& viewBox) {
SK_ColorBLACK
};
SkASSERT(SK_ARRAY_COUNT(pos2) == SK_ARRAY_COUNT(colors2));
- SkAutoTUnref<SkShader> gradient2(SkGradientShader::CreateLinear(pts2, colors2, pos2,
- SK_ARRAY_COUNT(pos2),
- SkShader::kClamp_TileMode));
- paint.setShader(gradient2.get());
+ paint.setShader(SkGradientShader::MakeLinear(pts2, colors2, pos2, SK_ARRAY_COUNT(pos2),
+ SkShader::kClamp_TileMode));
canvas->drawText(kSkiaStr, textLen, 0, 0, paint);
}
« no previous file with comments | « gm/perspshaders.cpp ('k') | gm/pictureshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698