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

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

Issue 825983005: Revert of It is dangerous to ignore SkRect::intersect's return value (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « src/effects/SkBlurMaskFilter.cpp ('k') | src/utils/SkGatherPixelRefsAndRects.h » ('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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 if (!SkRect::Intersects(stackBounds, scalarQueryBounds)) { 402 if (!SkRect::Intersects(stackBounds, scalarQueryBounds)) {
403 *initialState = kAllOut_InitialState; 403 *initialState = kAllOut_InitialState;
404 if (requiresAA) { 404 if (requiresAA) {
405 *requiresAA = false; 405 *requiresAA = false;
406 } 406 }
407 return; 407 return;
408 } 408 }
409 if (tighterBounds) { 409 if (tighterBounds) {
410 SkIRect stackIBounds; 410 SkIRect stackIBounds;
411 stackBounds.roundOut(&stackIBounds); 411 stackBounds.roundOut(&stackIBounds);
412 if (!tighterBounds->intersect(queryBounds, stackIBounds)) { 412 tighterBounds->intersect(queryBounds, stackIBounds);
413 SkASSERT(0);
414 tighterBounds->setEmpty();
415 }
416 bounds = tighterBounds; 413 bounds = tighterBounds;
417 } 414 }
418 } else { 415 } else {
419 if (stackBounds.contains(scalarQueryBounds)) { 416 if (stackBounds.contains(scalarQueryBounds)) {
420 *initialState = kAllOut_InitialState; 417 *initialState = kAllOut_InitialState;
421 if (requiresAA) { 418 if (requiresAA) {
422 *requiresAA = false; 419 *requiresAA = false;
423 } 420 }
424 return; 421 return;
425 } 422 }
426 if (tighterBounds) { 423 if (tighterBounds) {
427 *tighterBounds = queryBounds; 424 *tighterBounds = queryBounds;
428 } 425 }
429 } 426 }
430 } 427 }
431 428
432 SkRect scalarBounds = SkRect::Make(*bounds); 429 SkRect scalarBounds = SkRect::Make(*bounds);
433 430
434 // 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
435 // helper that actually walks the stack. 432 // helper that actually walks the stack.
436 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState, requiresAA); 433 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState, requiresAA);
437 434
438 // 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
439 // element. 436 // element.
440 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID); 437 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID);
441 } 438 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/utils/SkGatherPixelRefsAndRects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698