| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrClip_DEFINED | 8 #ifndef GrClip_DEFINED |
| 9 #define GrClip_DEFINED | 9 #define GrClip_DEFINED |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 fScissorState.set(scissor); | 39 fScissorState.set(scissor); |
| 40 fHasStencilClip = hasStencil; | 40 fHasStencilClip = hasStencil; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void makeFPBased(sk_sp<GrFragmentProcessor> fp) { | 43 void makeFPBased(sk_sp<GrFragmentProcessor> fp) { |
| 44 fClipCoverageFP = fp; | 44 fClipCoverageFP = fp; |
| 45 fScissorState.setDisabled(); | 45 fScissorState.setDisabled(); |
| 46 fHasStencilClip = false; | 46 fHasStencilClip = false; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void makeScissored(SkIRect& scissor) { |
| 50 fClipCoverageFP.reset(); |
| 51 fScissorState.set(scissor); |
| 52 fHasStencilClip = false; |
| 53 } |
| 54 |
| 49 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, SkIRect& scissor) { | 55 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, SkIRect& scissor) { |
| 50 fClipCoverageFP = fp; | 56 fClipCoverageFP = fp; |
| 51 fScissorState.set(scissor); | 57 fScissorState.set(scissor); |
| 52 fHasStencilClip = false; | 58 fHasStencilClip = false; |
| 53 } | 59 } |
| 54 | 60 |
| 55 private: | 61 private: |
| 56 sk_sp<GrFragmentProcessor> fClipCoverageFP; | 62 sk_sp<GrFragmentProcessor> fClipCoverageFP; |
| 57 GrScissorState fScissorState; | 63 GrScissorState fScissorState; |
| 58 bool fHasStencilClip; | 64 bool fHasStencilClip; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 bool* isIntersectionOfRects) const final; | 152 bool* isIntersectionOfRects) const final; |
| 147 bool apply(GrContext*, const GrPipelineBuilder&, GrDrawContext*, | 153 bool apply(GrContext*, const GrPipelineBuilder&, GrDrawContext*, |
| 148 const SkRect* devBounds, GrAppliedClip*) const final; | 154 const SkRect* devBounds, GrAppliedClip*) const final; |
| 149 | 155 |
| 150 private: | 156 private: |
| 151 SkIPoint fOrigin; | 157 SkIPoint fOrigin; |
| 152 SkAutoTUnref<const SkClipStack> fStack; | 158 SkAutoTUnref<const SkClipStack> fStack; |
| 153 }; | 159 }; |
| 154 | 160 |
| 155 #endif | 161 #endif |
| OLD | NEW |