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

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

Issue 858343002: Rename GrOptDrawState to GrPipeline and GrDrawState to GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more nits Created 5 years, 11 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
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrDrawTarget.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 2010 Google Inc. 2 * Copyright 2010 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 GrDrawTarget_DEFINED 8 #ifndef GrDrawTarget_DEFINED
9 #define GrDrawTarget_DEFINED 9 #define GrDrawTarget_DEFINED
10 10
11 #include "GrClipData.h" 11 #include "GrClipData.h"
12 #include "GrClipMaskManager.h" 12 #include "GrClipMaskManager.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrDrawState.h"
15 #include "GrIndexBuffer.h" 14 #include "GrIndexBuffer.h"
16 #include "GrPathRendering.h" 15 #include "GrPathRendering.h"
16 #include "GrPipelineBuilder.h"
17 #include "GrTraceMarker.h" 17 #include "GrTraceMarker.h"
18 #include "GrVertexBuffer.h" 18 #include "GrVertexBuffer.h"
19 19
20 #include "SkClipStack.h" 20 #include "SkClipStack.h"
21 #include "SkMatrix.h" 21 #include "SkMatrix.h"
22 #include "SkPath.h" 22 #include "SkPath.h"
23 #include "SkStrokeRec.h" 23 #include "SkStrokeRec.h"
24 #include "SkTArray.h" 24 #include "SkTArray.h"
25 #include "SkTLazy.h" 25 #include "SkTLazy.h"
26 #include "SkTypes.h" 26 #include "SkTypes.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 * If the target cannot make space for the request then this function will 118 * If the target cannot make space for the request then this function will
119 * return false. If vertexCount was non-zero then upon failure the vertex 119 * return false. If vertexCount was non-zero then upon failure the vertex
120 * source is reset and likewise for indexCount. 120 * source is reset and likewise for indexCount.
121 * 121 *
122 * The pointers to the space allocated for vertices and indices remain valid 122 * The pointers to the space allocated for vertices and indices remain valid
123 * until a drawIndexed, drawNonIndexed, drawIndexedInstances, drawRect, 123 * until a drawIndexed, drawNonIndexed, drawIndexedInstances, drawRect,
124 * copySurface, or push/popGeomtrySource is called. At that point logically a 124 * copySurface, or push/popGeomtrySource is called. At that point logically a
125 * snapshot of the data is made and the pointers are invalid. 125 * snapshot of the data is made and the pointers are invalid.
126 * 126 *
127 * @param vertexCount the number of vertices to reserve space for. Can be 127 * @param vertexCount the number of vertices to reserve space for. Can be
128 * 0. Vertex size is queried from the current GrDrawStat e. 128 * 0. Vertex size is queried from the current GrPipeline Builder.
129 * @param indexCount the number of indices to reserve space for. Can be 0. 129 * @param indexCount the number of indices to reserve space for. Can be 0.
130 * @param vertices will point to reserved vertex space if vertexCount is 130 * @param vertices will point to reserved vertex space if vertexCount is
131 * non-zero. Illegal to pass NULL if vertexCount > 0. 131 * non-zero. Illegal to pass NULL if vertexCount > 0.
132 * @param indices will point to reserved index space if indexCount is 132 * @param indices will point to reserved index space if indexCount is
133 * non-zero. Illegal to pass NULL if indexCount > 0. 133 * non-zero. Illegal to pass NULL if indexCount > 0.
134 */ 134 */
135 bool reserveVertexAndIndexSpace(int vertexCount, 135 bool reserveVertexAndIndexSpace(int vertexCount,
136 size_t vertexStride, 136 size_t vertexStride,
137 int indexCount, 137 int indexCount,
138 void** vertices, 138 void** vertices,
139 void** indices); 139 void** indices);
140 140
141 /** 141 /**
142 * Provides hints to caller about the number of vertices and indices 142 * Provides hints to caller about the number of vertices and indices
143 * that can be allocated cheaply. This can be useful if caller is reserving 143 * that can be allocated cheaply. This can be useful if caller is reserving
144 * space but doesn't know exactly how much geometry is needed. 144 * space but doesn't know exactly how much geometry is needed.
145 * 145 *
146 * Also may hint whether the draw target should be flushed first. This is 146 * Also may hint whether the draw target should be flushed first. This is
147 * useful for deferred targets. 147 * useful for deferred targets.
148 * 148 *
149 * @param vertexCount in: hint about how many vertices the caller would 149 * @param vertexCount in: hint about how many vertices the caller would
150 * like to allocate. Vertex size is queried from the 150 * like to allocate. Vertex size is queried from the
151 * current GrDrawState. 151 * current GrPipelineBuilder.
152 * out: a hint about the number of vertices that can be 152 * out: a hint about the number of vertices that can be
153 * allocated cheaply. Negative means no hint. 153 * allocated cheaply. Negative means no hint.
154 * Ignored if NULL. 154 * Ignored if NULL.
155 * @param indexCount in: hint about how many indices the caller would 155 * @param indexCount in: hint about how many indices the caller would
156 * like to allocate. 156 * like to allocate.
157 * out: a hint about the number of indices that can be 157 * out: a hint about the number of indices that can be
158 * allocated cheaply. Negative means no hint. 158 * allocated cheaply. Negative means no hint.
159 * Ignored if NULL. 159 * Ignored if NULL.
160 * 160 *
161 * @return true if target should be flushed based on the input values. 161 * @return true if target should be flushed based on the input values.
162 */ 162 */
163 virtual bool geometryHints(size_t vertexStride, int* vertexCount, int* index Count) const; 163 virtual bool geometryHints(size_t vertexStride, int* vertexCount, int* index Count) const;
164 164
165 /** 165 /**
166 * Sets source of vertex data for the next draw. Data does not have to be 166 * Sets source of vertex data for the next draw. Data does not have to be
167 * in the buffer until drawIndexed, drawNonIndexed, or drawIndexedInstances. 167 * in the buffer until drawIndexed, drawNonIndexed, or drawIndexedInstances.
168 * 168 *
169 * @param buffer vertex buffer containing vertex data. Must be 169 * @param buffer vertex buffer containing vertex data. Must be
170 * unlocked before draw call. Vertex size is queried 170 * unlocked before draw call. Vertex size is queried
171 * from current GrDrawState. 171 * from current GrPipelineBuilder.
172 */ 172 */
173 void setVertexSourceToBuffer(const GrVertexBuffer* buffer, size_t vertexStri de); 173 void setVertexSourceToBuffer(const GrVertexBuffer* buffer, size_t vertexStri de);
174 174
175 /** 175 /**
176 * Sets source of index data for the next indexed draw. Data does not have 176 * Sets source of index data for the next indexed draw. Data does not have
177 * to be in the buffer until drawIndexed. 177 * to be in the buffer until drawIndexed.
178 * 178 *
179 * @param buffer index buffer containing indices. Must be unlocked 179 * @param buffer index buffer containing indices. Must be unlocked
180 * before indexed draw call. 180 * before indexed draw call.
181 */ 181 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 * @param startVertex the vertex in the vertex array/buffer corresponding 225 * @param startVertex the vertex in the vertex array/buffer corresponding
226 * to index 0 226 * to index 0
227 * @param startIndex first index to read from index src. 227 * @param startIndex first index to read from index src.
228 * @param vertexCount one greater than the max index. 228 * @param vertexCount one greater than the max index.
229 * @param indexCount the number of index elements to read. The index count 229 * @param indexCount the number of index elements to read. The index count
230 * is effectively trimmed to the last completely 230 * is effectively trimmed to the last completely
231 * specified primitive. 231 * specified primitive.
232 * @param devBounds optional bounds hint. This is a promise from the call er, 232 * @param devBounds optional bounds hint. This is a promise from the call er,
233 * not a request for clipping. 233 * not a request for clipping.
234 */ 234 */
235 void drawIndexed(GrDrawState*, 235 void drawIndexed(GrPipelineBuilder*,
236 const GrGeometryProcessor*, 236 const GrGeometryProcessor*,
237 GrPrimitiveType type, 237 GrPrimitiveType type,
238 int startVertex, 238 int startVertex,
239 int startIndex, 239 int startIndex,
240 int vertexCount, 240 int vertexCount,
241 int indexCount, 241 int indexCount,
242 const SkRect* devBounds = NULL); 242 const SkRect* devBounds = NULL);
243 243
244 /** 244 /**
245 * Draws non-indexed geometry using the current state and current vertex 245 * Draws non-indexed geometry using the current state and current vertex
246 * sources. 246 * sources.
247 * 247 *
248 * @param type The type of primitives to draw. 248 * @param type The type of primitives to draw.
249 * @param startVertex the vertex in the vertex array/buffer corresponding 249 * @param startVertex the vertex in the vertex array/buffer corresponding
250 * to index 0 250 * to index 0
251 * @param vertexCount one greater than the max index. 251 * @param vertexCount one greater than the max index.
252 * @param devBounds optional bounds hint. This is a promise from the call er, 252 * @param devBounds optional bounds hint. This is a promise from the call er,
253 * not a request for clipping. 253 * not a request for clipping.
254 */ 254 */
255 void drawNonIndexed(GrDrawState*, 255 void drawNonIndexed(GrPipelineBuilder*,
256 const GrGeometryProcessor*, 256 const GrGeometryProcessor*,
257 GrPrimitiveType type, 257 GrPrimitiveType type,
258 int startVertex, 258 int startVertex,
259 int vertexCount, 259 int vertexCount,
260 const SkRect* devBounds = NULL); 260 const SkRect* devBounds = NULL);
261 261
262 /** 262 /**
263 * Draws path into the stencil buffer. The fill must be either even/odd or 263 * Draws path into the stencil buffer. The fill must be either even/odd or
264 * winding (not inverse or hairline). It will respect the HW antialias flag 264 * winding (not inverse or hairline). It will respect the HW antialias flag
265 * on the draw state (if possible in the 3D API). Note, we will never have an inverse fill 265 * on the GrPipelineBuilder (if possible in the 3D API). Note, we will neve r have an inverse
266 * with stencil path 266 * fill with stencil path
267 */ 267 */
268 void stencilPath(GrDrawState*, const GrPathProcessor*, const GrPath*,GrPathR endering::FillType); 268 void stencilPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*,
269 GrPathRendering::FillType);
269 270
270 /** 271 /**
271 * Draws a path. Fill must not be a hairline. It will respect the HW 272 * Draws a path. Fill must not be a hairline. It will respect the HW
272 * antialias flag on the draw state (if possible in the 3D API). 273 * antialias flag on the GrPipelineBuilder (if possible in the 3D API).
273 */ 274 */
274 void drawPath(GrDrawState*, const GrPathProcessor*, const GrPath*, GrPathRen dering::FillType); 275 void drawPath(GrPipelineBuilder*, const GrPathProcessor*, const GrPath*,
276 GrPathRendering::FillType);
275 277
276 /** 278 /**
277 * Draws the aggregate path from combining multiple. Note that this will not 279 * Draws the aggregate path from combining multiple. Note that this will not
278 * always be equivalent to back-to-back calls to drawPath(). It will respect 280 * always be equivalent to back-to-back calls to drawPath(). It will respect
279 * the HW antialias flag on the draw state (if possible in the 3D API). 281 * the HW antialias flag on the GrPipelineBuilder (if possible in the 3D API ).
280 * 282 *
281 * @param pathRange Source paths to draw from 283 * @param pathRange Source paths to draw from
282 * @param indices Array of path indices to draw 284 * @param indices Array of path indices to draw
283 * @param indexType Data type of the array elements in indexBuffer 285 * @param indexType Data type of the array elements in indexBuffer
284 * @param transformValues Array of transforms for the individual paths 286 * @param transformValues Array of transforms for the individual paths
285 * @param transformType Type of transforms in transformBuffer 287 * @param transformType Type of transforms in transformBuffer
286 * @param count Number of paths to draw 288 * @param count Number of paths to draw
287 * @param fill Fill type for drawing all the paths 289 * @param fill Fill type for drawing all the paths
288 */ 290 */
289 void drawPaths(GrDrawState*, 291 void drawPaths(GrPipelineBuilder*,
290 const GrPathProcessor*, 292 const GrPathProcessor*,
291 const GrPathRange* pathRange, 293 const GrPathRange* pathRange,
292 const void* indices, 294 const void* indices,
293 PathIndexType indexType, 295 PathIndexType indexType,
294 const float transformValues[], 296 const float transformValues[],
295 PathTransformType transformType, 297 PathTransformType transformType,
296 int count, 298 int count,
297 GrPathRendering::FillType fill); 299 GrPathRendering::FillType fill);
298 300
299 /** 301 /**
300 * Helper function for drawing rects. It performs a geometry src push and po p 302 * Helper function for drawing rects. It performs a geometry src push and po p
301 * and thus will finalize any reserved geometry. 303 * and thus will finalize any reserved geometry.
302 * 304 *
303 * @param rect the rect to draw 305 * @param rect the rect to draw
304 * @param localRect optional rect that specifies local coords to map onto 306 * @param localRect optional rect that specifies local coords to map onto
305 * rect. If NULL then rect serves as the local coords. 307 * rect. If NULL then rect serves as the local coords.
306 * @param localMatrix Optional local matrix. The local coordinates are speci fied by localRect, 308 * @param localMatrix Optional local matrix. The local coordinates are speci fied by localRect,
307 * or if it is NULL by rect. This matrix applies to the c oordinate implied by 309 * or if it is NULL by rect. This matrix applies to the c oordinate implied by
308 * that rectangle before it is input to GrCoordTransforms that read local 310 * that rectangle before it is input to GrCoordTransforms that read local
309 * coordinates 311 * coordinates
310 */ 312 */
311 void drawRect(GrDrawState* ds, 313 void drawRect(GrPipelineBuilder* ds,
312 GrColor color, 314 GrColor color,
313 const SkMatrix& viewMatrix, 315 const SkMatrix& viewMatrix,
314 const SkRect& rect, 316 const SkRect& rect,
315 const SkRect* localRect, 317 const SkRect* localRect,
316 const SkMatrix* localMatrix) { 318 const SkMatrix* localMatrix) {
317 AutoGeometryPush agp(this); 319 AutoGeometryPush agp(this);
318 this->onDrawRect(ds, color, viewMatrix, rect, localRect, localMatrix); 320 this->onDrawRect(ds, color, viewMatrix, rect, localRect, localMatrix);
319 } 321 }
320 322
321 /** 323 /**
322 * Helper for drawRect when the caller doesn't need separate local rects or matrices. 324 * Helper for drawRect when the caller doesn't need separate local rects or matrices.
323 */ 325 */
324 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkMatrix& viewM, c onst SkRect& rect) { 326 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM,
327 const SkRect& rect) {
325 this->drawRect(ds, color, viewM, rect, NULL, NULL); 328 this->drawRect(ds, color, viewM, rect, NULL, NULL);
326 } 329 }
327 void drawSimpleRect(GrDrawState* ds, GrColor color, const SkMatrix& viewM, 330 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi ewM,
328 const SkIRect& irect) { 331 const SkIRect& irect) {
329 SkRect rect = SkRect::Make(irect); 332 SkRect rect = SkRect::Make(irect);
330 this->drawRect(ds, color, viewM, rect, NULL, NULL); 333 this->drawRect(ds, color, viewM, rect, NULL, NULL);
331 } 334 }
332 335
333 /** 336 /**
334 * This call is used to draw multiple instances of some geometry with a 337 * This call is used to draw multiple instances of some geometry with a
335 * given number of vertices (V) and indices (I) per-instance. The indices in 338 * given number of vertices (V) and indices (I) per-instance. The indices in
336 * the index source must have the form i[k+I] == i[k] + V. Also, all indices 339 * the index source must have the form i[k+I] == i[k] + V. Also, all indices
337 * i[kI] ... i[(k+1)I-1] must be elements of the range kV ... (k+1)V-1. As a 340 * i[kI] ... i[(k+1)I-1] must be elements of the range kV ... (k+1)V-1. As a
(...skipping 15 matching lines...) Expand all
353 * consists of verticesPerInstance vertices indexed by 356 * consists of verticesPerInstance vertices indexed by
354 * indicesPerInstance indices drawn as the primitive 357 * indicesPerInstance indices drawn as the primitive
355 * type specified by type. 358 * type specified by type.
356 * @param verticesPerInstance The number of vertices in each instance (V 359 * @param verticesPerInstance The number of vertices in each instance (V
357 * in the above description). 360 * in the above description).
358 * @param indicesPerInstance The number of indices in each instance (I 361 * @param indicesPerInstance The number of indices in each instance (I
359 * in the above description). 362 * in the above description).
360 * @param devBounds optional bounds hint. This is a promise from the call er, 363 * @param devBounds optional bounds hint. This is a promise from the call er,
361 * not a request for clipping. 364 * not a request for clipping.
362 */ 365 */
363 void drawIndexedInstances(GrDrawState*, 366 void drawIndexedInstances(GrPipelineBuilder*,
364 const GrGeometryProcessor*, 367 const GrGeometryProcessor*,
365 GrPrimitiveType type, 368 GrPrimitiveType type,
366 int instanceCount, 369 int instanceCount,
367 int verticesPerInstance, 370 int verticesPerInstance,
368 int indicesPerInstance, 371 int indicesPerInstance,
369 const SkRect* devBounds = NULL); 372 const SkRect* devBounds = NULL);
370 373
371 /** 374 /**
372 * Clear the passed in render target. Ignores the draw state and clip. Clear s the whole thing if 375 * Clear the passed in render target. Ignores the GrPipelineBuilder and clip . Clears the whole
373 * rect is NULL, otherwise just the rect. If canIgnoreRect is set then the e ntire render target 376 * thing if rect is NULL, otherwise just the rect. If canIgnoreRect is set t hen the entire
374 * can be optionally cleared. 377 * render target can be optionally cleared.
375 */ 378 */
376 void clear(const SkIRect* rect, 379 void clear(const SkIRect* rect,
377 GrColor color, 380 GrColor color,
378 bool canIgnoreRect, 381 bool canIgnoreRect,
379 GrRenderTarget* renderTarget); 382 GrRenderTarget* renderTarget);
380 383
381 /** 384 /**
382 * Discards the contents render target. 385 * Discards the contents render target.
383 **/ 386 **/
384 virtual void discard(GrRenderTarget*) = 0; 387 virtual void discard(GrRenderTarget*) = 0;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 } 656 }
654 657
655 // Subclass must initialize this in its constructor. 658 // Subclass must initialize this in its constructor.
656 SkAutoTUnref<const GrDrawTargetCaps> fCaps; 659 SkAutoTUnref<const GrDrawTargetCaps> fCaps;
657 660
658 const GrTraceMarkerSet& getActiveTraceMarkers() { return fActiveTraceMarkers ; } 661 const GrTraceMarkerSet& getActiveTraceMarkers() { return fActiveTraceMarkers ; }
659 662
660 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required 663 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required
661 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it 664 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it
662 // needs to be accessed by GLPrograms to setup a correct drawstate 665 // needs to be accessed by GLPrograms to setup a correct drawstate
663 bool setupDstReadIfNecessary(GrDrawState*, 666 bool setupDstReadIfNecessary(GrPipelineBuilder*,
664 GrDeviceCoordTexture* dstCopy, 667 GrDeviceCoordTexture* dstCopy,
665 const SkRect* drawBounds); 668 const SkRect* drawBounds);
666 669
667 private: 670 private:
668 /** 671 /**
669 * This will be called before allocating a texture as a dst for copySurface. This function 672 * This will be called before allocating a texture as a dst for copySurface. This function
670 * populates the dstDesc's config, flags, and origin so as to maximize effic iency and guarantee 673 * populates the dstDesc's config, flags, and origin so as to maximize effic iency and guarantee
671 * success of the copySurface call. 674 * success of the copySurface call.
672 */ 675 */
673 void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* dstDesc) { 676 void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* dstDesc) {
(...skipping 19 matching lines...) Expand all
693 // implemented by subclass to allocate space for reserved geom 696 // implemented by subclass to allocate space for reserved geom
694 virtual bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) = 0; 697 virtual bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) = 0;
695 virtual bool onReserveIndexSpace(int indexCount, void** indices) = 0; 698 virtual bool onReserveIndexSpace(int indexCount, void** indices) = 0;
696 // implemented by subclass to handle release of reserved geom space 699 // implemented by subclass to handle release of reserved geom space
697 virtual void releaseReservedVertexSpace() = 0; 700 virtual void releaseReservedVertexSpace() = 0;
698 virtual void releaseReservedIndexSpace() = 0; 701 virtual void releaseReservedIndexSpace() = 0;
699 // subclass overrides to be notified just before geo src state is pushed/pop ped. 702 // subclass overrides to be notified just before geo src state is pushed/pop ped.
700 virtual void geometrySourceWillPush() = 0; 703 virtual void geometrySourceWillPush() = 0;
701 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) = 0; 704 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) = 0;
702 // subclass called to perform drawing 705 // subclass called to perform drawing
703 virtual void onDraw(const GrDrawState&, 706 virtual void onDraw(const GrPipelineBuilder&,
704 const GrGeometryProcessor*, 707 const GrGeometryProcessor*,
705 const DrawInfo&, 708 const DrawInfo&,
706 const GrScissorState&, 709 const GrScissorState&,
707 const GrDeviceCoordTexture* dstCopy) = 0; 710 const GrDeviceCoordTexture* dstCopy) = 0;
708 // TODO copy in order drawbuffer onDrawRect to here 711 // TODO copy in order drawbuffer onDrawRect to here
709 virtual void onDrawRect(GrDrawState*, 712 virtual void onDrawRect(GrPipelineBuilder*,
710 GrColor color, 713 GrColor color,
711 const SkMatrix& viewMatrix, 714 const SkMatrix& viewMatrix,
712 const SkRect& rect, 715 const SkRect& rect,
713 const SkRect* localRect, 716 const SkRect* localRect,
714 const SkMatrix* localMatrix) = 0; 717 const SkMatrix* localMatrix) = 0;
715 718
716 virtual void onStencilPath(const GrDrawState&, 719 virtual void onStencilPath(const GrPipelineBuilder&,
717 const GrPathProcessor*, 720 const GrPathProcessor*,
718 const GrPath*, 721 const GrPath*,
719 const GrScissorState&, 722 const GrScissorState&,
720 const GrStencilSettings&) = 0; 723 const GrStencilSettings&) = 0;
721 virtual void onDrawPath(const GrDrawState&, 724 virtual void onDrawPath(const GrPipelineBuilder&,
722 const GrPathProcessor*, 725 const GrPathProcessor*,
723 const GrPath*, 726 const GrPath*,
724 const GrScissorState&, 727 const GrScissorState&,
725 const GrStencilSettings&, 728 const GrStencilSettings&,
726 const GrDeviceCoordTexture* dstCopy) = 0; 729 const GrDeviceCoordTexture* dstCopy) = 0;
727 virtual void onDrawPaths(const GrDrawState&, 730 virtual void onDrawPaths(const GrPipelineBuilder&,
728 const GrPathProcessor*, 731 const GrPathProcessor*,
729 const GrPathRange*, 732 const GrPathRange*,
730 const void* indices, 733 const void* indices,
731 PathIndexType, 734 PathIndexType,
732 const float transformValues[], 735 const float transformValues[],
733 PathTransformType, 736 PathTransformType,
734 int count, 737 int count,
735 const GrScissorState&, 738 const GrScissorState&,
736 const GrStencilSettings&, 739 const GrStencilSettings&,
737 const GrDeviceCoordTexture*) = 0; 740 const GrDeviceCoordTexture*) = 0;
(...skipping 26 matching lines...) Expand all
764 virtual bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* d stDesc) = 0; 767 virtual bool onInitCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* d stDesc) = 0;
765 768
766 // helpers for reserving vertex and index space. 769 // helpers for reserving vertex and index space.
767 bool reserveVertexSpace(size_t vertexSize, 770 bool reserveVertexSpace(size_t vertexSize,
768 int vertexCount, 771 int vertexCount,
769 void** vertices); 772 void** vertices);
770 bool reserveIndexSpace(int indexCount, void** indices); 773 bool reserveIndexSpace(int indexCount, void** indices);
771 774
772 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to 775 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to
773 // indicate non-indexed drawing. 776 // indicate non-indexed drawing.
774 bool checkDraw(const GrDrawState&, 777 bool checkDraw(const GrPipelineBuilder&,
775 const GrGeometryProcessor*, 778 const GrGeometryProcessor*,
776 GrPrimitiveType type, 779 GrPrimitiveType type,
777 int startVertex, 780 int startVertex,
778 int startIndex, 781 int startIndex,
779 int vertexCount, 782 int vertexCount,
780 int indexCount) const; 783 int indexCount) const;
781 // called when setting a new vert/idx source to unref prev vb/ib 784 // called when setting a new vert/idx source to unref prev vb/ib
782 void releasePreviousVertexSource(); 785 void releasePreviousVertexSource();
783 void releasePreviousIndexSource(); 786 void releasePreviousIndexSource();
784 787
785 // Check to see if this set of draw commands has been sent out 788 // Check to see if this set of draw commands has been sent out
786 virtual bool isIssued(uint32_t drawID) { return true; } 789 virtual bool isIssued(uint32_t drawID) { return true; }
787 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, 790 void getPathStencilSettingsForFilltype(GrPathRendering::FillType,
788 const GrStencilBuffer*, 791 const GrStencilBuffer*,
789 GrStencilSettings*); 792 GrStencilSettings*);
790 virtual GrClipMaskManager* clipMaskManager() = 0; 793 virtual GrClipMaskManager* clipMaskManager() = 0;
791 virtual bool setupClip(GrDrawState*, 794 virtual bool setupClip(GrPipelineBuilder*,
792 GrDrawState::AutoRestoreEffects* are, 795 GrPipelineBuilder::AutoRestoreEffects* are,
793 GrDrawState::AutoRestoreStencil* ars, 796 GrPipelineBuilder::AutoRestoreStencil* ars,
794 GrScissorState* scissorState, 797 GrScissorState* scissorState,
795 const SkRect* devBounds) = 0; 798 const SkRect* devBounds) = 0;
796 799
797 enum { 800 enum {
798 kPreallocGeoSrcStateStackCnt = 4, 801 kPreallocGeoSrcStateStackCnt = 4,
799 }; 802 };
800 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack; 803 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack;
801 const GrClipData* fClip; 804 const GrClipData* fClip;
802 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. 805 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get.
803 GrContext* fContext; 806 GrContext* fContext;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 // get rid of them all. 844 // get rid of them all.
842 fClipMaskManager.purgeResources(); 845 fClipMaskManager.purgeResources();
843 }; 846 };
844 847
845 protected: 848 protected:
846 GrClipMaskManager fClipMaskManager; 849 GrClipMaskManager fClipMaskManager;
847 850
848 private: 851 private:
849 GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager; } 852 GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager; }
850 853
851 virtual bool setupClip(GrDrawState*, 854 virtual bool setupClip(GrPipelineBuilder*,
852 GrDrawState::AutoRestoreEffects* are, 855 GrPipelineBuilder::AutoRestoreEffects* are,
853 GrDrawState::AutoRestoreStencil* ars, 856 GrPipelineBuilder::AutoRestoreStencil* ars,
854 GrScissorState* scissorState, 857 GrScissorState* scissorState,
855 const SkRect* devBounds) SK_OVERRIDE; 858 const SkRect* devBounds) SK_OVERRIDE;
856 859
857 typedef GrDrawTarget INHERITED; 860 typedef GrDrawTarget INHERITED;
858 }; 861 };
859 862
860 #endif 863 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698