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

Side by Side Diff: src/gpu/GrClipMaskManager.cpp

Issue 204983003: Only use analytic effect-based clipping when AA is required by at least one element. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase 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 | « expectations/gm/ignored-tests.txt ('k') | no next file » | 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 2012 Google Inc. 3 * Copyright 2012 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 #include "GrClipMaskManager.h" 9 #include "GrClipMaskManager.h"
10 #include "GrAAConvexPathRenderer.h" 10 #include "GrAAConvexPathRenderer.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // diff RR 261 // diff RR
262 // isect convex_poly 262 // isect convex_poly
263 // isect convex_poly 263 // isect convex_poly
264 // when drawing rounded div borders. This could probably be tuned based on a 264 // when drawing rounded div borders. This could probably be tuned based on a
265 // configuration's relative costs of switching RTs to generate a mask vs 265 // configuration's relative costs of switching RTs to generate a mask vs
266 // longer shaders. 266 // longer shaders.
267 if (elements.count() <= 4) { 267 if (elements.count() <= 4) {
268 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), 268 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX),
269 SkIntToScalar(-clipDataIn->fOrigin.fY) }; 269 SkIntToScalar(-clipDataIn->fOrigin.fY) };
270 if (elements.isEmpty() || 270 if (elements.isEmpty() ||
271 this->installClipEffects(elements, are, clipToRTOffset, devBounds)) { 271 (requiresAA && this->installClipEffects(elements, are, clipToRTOffse t, devBounds))) {
272 SkIRect scissorSpaceIBounds(clipSpaceIBounds); 272 SkIRect scissorSpaceIBounds(clipSpaceIBounds);
273 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); 273 scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
274 if (NULL == devBounds || 274 if (NULL == devBounds ||
275 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { 275 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
276 fGpu->enableScissor(scissorSpaceIBounds); 276 fGpu->enableScissor(scissorSpaceIBounds);
277 } else { 277 } else {
278 fGpu->disableScissor(); 278 fGpu->disableScissor();
279 } 279 }
280 this->setGpuStencil(); 280 this->setGpuStencil();
281 return true; 281 return true;
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 1144
1145 // TODO: dynamically attach a stencil buffer 1145 // TODO: dynamically attach a stencil buffer
1146 int stencilBits = 0; 1146 int stencilBits = 0;
1147 GrStencilBuffer* stencilBuffer = 1147 GrStencilBuffer* stencilBuffer =
1148 drawState.getRenderTarget()->getStencilBuffer(); 1148 drawState.getRenderTarget()->getStencilBuffer();
1149 if (NULL != stencilBuffer) { 1149 if (NULL != stencilBuffer) {
1150 stencilBits = stencilBuffer->bits(); 1150 stencilBits = stencilBuffer->bits();
1151 this->adjustStencilParams(settings, clipMode, stencilBits); 1151 this->adjustStencilParams(settings, clipMode, stencilBits);
1152 } 1152 }
1153 } 1153 }
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698