OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |