| 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() : fIsCoCenteredMultisampledDraw(false) {} | 36     GrAppliedClip() {} | 
| 37 |  | 
| 38     const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fC
     lipCoverageFP; } | 37     const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fC
     lipCoverageFP; } | 
| 39     const GrScissorState& scissorState() const { return fScissorState; } | 38     const GrScissorState& scissorState() const { return fScissorState; } | 
| 40 | 39 | 
| 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 |  | 
| 48 private: | 40 private: | 
| 49     SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP; | 41     SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP; | 
| 50     GrScissorState                          fScissorState; | 42     GrScissorState                          fScissorState; | 
| 51     bool                                    fIsCoCenteredMultisampledDraw; |  | 
| 52 |  | 
| 53     friend class GrClipMaskManager; | 43     friend class GrClipMaskManager; | 
| 54 | 44 | 
| 55     typedef SkNoncopyable INHERITED; | 45     typedef SkNoncopyable INHERITED; | 
| 56 }; | 46 }; | 
| 57 | 47 | 
| 58 /** | 48 /** | 
| 59  * The clip mask creator handles the generation of the clip mask. If anti | 49  * The clip mask creator handles the generation of the clip mask. If anti | 
| 60  * aliasing is requested it will (in the future) generate a single channel | 50  * aliasing is requested it will (in the future) generate a single channel | 
| 61  * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 51  * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 
| 62  * mask in the stencil buffer. In the non anti-aliasing case, if the clip | 52  * 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... | 
| 178     GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
     ool renderTarget); | 168     GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
     ool renderTarget); | 
| 179 | 169 | 
| 180     static const int kMaxAnalyticElements = 4; | 170     static const int kMaxAnalyticElements = 4; | 
| 181 | 171 | 
| 182     GrDrawTarget*   fDrawTarget;    // This is our owning draw target. | 172     GrDrawTarget*   fDrawTarget;    // This is our owning draw target. | 
| 183     StencilClipMode fClipMode; | 173     StencilClipMode fClipMode; | 
| 184 | 174 | 
| 185     typedef SkNoncopyable INHERITED; | 175     typedef SkNoncopyable INHERITED; | 
| 186 }; | 176 }; | 
| 187 #endif // GrClipMaskManager_DEFINED | 177 #endif // GrClipMaskManager_DEFINED | 
| OLD | NEW | 
|---|