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

Side by Side Diff: src/gpu/GrReducedClip.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, 1 month 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 | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.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 "GrReducedClip.h" 8 #include "GrReducedClip.h"
9 9
10 typedef SkClipStack::Element Element; 10 typedef SkClipStack::Element Element;
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 stackBounds.roundOut(&stackIBounds); 409 stackBounds.roundOut(&stackIBounds);
410 if (!tighterBounds->intersect(queryBounds, stackIBounds)) { 410 if (!tighterBounds->intersect(queryBounds, stackIBounds)) {
411 SkASSERT(0); 411 SkASSERT(0);
412 tighterBounds->setEmpty(); 412 tighterBounds->setEmpty();
413 } 413 }
414 bounds = tighterBounds; 414 bounds = tighterBounds;
415 } 415 }
416 } else { 416 } else {
417 if (stackBounds.contains(scalarQueryBounds)) { 417 if (stackBounds.contains(scalarQueryBounds)) {
418 *initialState = kAllOut_InitialState; 418 *initialState = kAllOut_InitialState;
419 if (requiresAA) { 419 // We know that the bounding box contains all the pixels that ar e outside the clip,
420 *requiresAA = false; 420 // but we don't know that *all* the pixels in the box are outsid e the clip. So
421 } 421 // proceed to walking the stack.
422 return;
423 } 422 }
424 if (tighterBounds) { 423 if (tighterBounds) {
425 *tighterBounds = queryBounds; 424 *tighterBounds = queryBounds;
426 } 425 }
427 } 426 }
428 } 427 }
429 428
430 SkRect scalarBounds = SkRect::Make(*bounds); 429 SkRect scalarBounds = SkRect::Make(*bounds);
431 430
432 // Now that we have determined the bounds to use and filtered out the trivia l cases, call the 431 // Now that we have determined the bounds to use and filtered out the trivia l cases, call the
433 // helper that actually walks the stack. 432 // helper that actually walks the stack.
434 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState, requiresAA); 433 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState, requiresAA);
435 434
436 // The list that was computed in this function may be cached based on the ge n id of the last 435 // The list that was computed in this function may be cached based on the ge n id of the last
437 // element. 436 // element.
438 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID); 437 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID);
439 } 438 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698