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

Unified Diff: samplecode/SampleLayers.cpp

Issue 1772463002: use Make instead of Create to return a shared shader (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 | « samplecode/SampleHairModes.cpp ('k') | samplecode/SamplePatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleLayers.cpp
diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp
index f8ebd7c94f5077e88feb92edb13d1b249a228ff9..beb7e4ae1a736b08cc75e70d4582c2cc859396d7 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -1,10 +1,10 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SampleCode.h"
#include "SkView.h"
#include "SkCanvas.h"
@@ -30,10 +30,8 @@
static void make_paint(SkPaint* paint, const SkMatrix& localMatrix) {
SkColor colors[] = { 0, SK_ColorWHITE };
SkPoint pts[] = { { 0, 0 }, { 0, SK_Scalar1*20 } };
- SkShader* s = SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode,
- 0, &localMatrix);
-
- paint->setShader(s)->unref();
+ paint->setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
+ SkShader::kClamp_TileMode, 0, &localMatrix));
paint->setXfermodeMode(SkXfermode::kDstIn_Mode);
}
« no previous file with comments | « samplecode/SampleHairModes.cpp ('k') | samplecode/SamplePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698