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

Side by Side Diff: gm/beziereffects.cpp

Issue 197433002: support direct writing to top layer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/convexpolyeffect.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return make_isize(800, 800); 53 return make_isize(800, 800);
54 } 54 }
55 55
56 virtual uint32_t onGetFlags() const SK_OVERRIDE { 56 virtual uint32_t onGetFlags() const SK_OVERRIDE {
57 // This is a GPU-specific GM. 57 // This is a GPU-specific GM.
58 return kGPUOnly_Flag; 58 return kGPUOnly_Flag;
59 } 59 }
60 60
61 61
62 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 62 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
63 SkBaseDevice* device = canvas->getTopDevice(); 63 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
64 GrRenderTarget* rt = device->accessRenderTarget();
65 if (NULL == rt) { 64 if (NULL == rt) {
66 return; 65 return;
67 } 66 }
68 GrContext* context = rt->getContext(); 67 GrContext* context = rt->getContext();
69 if (NULL == context) { 68 if (NULL == context) {
70 return; 69 return;
71 } 70 }
72 71
73 struct Vertex { 72 struct Vertex {
74 SkPoint fPosition; 73 SkPoint fPosition;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return make_isize(800, 800); 211 return make_isize(800, 800);
213 } 212 }
214 213
215 virtual uint32_t onGetFlags() const SK_OVERRIDE { 214 virtual uint32_t onGetFlags() const SK_OVERRIDE {
216 // This is a GPU-specific GM. 215 // This is a GPU-specific GM.
217 return kGPUOnly_Flag; 216 return kGPUOnly_Flag;
218 } 217 }
219 218
220 219
221 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 220 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
222 SkBaseDevice* device = canvas->getTopDevice(); 221 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
223 GrRenderTarget* rt = device->accessRenderTarget();
224 if (NULL == rt) { 222 if (NULL == rt) {
225 return; 223 return;
226 } 224 }
227 GrContext* context = rt->getContext(); 225 GrContext* context = rt->getContext();
228 if (NULL == context) { 226 if (NULL == context) {
229 return; 227 return;
230 } 228 }
231 229
232 struct Vertex { 230 struct Vertex {
233 SkPoint fPosition; 231 SkPoint fPosition;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 return make_isize(800, 800); 402 return make_isize(800, 800);
405 } 403 }
406 404
407 virtual uint32_t onGetFlags() const SK_OVERRIDE { 405 virtual uint32_t onGetFlags() const SK_OVERRIDE {
408 // This is a GPU-specific GM. 406 // This is a GPU-specific GM.
409 return kGPUOnly_Flag; 407 return kGPUOnly_Flag;
410 } 408 }
411 409
412 410
413 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 411 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
414 SkBaseDevice* device = canvas->getTopDevice(); 412 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
415 GrRenderTarget* rt = device->accessRenderTarget();
416 if (NULL == rt) { 413 if (NULL == rt) {
417 return; 414 return;
418 } 415 }
419 GrContext* context = rt->getContext(); 416 GrContext* context = rt->getContext();
420 if (NULL == context) { 417 if (NULL == context) {
421 return; 418 return;
422 } 419 }
423 420
424 struct Vertex { 421 struct Vertex {
425 SkPoint fPosition; 422 SkPoint fPosition;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 typedef GM INHERITED; 530 typedef GM INHERITED;
534 }; 531 };
535 532
536 DEF_GM( return SkNEW(BezierCubicEffects); ) 533 DEF_GM( return SkNEW(BezierCubicEffects); )
537 DEF_GM( return SkNEW(BezierConicEffects); ) 534 DEF_GM( return SkNEW(BezierConicEffects); )
538 DEF_GM( return SkNEW(BezierQuadEffects); ) 535 DEF_GM( return SkNEW(BezierQuadEffects); )
539 536
540 } 537 }
541 538
542 #endif 539 #endif
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698