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 "GrReducedClip.h" | 10 #include "GrReducedClip.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 /** | 40 /** |
41 * Creates a clip mask if necessary as a stencil buffer or alpha texture | 41 * Creates a clip mask if necessary as a stencil buffer or alpha texture |
42 * and sets the GrGpu's scissor and stencil state. If the return is false | 42 * and sets the GrGpu's scissor and stencil state. If the return is false |
43 * then the draw can be skipped. devBounds is optional but can help optimize | 43 * then the draw can be skipped. devBounds is optional but can help optimize |
44 * clipping. | 44 * clipping. |
45 */ | 45 */ |
46 static bool SetupClipping(GrContext*, const GrPipelineBuilder&, GrDrawContex
t*, | 46 static bool SetupClipping(GrContext*, const GrPipelineBuilder&, GrDrawContex
t*, |
47 const GrClipStackClip&, const SkRect* devBounds, G
rAppliedClip*); | 47 const GrClipStackClip&, const SkRect* devBounds, G
rAppliedClip*); |
48 | 48 |
49 private: | 49 private: |
| 50 static void DrawNonAARect(GrDrawContext* drawContext, |
| 51 const GrFixedClip& clip, |
| 52 const SkMatrix& viewMatrix, |
| 53 const SkRect& rect, |
| 54 bool isAA, |
| 55 const GrUserStencilSettings* stencilSettings); |
| 56 |
50 static bool PathNeedsSWRenderer(GrContext* context, | 57 static bool PathNeedsSWRenderer(GrContext* context, |
51 bool hasUserStencilSettings, | 58 bool hasUserStencilSettings, |
52 const GrDrawContext*, | 59 const GrDrawContext*, |
53 const SkMatrix& viewMatrix, | 60 const SkMatrix& viewMatrix, |
54 const SkClipStack::Element* element, | 61 const SkClipStack::Element* element, |
55 GrPathRenderer** prOut, | 62 GrPathRenderer** prOut, |
56 bool needsStencil); | 63 bool needsStencil); |
57 | 64 |
58 // Draws the clip into the stencil buffer | 65 // Draws the clip into the stencil buffer |
59 static bool CreateStencilClipMask(GrContext*, | 66 static bool CreateStencilClipMask(GrContext*, |
(...skipping 25 matching lines...) Expand all Loading... |
85 const GrPipelineBuilder&, | 92 const GrPipelineBuilder&, |
86 const GrDrawContext*, | 93 const GrDrawContext*, |
87 const SkVector& clipToMaskOffset, | 94 const SkVector& clipToMaskOffset, |
88 const GrReducedClip::ElementList& elements); | 95 const GrReducedClip::ElementList& elements); |
89 | 96 |
90 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, | 97 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, |
91 bool renderTarget); | 98 bool renderTarget); |
92 }; | 99 }; |
93 | 100 |
94 #endif // GrClipMaskManager_DEFINED | 101 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |