aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/example.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/example.cpp')
-rw-r--r--cmake/example.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmake/example.cpp b/cmake/example.cpp
index 247deafd62..93611d7c96 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.