OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |