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 | |
57 static bool PathNeedsSWRenderer(GrContext* context, | 50 static bool PathNeedsSWRenderer(GrContext* context, |
58 bool hasUserStencilSettings, | 51 bool hasUserStencilSettings, |
59 const GrDrawContext*, | 52 const GrDrawContext*, |
60 const SkMatrix& viewMatrix, | 53 const SkMatrix& viewMatrix, |
61 const SkClipStack::Element* element, | 54 const SkClipStack::Element* element, |
62 GrPathRenderer** prOut, | 55 GrPathRenderer** prOut, |
63 bool needsStencil); | 56 bool needsStencil); |
64 | 57 |
65 // Draws the clip into the stencil buffer | 58 // Draws the clip into the stencil buffer |
66 static bool CreateStencilClipMask(GrContext*, | 59 static bool CreateStencilClipMask(GrContext*, |
(...skipping 25 matching lines...) Expand all Loading... |
92 const GrPipelineBuilder&, | 85 const GrPipelineBuilder&, |
93 const GrDrawContext*, | 86 const GrDrawContext*, |
94 const SkVector& clipToMaskOffset, | 87 const SkVector& clipToMaskOffset, |
95 const GrReducedClip::ElementList& elements); | 88 const GrReducedClip::ElementList& elements); |
96 | 89 |
97 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, | 90 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, |
98 bool renderTarget); | 91 bool renderTarget); |
99 }; | 92 }; |
100 | 93 |
101 #endif // GrClipMaskManager_DEFINED | 94 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |