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

Side by Side Diff: gm/rrects.cpp

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 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/beziereffects.cpp ('k') | gm/texturedomaineffect.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; 113 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et;
114 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea te(edgeType, 114 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea te(edgeType,
115 rrect)); 115 rrect));
116 if (fp) { 116 if (fp) {
117 pipelineBuilder.addCoverageProcessor(fp); 117 pipelineBuilder.addCoverageProcessor(fp);
118 pipelineBuilder.setRenderTarget(rt); 118 pipelineBuilder.setRenderTarget(rt);
119 119
120 SkRect bounds = rrect.getBounds(); 120 SkRect bounds = rrect.getBounds();
121 bounds.outset(2.f, 2.f); 121 bounds.outset(2.f, 2.f);
122 122
123 tt.target()->drawSimpleRect(&pipelineBuilder, 0xff00 0000, SkMatrix::I(), 123 tt.target()->drawSimpleRect(&pipelineBuilder,
124 0xff000000,
125 SkMatrix::I(),
124 bounds); 126 bounds);
125 } else { 127 } else {
126 drew = false; 128 drew = false;
127 } 129 }
128 #endif 130 #endif
129 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType) { 131 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType) {
130 bool aaClip = (kAA_Clip_Type == fType); 132 bool aaClip = (kAA_Clip_Type == fType);
131 canvas->clipRRect(fRRects[curRRect], SkRegion::kReplace_ Op, aaClip); 133 canvas->clipRRect(fRRects[curRRect], SkRegion::kReplace_ Op, aaClip);
132 canvas->drawRect(kMaxTileBound, paint); 134 canvas->drawRect(kMaxTileBound, paint);
133 } else { 135 } else {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 257
256 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) 258 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); )
257 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) 259 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
258 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) 260 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
259 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) 261 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
260 #if SK_SUPPORT_GPU 262 #if SK_SUPPORT_GPU
261 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) 263 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
262 #endif 264 #endif
263 265
264 } 266 }
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698