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

Side by Side Diff: gm/rrects.cpp

Issue 2357333002: allow clip calls w/o op param, remove unnecessary kReplace ops (Closed)
Patch Set: Created 4 years, 3 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/rrectclipdrawpaint.cpp ('k') | gm/samplerstress.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 "GrContext.h" 10 #include "GrContext.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 SkAutoTUnref<GrDrawBatch> batch( 117 SkAutoTUnref<GrDrawBatch> batch(
118 GrRectBatchFactory::CreateNonAAFill(0xff0000 00, SkMatrix::I(), 118 GrRectBatchFactory::CreateNonAAFill(0xff0000 00, SkMatrix::I(),
119 bounds, nullptr, nullptr)); 119 bounds, nullptr, nullptr));
120 drawContext->drawContextPriv().testingOnly_drawBatch (grPaint, batch); 120 drawContext->drawContextPriv().testingOnly_drawBatch (grPaint, batch);
121 } else { 121 } else {
122 drew = false; 122 drew = false;
123 } 123 }
124 #endif 124 #endif
125 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType) { 125 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType) {
126 bool aaClip = (kAA_Clip_Type == fType); 126 bool aaClip = (kAA_Clip_Type == fType);
127 canvas->clipRRect(fRRects[curRRect], SkCanvas::kReplace_ Op, aaClip); 127 canvas->clipRRect(fRRects[curRRect], aaClip);
128 canvas->drawRect(kMaxTileBound, paint); 128 canvas->drawRect(kMaxTileBound, paint);
129 } else { 129 } else {
130 canvas->drawRRect(fRRects[curRRect], paint); 130 canvas->drawRRect(fRRects[curRRect], paint);
131 } 131 }
132 canvas->restore(); 132 canvas->restore();
133 if (drew) { 133 if (drew) {
134 x = x + kTileX; 134 x = x + kTileX;
135 if (x > kImageWidth) { 135 if (x > kImageWidth) {
136 x = 1; 136 x = 1;
137 y += kTileY; 137 y += kTileY;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) 252 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); )
253 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) 253 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
254 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) 254 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
255 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) 255 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
256 #if SK_SUPPORT_GPU 256 #if SK_SUPPORT_GPU
257 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) 257 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
258 #endif 258 #endif
259 259
260 } 260 }
OLDNEW
« no previous file with comments | « gm/rrectclipdrawpaint.cpp ('k') | gm/samplerstress.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698