| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef GrReducedClip_DEFINED | 8 #ifndef GrReducedClip_DEFINED |
| 9 #define GrReducedClip_DEFINED | 9 #define GrReducedClip_DEFINED |
| 10 | 10 |
| 11 #include "SkClipStack.h" | 11 #include "SkClipStack.h" |
| 12 #include "SkTLList.h" | 12 #include "SkTLList.h" |
| 13 | 13 |
| 14 class GrContext; |
| 15 class GrDrawContext; |
| 16 |
| 14 /** | 17 /** |
| 15 * This class takes a clip stack and produces a reduced set of elements that are
equivalent to | 18 * This class takes a clip stack and produces a reduced set of elements that are
equivalent to |
| 16 * applying that full stack within a specified query rectangle. | 19 * applying that full stack within a specified query rectangle. |
| 17 */ | 20 */ |
| 18 class SK_API GrReducedClip { | 21 class SK_API GrReducedClip { |
| 19 public: | 22 public: |
| 20 GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds); | 23 GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds); |
| 21 | 24 |
| 22 /** | 25 /** |
| 23 * If hasIBounds() is true, this is the bounding box within which the reduce
d clip is valid, and | 26 * If hasIBounds() is true, this is the bounding box within which the reduce
d clip is valid, and |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 */ | 56 */ |
| 54 bool requiresAA() const { return fRequiresAA; } | 57 bool requiresAA() const { return fRequiresAA; } |
| 55 | 58 |
| 56 enum class InitialState : bool { | 59 enum class InitialState : bool { |
| 57 kAllIn, | 60 kAllIn, |
| 58 kAllOut | 61 kAllOut |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 InitialState initialState() const { return fInitialState; } | 64 InitialState initialState() const { return fInitialState; } |
| 62 | 65 |
| 66 bool drawAlphaClipMask(GrDrawContext*) const; |
| 67 bool drawStencilClipMask(GrContext*, GrDrawContext*, const SkIPoint& clipOri
gin) const; |
| 68 |
| 63 private: | 69 private: |
| 64 void walkStack(const SkClipStack&, const SkRect& queryBounds); | 70 void walkStack(const SkClipStack&, const SkRect& queryBounds); |
| 65 bool intersectIBounds(const SkIRect&); | 71 bool intersectIBounds(const SkIRect&); |
| 66 | 72 |
| 67 SkIRect fIBounds; | 73 SkIRect fIBounds; |
| 68 bool fHasIBounds; | 74 bool fHasIBounds; |
| 69 ElementList fElements; | 75 ElementList fElements; |
| 70 int32_t fElementsGenID; | 76 int32_t fElementsGenID; |
| 71 bool fRequiresAA; | 77 bool fRequiresAA; |
| 72 InitialState fInitialState; | 78 InitialState fInitialState; |
| 73 }; | 79 }; |
| 74 | 80 |
| 75 #endif | 81 #endif |
| OLD | NEW |