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

Unified Diff: cmake/example.cpp

Issue 1803783002: Reland of "Finish conversion to sk_sp<SkShader> (patchset #2 id:20001 of https://codereview.chromiu… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update cmake example 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 | « bench/TileBench.cpp ('k') | example/HelloWorld.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmake/example.cpp
diff --git a/cmake/example.cpp b/cmake/example.cpp
index 247deafd628102eba5b4004320665bc29985ad9c..93611d7c96e3ff7abd2c68e8c0a226642073b36f 100644
--- a/cmake/example.cpp
+++ b/cmake/example.cpp
@@ -67,14 +67,11 @@ int main(int, char**) {
// Create a left-to-right green-to-purple gradient shader.
SkPoint pts[] = { {0,0}, {320,240} };
SkColor colors[] = { 0xFF00FF00, 0xFFFF00FF };
- std::shared_ptr<SkShader> shader = adopt(
- SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kRepeat_TileMode));
-
// Our text will draw with this paint: size 24, antialiased, with the shader.
SkPaint paint;
paint.setTextSize(24);
paint.setAntiAlias(true);
- paint.setShader(shader.get());
+ paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kRepeat_TileMode));
// Draw to the surface via its SkCanvas.
SkCanvas* canvas = surface->getCanvas(); // We don't manage this pointer's lifetime.
« no previous file with comments | « bench/TileBench.cpp ('k') | example/HelloWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698