| 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 #ifndef GrClipMaskManager_DEFINED | 7 #ifndef GrClipMaskManager_DEFINED |
| 8 #define GrClipMaskManager_DEFINED | 8 #define GrClipMaskManager_DEFINED |
| 9 | 9 |
| 10 #include "GrPipelineBuilder.h" | 10 #include "GrPipelineBuilder.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class SkPath; | 26 class SkPath; |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * Produced by GrClipMaskManager. It provides a set of modifications to the draw
ing state that | 29 * Produced by GrClipMaskManager. It provides a set of modifications to the draw
ing state that |
| 30 * are used to create the final GrPipeline for a GrBatch. This is a work in prog
ress. It will | 30 * are used to create the final GrPipeline for a GrBatch. This is a work in prog
ress. It will |
| 31 * eventually encapsulate all mechanisms for modifying the scissor, shaders, and
stencil state | 31 * eventually encapsulate all mechanisms for modifying the scissor, shaders, and
stencil state |
| 32 * to implement clipping. | 32 * to implement clipping. |
| 33 */ | 33 */ |
| 34 class GrAppliedClip : public SkNoncopyable { | 34 class GrAppliedClip : public SkNoncopyable { |
| 35 public: | 35 public: |
| 36 GrAppliedClip() {} | 36 GrAppliedClip() : fIsCoCenteredMultisampledDraw(false) {} |
| 37 |
| 37 const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fC
lipCoverageFP; } | 38 const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fC
lipCoverageFP; } |
| 38 const GrScissorState& scissorState() const { return fScissorState; } | 39 const GrScissorState& scissorState() const { return fScissorState; } |
| 39 | 40 |
| 41 /** |
| 42 * This is used to perform a multisampled clip test when the draw requires M
SAA to be disabled. |
| 43 * It will allow the stencil test to run multisampled by turning on hardware
MSAA, but co-locate |
| 44 * the draw's samples at pixel center so it will still feel like MSAA is dis
abled. |
| 45 */ |
| 46 bool isCoCenteredMultisampledDraw() const { return fIsCoCenteredMultisampled
Draw; } |
| 47 |
| 40 private: | 48 private: |
| 41 SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP; | 49 SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP; |
| 42 GrScissorState fScissorState; | 50 GrScissorState fScissorState; |
| 51 bool fIsCoCenteredMultisampledDraw; |
| 52 |
| 43 friend class GrClipMaskManager; | 53 friend class GrClipMaskManager; |
| 44 | 54 |
| 45 typedef SkNoncopyable INHERITED; | 55 typedef SkNoncopyable INHERITED; |
| 46 }; | 56 }; |
| 47 | 57 |
| 48 /** | 58 /** |
| 49 * The clip mask creator handles the generation of the clip mask. If anti | 59 * The clip mask creator handles the generation of the clip mask. If anti |
| 50 * aliasing is requested it will (in the future) generate a single channel | 60 * aliasing is requested it will (in the future) generate a single channel |
| 51 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 61 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit |
| 52 * mask in the stencil buffer. In the non anti-aliasing case, if the clip | 62 * mask in the stencil buffer. In the non anti-aliasing case, if the clip |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); | 178 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); |
| 169 | 179 |
| 170 static const int kMaxAnalyticElements = 4; | 180 static const int kMaxAnalyticElements = 4; |
| 171 | 181 |
| 172 GrDrawTarget* fDrawTarget; // This is our owning draw target. | 182 GrDrawTarget* fDrawTarget; // This is our owning draw target. |
| 173 StencilClipMode fClipMode; | 183 StencilClipMode fClipMode; |
| 174 | 184 |
| 175 typedef SkNoncopyable INHERITED; | 185 typedef SkNoncopyable INHERITED; |
| 176 }; | 186 }; |
| 177 #endif // GrClipMaskManager_DEFINED | 187 #endif // GrClipMaskManager_DEFINED |
| OLD | NEW |