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

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

Issue 941423002: Don't require AA in order to use shader-based clips (Closed) Base URL: https://skia.googlesource.com/skia.git@dynstencil
Patch Set: 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 | « no previous file | 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 * 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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 #include "GrAAHairLinePathRenderer.h" 10 #include "GrAAHairLinePathRenderer.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // diff RR 256 // diff RR
257 // isect convex_poly 257 // isect convex_poly
258 // isect convex_poly 258 // isect convex_poly
259 // when drawing rounded div borders. This could probably be tuned based on a 259 // when drawing rounded div borders. This could probably be tuned based on a
260 // configuration's relative costs of switching RTs to generate a mask vs 260 // configuration's relative costs of switching RTs to generate a mask vs
261 // longer shaders. 261 // longer shaders.
262 if (elements.count() <= 4) { 262 if (elements.count() <= 4) {
263 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), 263 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX),
264 SkIntToScalar(-clipDataIn->fOrigin.fY) }; 264 SkIntToScalar(-clipDataIn->fOrigin.fY) };
265 if (elements.isEmpty() || 265 if (elements.isEmpty() ||
266 (requiresAA && this->installClipEffects(pipelineBuilder, are, elemen ts, clipToRTOffset, 266 this->installClipEffects(pipelineBuilder, are, elements, clipToRTOff set, devBounds)) {
267 devBounds))) {
268 SkIRect scissorSpaceIBounds(clipSpaceIBounds); 267 SkIRect scissorSpaceIBounds(clipSpaceIBounds);
269 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); 268 scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
270 if (NULL == devBounds || 269 if (NULL == devBounds ||
271 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { 270 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
272 scissorState->set(scissorSpaceIBounds); 271 scissorState->set(scissorSpaceIBounds);
273 } 272 }
274 this->setPipelineBuilderStencil(pipelineBuilder, ars); 273 this->setPipelineBuilderStencil(pipelineBuilder, ars);
275 return true; 274 return true;
276 } 275 }
277 } 276 }
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 fAACache.setContext(clipTarget->getContext()); 1081 fAACache.setContext(clipTarget->getContext());
1083 } 1082 }
1084 1083
1085 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu ffer, 1084 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu ffer,
1086 GrStencilSettings* settings) { 1085 GrStencilSettings* settings) {
1087 if (stencilBuffer) { 1086 if (stencilBuffer) {
1088 int stencilBits = stencilBuffer->bits(); 1087 int stencilBits = stencilBuffer->bits();
1089 this->adjustStencilParams(settings, fClipMode, stencilBits); 1088 this->adjustStencilParams(settings, fClipMode, stencilBits);
1090 } 1089 }
1091 } 1090 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698