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

Unified Diff: gm/imageblurtiled.cpp

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments 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/imageblur2.cpp ('k') | gm/imagefilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imageblurtiled.cpp
diff --git a/gm/imageblurtiled.cpp b/gm/imageblurtiled.cpp
index 9f8bfe510f4977f7109e71cfad12493c0b408ac5..415fa7315a2501728c76fc63a480368e239995fb 100644
--- a/gm/imageblurtiled.cpp
+++ b/gm/imageblurtiled.cpp
@@ -21,27 +21,26 @@ public:
}
protected:
- virtual SkString onShortName() {
+ SkString onShortName() override {
return SkString("imageblurtiled");
}
- virtual SkISize onISize() {
+ SkISize onISize() override {
return SkISize::Make(WIDTH, HEIGHT);
}
- virtual void onDraw(SkCanvas* canvas) {
+ void onDraw(SkCanvas* canvas) override {
SkPaint paint;
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(fSigmaX, fSigmaY));
- paint.setImageFilter(blur);
- const SkScalar tile_size = SkIntToScalar(128);
+ paint.setImageFilter(SkBlurImageFilter::Make(fSigmaX, fSigmaY, nullptr));
+ const SkScalar tileSize = SkIntToScalar(128);
SkRect bounds;
if (!canvas->getClipBounds(&bounds)) {
bounds.setEmpty();
}
- for (SkScalar y = bounds.top(); y < bounds.bottom(); y += tile_size) {
- for (SkScalar x = bounds.left(); x < bounds.right(); x += tile_size) {
+ for (SkScalar y = bounds.top(); y < bounds.bottom(); y += tileSize) {
+ for (SkScalar x = bounds.left(); x < bounds.right(); x += tileSize) {
canvas->save();
- canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size));
+ canvas->clipRect(SkRect::MakeXYWH(x, y, tileSize, tileSize));
canvas->saveLayer(nullptr, &paint);
const char* str[] = {
"The quick",
@@ -74,7 +73,6 @@ private:
//////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory1(void*) { return new ImageBlurTiledGM(3.0f, 3.0f); }
-static GMRegistry reg1(MyFactory1);
+DEF_GM(return new ImageBlurTiledGM(3.0f, 3.0f);)
}
« no previous file with comments | « gm/imageblur2.cpp ('k') | gm/imagefilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698