| OLD | NEW | 
|---|
| 1 | 1 | 
| 2 /* | 2 /* | 
| 3  * Copyright 2012 Google Inc. | 3  * Copyright 2012 Google Inc. | 
| 4  * | 4  * | 
| 5  * Use of this source code is governed by a BSD-style license that can be | 5  * Use of this source code is governed by a BSD-style license that can be | 
| 6  * found in the LICENSE file. | 6  * found in the LICENSE file. | 
| 7  */ | 7  */ | 
| 8 | 8 | 
| 9 #include "GrReducedClip.h" | 9 #include "GrReducedClip.h" | 
| 10 | 10 | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 65         SkRect isectRect; | 65         SkRect isectRect; | 
| 66         if (stackBounds.contains(scalarQueryBounds)) { | 66         if (stackBounds.contains(scalarQueryBounds)) { | 
| 67             *initialState = kAllIn_InitialState; | 67             *initialState = kAllIn_InitialState; | 
| 68             if (NULL != tighterBounds) { | 68             if (NULL != tighterBounds) { | 
| 69                 *tighterBounds = queryBounds; | 69                 *tighterBounds = queryBounds; | 
| 70             } | 70             } | 
| 71             if (NULL != requiresAA) { | 71             if (NULL != requiresAA) { | 
| 72                *requiresAA = false; | 72                *requiresAA = false; | 
| 73             } | 73             } | 
| 74         } else if (isectRect.intersect(stackBounds, scalarQueryBounds)) { | 74         } else if (isectRect.intersect(stackBounds, scalarQueryBounds)) { | 
|  | 75             // If the caller asked for tighter integer bounds we may be able to | 
|  | 76             // return kAllIn and give the bounds with no elements | 
| 75             if (NULL != tighterBounds) { | 77             if (NULL != tighterBounds) { | 
| 76                 isectRect.roundOut(tighterBounds); | 78                 isectRect.roundOut(tighterBounds); | 
| 77                 SkRect scalarTighterBounds = SkRect::Make(*tighterBounds); | 79                 SkRect scalarTighterBounds = SkRect::Make(*tighterBounds); | 
| 78                 if (scalarTighterBounds == isectRect) { | 80                 if (scalarTighterBounds == isectRect) { | 
| 79                     // the round-out didn't add any area outside the clip rect. | 81                     // the round-out didn't add any area outside the clip rect. | 
| 80                     if (NULL != requiresAA) { | 82                     if (NULL != requiresAA) { | 
| 81                         *requiresAA = false; | 83                         *requiresAA = false; | 
| 82                     } | 84                     } | 
| 83                     *initialState = kAllIn_InitialState; | 85                     *initialState = kAllIn_InitialState; | 
| 84                     return; | 86                     return; | 
| 85                 } | 87                 } | 
| 86                 *initialState = kAllOut_InitialState; | 88             } | 
| 87                 // iior should only be true if aa/non-aa status matches among al
     l elements. | 89             *initialState = kAllOut_InitialState; | 
| 88                 SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart)
     ; | 90             // iior should only be true if aa/non-aa status matches among all el
     ements. | 
| 89                 bool doAA = iter.prev()->isAA(); | 91             SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); | 
| 90                 SkNEW_INSERT_AT_LLIST_HEAD(result, Element, (isectRect, SkRegion
     ::kReplace_Op, doAA)); | 92             bool doAA = iter.prev()->isAA(); | 
| 91                 if (NULL != requiresAA) { | 93             SkNEW_INSERT_AT_LLIST_HEAD(result, Element, (isectRect, SkRegion::kR
     eplace_Op, doAA)); | 
| 92                     *requiresAA = doAA; | 94             if (NULL != requiresAA) { | 
| 93                 } | 95                 *requiresAA = doAA; | 
| 94             } | 96             } | 
| 95         } else { | 97         } else { | 
| 96             *initialState = kAllOut_InitialState; | 98             *initialState = kAllOut_InitialState; | 
| 97              if (NULL != requiresAA) { | 99              if (NULL != requiresAA) { | 
| 98                 *requiresAA = false; | 100                 *requiresAA = false; | 
| 99              } | 101              } | 
| 100         } | 102         } | 
| 101         return; | 103         return; | 
| 102     } else { | 104     } else { | 
| 103         if (SkClipStack::kNormal_BoundsType == stackBoundsType) { | 105         if (SkClipStack::kNormal_BoundsType == stackBoundsType) { | 
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 439 | 441 | 
| 440     if (0 == result->count()) { | 442     if (0 == result->count()) { | 
| 441         if (*initialState == kAllIn_InitialState) { | 443         if (*initialState == kAllIn_InitialState) { | 
| 442             *resultGenID = SkClipStack::kWideOpenGenID; | 444             *resultGenID = SkClipStack::kWideOpenGenID; | 
| 443         } else { | 445         } else { | 
| 444             *resultGenID = SkClipStack::kEmptyGenID; | 446             *resultGenID = SkClipStack::kEmptyGenID; | 
| 445         } | 447         } | 
| 446     } | 448     } | 
| 447 } | 449 } | 
| 448 } // namespace GrReducedClip | 450 } // namespace GrReducedClip | 
| OLD | NEW | 
|---|