Index: example/HelloWorld.cpp |
diff --git a/example/HelloWorld.cpp b/example/HelloWorld.cpp |
index e13cb3b438045ef777ca711b471081b1981bdf4f..e30c4674e8d89a6e752fa96831fd07c90cf94cb7 100644 |
--- a/example/HelloWorld.cpp |
+++ b/example/HelloWorld.cpp |
@@ -93,10 +93,7 @@ void HelloWorldWindow::drawContents(SkCanvas* canvas) { |
paint.setColor(SK_ColorRED); |
// Draw a rectangle with red paint |
- SkRect rect = { |
- 10, 10, |
- 128, 128 |
- }; |
+ SkRect rect = SkRect::MakeXYWH(10, 10, 128, 128); |
canvas->drawRect(rect, paint); |
// Set up a linear gradient and draw a circle |
@@ -107,18 +104,15 @@ void HelloWorldWindow::drawContents(SkCanvas* canvas) { |
}; |
SkColor linearColors[] = {SK_ColorGREEN, SK_ColorBLACK}; |
- SkShader* shader = SkGradientShader::CreateLinear( |
- linearPoints, linearColors, NULL, 2, |
- SkShader::kMirror_TileMode); |
- SkAutoUnref shader_deleter(shader); |
- |
- paint.setShader(shader); |
+ paint.setShader(SkGradientShader::MakeLinear( |
+ linearPoints, linearColors, nullptr, 2, |
+ SkShader::kMirror_TileMode)); |
paint.setFlags(SkPaint::kAntiAlias_Flag); |
canvas->drawCircle(200, 200, 64, paint); |
// Detach shader |
- paint.setShader(NULL); |
+ paint.setShader(nullptr); |
} |
// Draw a message with a nice black paint. |