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

Side by Side Diff: gm/rrects.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 | « gm/convexpolyeffect.cpp ('k') | gm/texdata.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 2012 Google Inc. 2 * Copyright 2012 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 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrTest.h" 10 #include "GrTest.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 virtual uint32_t onGetFlags() const SK_OVERRIDE { 59 virtual uint32_t onGetFlags() const SK_OVERRIDE {
60 if (kEffect_Type == fType) { 60 if (kEffect_Type == fType) {
61 return kGPUOnly_Flag; 61 return kGPUOnly_Flag;
62 } else { 62 } else {
63 return 0; 63 return 0;
64 } 64 }
65 } 65 }
66 66
67 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 67 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
68 #if SK_SUPPORT_GPU 68 #if SK_SUPPORT_GPU
69 SkBaseDevice* device = canvas->getTopDevice(); 69 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
70 GrContext* context = NULL; 70 GrContext* context = rt ? rt->getContext() : NULL;
71 GrRenderTarget* rt = device->accessRenderTarget();
72 if (NULL != rt) {
73 context = rt->getContext();
74 }
75 if (kEffect_Type == fType && NULL == context) { 71 if (kEffect_Type == fType && NULL == context) {
76 return; 72 return;
77 } 73 }
78 #endif 74 #endif
79 75
80 SkPaint paint; 76 SkPaint paint;
81 if (kAA_Draw_Type == fType) { 77 if (kAA_Draw_Type == fType) {
82 paint.setAntiAlias(true); 78 paint.setAntiAlias(true);
83 } 79 }
84 80
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 246
251 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) 247 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); )
252 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) 248 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
253 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) 249 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
254 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) 250 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
255 #if SK_SUPPORT_GPU 251 #if SK_SUPPORT_GPU
256 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) 252 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
257 #endif 253 #endif
258 254
259 } 255 }
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/texdata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698