| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // During our backwards walk, track whether we've seen ops that either grow
or shrink the clip. | 28 // During our backwards walk, track whether we've seen ops that either grow
or shrink the clip. |
| 29 // TODO: track these per saved clip so that we can consider them on the forw
ard pass. | 29 // TODO: track these per saved clip so that we can consider them on the forw
ard pass. |
| 30 bool embiggens = false; | 30 bool embiggens = false; |
| 31 bool emsmallens = false; | 31 bool emsmallens = false; |
| 32 | 32 |
| 33 SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); | 33 SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); |
| 34 int numAAElements = 0; | 34 int numAAElements = 0; |
| 35 while ((kUnknown_InitialState == *initialState)) { | 35 while ((kUnknown_InitialState == *initialState)) { |
| 36 const Element* element = iter.prev(); | 36 const Element* element = iter.prev(); |
| 37 if (NULL == element) { | 37 if (nullptr == element) { |
| 38 *initialState = GrReducedClip::kAllIn_InitialState; | 38 *initialState = GrReducedClip::kAllIn_InitialState; |
| 39 break; | 39 break; |
| 40 } | 40 } |
| 41 if (SkClipStack::kEmptyGenID == element->getGenID()) { | 41 if (SkClipStack::kEmptyGenID == element->getGenID()) { |
| 42 *initialState = GrReducedClip::kAllOut_InitialState; | 42 *initialState = GrReducedClip::kAllOut_InitialState; |
| 43 break; | 43 break; |
| 44 } | 44 } |
| 45 if (SkClipStack::kWideOpenGenID == element->getGenID()) { | 45 if (SkClipStack::kWideOpenGenID == element->getGenID()) { |
| 46 *initialState = GrReducedClip::kAllIn_InitialState; | 46 *initialState = GrReducedClip::kAllIn_InitialState; |
| 47 break; | 47 break; |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 SkRect scalarBounds = SkRect::Make(*bounds); | 432 SkRect scalarBounds = SkRect::Make(*bounds); |
| 433 | 433 |
| 434 // Now that we have determined the bounds to use and filtered out the trivia
l cases, call the | 434 // 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. | 435 // helper that actually walks the stack. |
| 436 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState,
requiresAA); | 436 reduced_stack_walker(stack, scalarBounds, result, resultGenID, initialState,
requiresAA); |
| 437 | 437 |
| 438 // The list that was computed in this function may be cached based on the ge
n id of the last | 438 // The list that was computed in this function may be cached based on the ge
n id of the last |
| 439 // element. | 439 // element. |
| 440 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID); | 440 SkASSERT(SkClipStack::kInvalidGenID != *resultGenID); |
| 441 } | 441 } |
| OLD | NEW |