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

Unified Diff: gm/gamma.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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/filltypespersp.cpp ('k') | gm/gammatext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gamma.cpp
diff --git a/gm/gamma.cpp b/gm/gamma.cpp
index 003061baebff4e66760e36c46b97f2676d626df5..1699083471fb948f6a02612a656d09f3a43d64d3 100644
--- a/gm/gamma.cpp
+++ b/gm/gamma.cpp
@@ -88,8 +88,7 @@ DEF_SIMPLE_GM(gamma, canvas, 500, 200) {
canvas->save();
// Black/white dither, pixel perfect. This is ground truth.
- p.setShader(SkShader::CreateBitmapShader(
- ditherBmp, rpt, rpt))->unref();
+ p.setShader(SkShader::MakeBitmapShader(ditherBmp, rpt, rpt));
p.setFilterQuality(SkFilterQuality::kNone_SkFilterQuality);
nextRect("Dither", "Reference");
@@ -98,15 +97,13 @@ DEF_SIMPLE_GM(gamma, canvas, 500, 200) {
// the raster pipeline into *not* snapping to nearest.
SkMatrix offsetMatrix = SkMatrix::Concat(
SkMatrix::MakeScale(-1.0f), SkMatrix::MakeTrans(0.5f, 0.0f));
- p.setShader(SkShader::CreateBitmapShader(
- ditherBmp, rpt, rpt, &offsetMatrix))->unref();
+ p.setShader(SkShader::MakeBitmapShader(ditherBmp, rpt, rpt, &offsetMatrix));
p.setFilterQuality(SkFilterQuality::kMedium_SkFilterQuality);
nextRect("Dither", "Bilerp");
// Black/white dither, scaled down by 2x. Tests minification.
SkMatrix scaleMatrix = SkMatrix::MakeScale(0.5f);
- p.setShader(SkShader::CreateBitmapShader(
- ditherBmp, rpt, rpt, &scaleMatrix))->unref();
+ p.setShader(SkShader::MakeBitmapShader(ditherBmp, rpt, rpt, &scaleMatrix));
p.setFilterQuality(SkFilterQuality::kMedium_SkFilterQuality);
nextRect("Dither", "Scale");
@@ -121,8 +118,8 @@ DEF_SIMPLE_GM(gamma, canvas, 500, 200) {
SkPoint::Make(sz + (sz * 10), 0)
};
SkColor colors[2] = { SK_ColorBLACK, SK_ColorWHITE };
- p.setShader(SkGradientShader::CreateLinear(
- points, colors, nullptr, 2, SkShader::kClamp_TileMode))->unref();
+ p.setShader(SkGradientShader::MakeLinear(points, colors, nullptr, 2,
+ SkShader::kClamp_TileMode));
nextRect("Gradient", 0);
// 50% grey from linear bitmap, with drawBitmap
@@ -132,12 +129,12 @@ DEF_SIMPLE_GM(gamma, canvas, 500, 200) {
nextBitmap(srgbGreyBmp, "sRGB BMP");
// Bitmap wrapped in a shader (linear):
- p.setShader(SkShader::CreateBitmapShader(linearGreyBmp, rpt, rpt))->unref();
+ p.setShader(SkShader::MakeBitmapShader(linearGreyBmp, rpt, rpt));
p.setFilterQuality(SkFilterQuality::kMedium_SkFilterQuality);
nextRect("Lnr BMP", "Shader");
// Bitmap wrapped in a shader (sRGB):
- p.setShader(SkShader::CreateBitmapShader(srgbGreyBmp, rpt, rpt))->unref();
+ p.setShader(SkShader::MakeBitmapShader(srgbGreyBmp, rpt, rpt));
p.setFilterQuality(SkFilterQuality::kMedium_SkFilterQuality);
nextRect("sRGB BMP", "Shader");
« no previous file with comments | « gm/filltypespersp.cpp ('k') | gm/gammatext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698