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

Unified Diff: gm/complexclip_blur_tiled.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/colorfilterimagefilter.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/complexclip_blur_tiled.cpp
diff --git a/gm/complexclip_blur_tiled.cpp b/gm/complexclip_blur_tiled.cpp
index 9413e64e07d4cce42774486a69edc695b50897fc..979c7e7423fa81cfb6bcc62beea99d81b9adfe29 100644
--- a/gm/complexclip_blur_tiled.cpp
+++ b/gm/complexclip_blur_tiled.cpp
@@ -31,22 +31,21 @@ protected:
void onDraw(SkCanvas* canvas) override {
SkPaint blurPaint;
- SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(5.0f, 5.0f));
- blurPaint.setImageFilter(blur);
- const SkScalar tile_size = SkIntToScalar(128);
+ blurPaint.setImageFilter(SkBlurImageFilter::Make(5.0f, 5.0f, nullptr));
+ const SkScalar tileSize = SkIntToScalar(128);
SkRect bounds;
if (!canvas->getClipBounds(&bounds)) {
bounds.setEmpty();
}
- int ts = SkScalarCeilToInt(tile_size);
+ int ts = SkScalarCeilToInt(tileSize);
SkImageInfo info = SkImageInfo::MakeN32Premul(ts, ts);
auto tileSurface(canvas->makeSurface(info));
if (!tileSurface) {
tileSurface = SkSurface::MakeRaster(info);
}
SkCanvas* tileCanvas = tileSurface->getCanvas();
- 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) {
tileCanvas->save();
tileCanvas->clear(0);
tileCanvas->translate(-x, -y);
@@ -69,7 +68,6 @@ private:
//////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory1(void*) { return new ComplexClipBlurTiledGM(); }
-static GMRegistry reg1(MyFactory1);
+DEF_GM(return new ComplexClipBlurTiledGM;)
}
« no previous file with comments | « gm/colorfilterimagefilter.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698