Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: src/gpu/GrClipMaskManager.h

Issue 23926019: Stateful PathRenderer implementation (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add assert & patch for missing AutoPathClear Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 #ifndef GrClipMaskManager_DEFINED 8 #ifndef GrClipMaskManager_DEFINED
9 #define GrClipMaskManager_DEFINED 9 #define GrClipMaskManager_DEFINED
10 10
11 #include "GrClipMaskCache.h" 11 #include "GrClipMaskCache.h"
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrDrawState.h" 13 #include "GrDrawState.h"
14 #include "GrPathRenderer.h"
14 #include "GrReducedClip.h" 15 #include "GrReducedClip.h"
15 #include "GrStencil.h" 16 #include "GrStencil.h"
16 #include "GrTexture.h" 17 #include "GrTexture.h"
17 18
18 #include "SkClipStack.h" 19 #include "SkClipStack.h"
19 #include "SkDeque.h" 20 #include "SkDeque.h"
20 #include "SkPath.h" 21 #include "SkPath.h"
21 #include "SkRefCnt.h" 22 #include "SkRefCnt.h"
22 #include "SkTLList.h" 23 #include "SkTLList.h"
23 #include "SkTypes.h" 24 #include "SkTypes.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Gets a texture to use for the clip mask. If true is returned then a cache d mask was found 124 // Gets a texture to use for the clip mask. If true is returned then a cache d mask was found
124 // that already contains the rasterization of the clip stack, otherwise an u ninitialized texture 125 // that already contains the rasterization of the clip stack, otherwise an u ninitialized texture
125 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded from the CPU. 126 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded from the CPU.
126 bool getMaskTexture(int32_t elementsGenID, 127 bool getMaskTexture(int32_t elementsGenID,
127 const SkIRect& clipSpaceIBounds, 128 const SkIRect& clipSpaceIBounds,
128 GrTexture** result, 129 GrTexture** result,
129 bool willUpload); 130 bool willUpload);
130 131
131 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); 132 bool useSWOnlyPath(const GrReducedClip::ElementList& elements);
132 133
134 // Draws a filled clip path into the target alpha mask
135 bool drawFilledPath(GrTexture* target, GrPathRenderer* pathRenderer, bool is AA);
136
133 // Draws a clip element into the target alpha mask. The caller should have a lready setup the 137 // Draws a clip element into the target alpha mask. The caller should have a lready setup the
134 // desired blend operation. Optionally if the caller already selected a path renderer it can 138 // desired blend operation.
135 // be passed. Otherwise the function will select one if the element is a pat h. 139 bool drawElement(GrTexture* target, const SkClipStack::Element* element);
136 bool drawElement(GrTexture* target, const SkClipStack::Element*, GrPathRende rer* = NULL);
137 140
138 // Determines whether it is possible to draw the element to both the stencil buffer and the 141 // Determines whether it is possible to draw the element to both the stencil buffer and the
139 // alpha mask simultaneously. If so and the element is a path a compatible p ath renderer is 142 // alpha mask simultaneously. If so and the element is a path a compatible p ath renderer is
140 // also returned. 143 // also returned.
141 bool canStencilAndDrawElement(GrTexture* target, const SkClipStack::Element* , GrPathRenderer**); 144 bool canStencilAndDrawElement(GrTexture* target, const SkClipStack::Element* ,
145 GrPathRenderer::AutoClearPath* pr);
142 146
143 void mergeMask(GrTexture* dstMask, 147 void mergeMask(GrTexture* dstMask,
144 GrTexture* srcMask, 148 GrTexture* srcMask,
145 SkRegion::Op op, 149 SkRegion::Op op,
146 const SkIRect& dstBound, 150 const SkIRect& dstBound,
147 const SkIRect& srcBound); 151 const SkIRect& srcBound);
148 152
149 void getTemp(int width, int height, GrAutoScratchTexture* temp); 153 void getTemp(int width, int height, GrAutoScratchTexture* temp);
150 154
151 void setupCache(const SkClipStack& clip, 155 void setupCache(const SkClipStack& clip,
(...skipping 11 matching lines...) Expand all
163 * clipping. 167 * clipping.
164 */ 168 */
165 void adjustStencilParams(GrStencilSettings* settings, 169 void adjustStencilParams(GrStencilSettings* settings,
166 StencilClipMode mode, 170 StencilClipMode mode,
167 int stencilBitCnt); 171 int stencilBitCnt);
168 172
169 typedef SkNoncopyable INHERITED; 173 typedef SkNoncopyable INHERITED;
170 }; 174 };
171 175
172 #endif // GrClipMaskManager_DEFINED 176 #endif // GrClipMaskManager_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698