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

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

Issue 1467253002: Restrict query bounds for reduce clip to dev bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years 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 | src/gpu/GrDrawContext.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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 SkIRect scissor = clip.irect(); 310 SkIRect scissor = clip.irect();
311 if (scissor.intersect(clipSpaceRTIBounds)) { 311 if (scissor.intersect(clipSpaceRTIBounds)) {
312 out->fScissorState.set(scissor); 312 out->fScissorState.set(scissor);
313 this->setPipelineBuilderStencil(pipelineBuilder, ars); 313 this->setPipelineBuilderStencil(pipelineBuilder, ars);
314 return true; 314 return true;
315 } 315 }
316 return false; 316 return false;
317 } 317 }
318 case GrClip::kClipStack_ClipType: { 318 case GrClip::kClipStack_ClipType: {
319 clipSpaceRTIBounds.offset(clip.origin()); 319 clipSpaceRTIBounds.offset(clip.origin());
320 SkIRect clipSpaceReduceQueryBounds;
321 if (devBounds) {
322 SkIRect devIBounds = devBounds->roundOut();
323 devIBounds.offset(clip.origin());
324 if (!clipSpaceReduceQueryBounds.intersect(clipSpaceRTIBounds, de vIBounds)) {
325 return false;
326 }
327 } else {
328 clipSpaceReduceQueryBounds = clipSpaceRTIBounds;
329 }
320 GrReducedClip::ReduceClipStack(*clip.clipStack(), 330 GrReducedClip::ReduceClipStack(*clip.clipStack(),
321 clipSpaceRTIBounds, 331 clipSpaceReduceQueryBounds,
322 &elements, 332 &elements,
323 &genID, 333 &genID,
324 &initialState, 334 &initialState,
325 &clipSpaceIBounds, 335 &clipSpaceIBounds,
326 &requiresAA); 336 &requiresAA);
327 if (elements.isEmpty()) { 337 if (elements.isEmpty()) {
328 if (GrReducedClip::kAllIn_InitialState == initialState) { 338 if (GrReducedClip::kAllIn_InitialState == initialState) {
329 if (clipSpaceIBounds == clipSpaceRTIBounds) { 339 if (clipSpaceIBounds == clipSpaceRTIBounds) {
330 this->setPipelineBuilderStencil(pipelineBuilder, ars); 340 this->setPipelineBuilderStencil(pipelineBuilder, ars);
331 return true; 341 return true;
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 1106
1097 //////////////////////////////////////////////////////////////////////////////// 1107 ////////////////////////////////////////////////////////////////////////////////
1098 1108
1099 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment, 1109 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment,
1100 GrStencilSettings* settings) { 1110 GrStencilSettings* settings) {
1101 if (stencilAttachment) { 1111 if (stencilAttachment) {
1102 int stencilBits = stencilAttachment->bits(); 1112 int stencilBits = stencilAttachment->bits();
1103 this->adjustStencilParams(settings, fClipMode, stencilBits); 1113 this->adjustStencilParams(settings, fClipMode, stencilBits);
1104 } 1114 }
1105 } 1115 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698