| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |