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

Side by Side Diff: gm/complexclip_blur_tiled.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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 unified diff | Download patch
« no previous file with comments | « gm/colorwheel.cpp ('k') | gm/dftext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkRRect.h" 10 #include "SkRRect.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 tileCanvas->clear(0); 51 tileCanvas->clear(0);
52 tileCanvas->translate(-x, -y); 52 tileCanvas->translate(-x, -y);
53 SkRect rect = SkRect::MakeWH(WIDTH, HEIGHT); 53 SkRect rect = SkRect::MakeWH(WIDTH, HEIGHT);
54 tileCanvas->saveLayer(&rect, &blurPaint); 54 tileCanvas->saveLayer(&rect, &blurPaint);
55 SkRRect rrect = SkRRect::MakeRectXY(rect.makeInset(20, 20), 25, 25); 55 SkRRect rrect = SkRRect::MakeRectXY(rect.makeInset(20, 20), 25, 25);
56 tileCanvas->clipRRect(rrect, SkRegion::kDifference_Op, true); 56 tileCanvas->clipRRect(rrect, SkRegion::kDifference_Op, true);
57 SkPaint paint; 57 SkPaint paint;
58 tileCanvas->drawRect(rect, paint); 58 tileCanvas->drawRect(rect, paint);
59 tileCanvas->restore(); 59 tileCanvas->restore();
60 tileCanvas->restore(); 60 tileCanvas->restore();
61 SkAutoTUnref<SkImage> tileImage(tileSurface->newImageSnapshot()) ; 61 canvas->drawImage(tileSurface->makeImageSnapshot().get(), x, y);
62 canvas->drawImage(tileImage, x, y);
63 } 62 }
64 } 63 }
65 } 64 }
66 65
67 private: 66 private:
68 typedef GM INHERITED; 67 typedef GM INHERITED;
69 }; 68 };
70 69
71 ////////////////////////////////////////////////////////////////////////////// 70 //////////////////////////////////////////////////////////////////////////////
72 71
73 static GM* MyFactory1(void*) { return new ComplexClipBlurTiledGM(); } 72 static GM* MyFactory1(void*) { return new ComplexClipBlurTiledGM(); }
74 static GMRegistry reg1(MyFactory1); 73 static GMRegistry reg1(MyFactory1);
75 74
76 } 75 }
OLDNEW
« no previous file with comments | « gm/colorwheel.cpp ('k') | gm/dftext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698