OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // vertically/horizontally thin rects that don't cover pixel centers | 96 // vertically/horizontally thin rects that don't cover pixel centers |
97 fRects.addToTail(SkRect::MakeLTRB(5.55f, 0.5f, 5.75f, 24.5f)); | 97 fRects.addToTail(SkRect::MakeLTRB(5.55f, 0.5f, 5.75f, 24.5f)); |
98 fRects.addToTail(SkRect::MakeLTRB(5.5f, .05f, 29.5f, .25f)); | 98 fRects.addToTail(SkRect::MakeLTRB(5.5f, .05f, 29.5f, .25f)); |
99 // small in x and y | 99 // small in x and y |
100 fRects.addToTail(SkRect::MakeLTRB(5.05f, .55f, 5.45f, .85f)); | 100 fRects.addToTail(SkRect::MakeLTRB(5.05f, .55f, 5.45f, .85f)); |
101 // inverted in x and y | 101 // inverted in x and y |
102 fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f)); | 102 fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f)); |
103 } | 103 } |
104 | 104 |
105 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 105 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
106 SkBaseDevice* device = canvas->getTopDevice(); | 106 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget
(); |
107 GrRenderTarget* rt = device->accessRenderTarget(); | |
108 if (NULL == rt) { | 107 if (NULL == rt) { |
109 return; | 108 return; |
110 } | 109 } |
111 GrContext* context = rt->getContext(); | 110 GrContext* context = rt->getContext(); |
112 if (NULL == context) { | 111 if (NULL == context) { |
113 return; | 112 return; |
114 } | 113 } |
115 | 114 |
116 SkScalar y = 0; | 115 SkScalar y = 0; |
117 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); | 116 for (SkTLList<SkPath>::Iter iter(fPaths, SkTLList<SkPath>::Iter::kHead_I
terStart); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 SkTLList<SkPath> fPaths; | 229 SkTLList<SkPath> fPaths; |
231 SkTLList<SkRect> fRects; | 230 SkTLList<SkRect> fRects; |
232 | 231 |
233 typedef GM INHERITED; | 232 typedef GM INHERITED; |
234 }; | 233 }; |
235 | 234 |
236 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 235 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
237 } | 236 } |
238 | 237 |
239 #endif | 238 #endif |
OLD | NEW |