OLD | NEW |
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 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 const SkRect* devBounds = NULL); | 321 const SkRect* devBounds = NULL); |
322 | 322 |
323 /** | 323 /** |
324 * Draws path into the stencil buffer. The fill must be either even/odd or | 324 * Draws path into the stencil buffer. The fill must be either even/odd or |
325 * winding (not inverse or hairline). It will respect the HW antialias flag | 325 * winding (not inverse or hairline). It will respect the HW antialias flag |
326 * on the draw state (if possible in the 3D API). | 326 * on the draw state (if possible in the 3D API). |
327 */ | 327 */ |
328 void stencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType
fill); | 328 void stencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType
fill); |
329 | 329 |
330 /** | 330 /** |
331 * Fills a path. Fill must not be a hairline. It will respect the HW | 331 * Draws a path. Fill must not be a hairline. It will respect the HW |
332 * antialias flag on the draw state (if possible in the 3D API). | 332 * antialias flag on the draw state (if possible in the 3D API). |
333 */ | 333 */ |
334 void fillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fil
l); | 334 void drawPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fil
l); |
335 | 335 |
336 /** | 336 /** |
337 * Helper function for drawing rects. It performs a geometry src push and po
p | 337 * Helper function for drawing rects. It performs a geometry src push and po
p |
338 * and thus will finalize any reserved geometry. | 338 * and thus will finalize any reserved geometry. |
339 * | 339 * |
340 * @param rect the rect to draw | 340 * @param rect the rect to draw |
341 * @param matrix optional matrix applied to rect (before viewMatrix) | 341 * @param matrix optional matrix applied to rect (before viewMatrix) |
342 * @param localRect optional rect that specifies local coords to map onto | 342 * @param localRect optional rect that specifies local coords to map onto |
343 * rect. If NULL then rect serves as the local coords. | 343 * rect. If NULL then rect serves as the local coords. |
344 * @param localMatrix optional matrix applied to localRect. If | 344 * @param localMatrix optional matrix applied to localRect. If |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // be saved before this is called and restored afterwards. A subclass may ov
erride | 832 // be saved before this is called and restored afterwards. A subclass may ov
erride |
833 // this to perform more optimal rect rendering. Its draws should be funneled
through | 833 // this to perform more optimal rect rendering. Its draws should be funneled
through |
834 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed, | 834 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed, |
835 // drawIndexedInstances, ...). The base class draws a two triangle fan using | 835 // drawIndexedInstances, ...). The base class draws a two triangle fan using |
836 // drawNonIndexed from reserved vertex space. | 836 // drawNonIndexed from reserved vertex space. |
837 virtual void onDrawRect(const SkRect& rect, | 837 virtual void onDrawRect(const SkRect& rect, |
838 const SkMatrix* matrix, | 838 const SkMatrix* matrix, |
839 const SkRect* localRect, | 839 const SkRect* localRect, |
840 const SkMatrix* localMatrix); | 840 const SkMatrix* localMatrix); |
841 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath:
:FillType fill) = 0; | 841 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath:
:FillType fill) = 0; |
842 virtual void onFillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::Fi
llType fill) = 0; | 842 virtual void onDrawPath(const GrPath*, const SkStrokeRec& stroke, SkPath::Fi
llType fill) = 0; |
843 | 843 |
844 // helpers for reserving vertex and index space. | 844 // helpers for reserving vertex and index space. |
845 bool reserveVertexSpace(size_t vertexSize, | 845 bool reserveVertexSpace(size_t vertexSize, |
846 int vertexCount, | 846 int vertexCount, |
847 void** vertices); | 847 void** vertices); |
848 bool reserveIndexSpace(int indexCount, void** indices); | 848 bool reserveIndexSpace(int indexCount, void** indices); |
849 | 849 |
850 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to | 850 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to |
851 // indicate non-indexed drawing. | 851 // indicate non-indexed drawing. |
852 bool checkDraw(GrPrimitiveType type, int startVertex, | 852 bool checkDraw(GrPrimitiveType type, int startVertex, |
(...skipping 17 matching lines...) Expand all Loading... |
870 const GrClipData* fClip; | 870 const GrClipData* fClip; |
871 GrDrawState* fDrawState; | 871 GrDrawState* fDrawState; |
872 GrDrawState fDefaultDraw
State; | 872 GrDrawState fDefaultDraw
State; |
873 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 873 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
874 GrContext* fContext; | 874 GrContext* fContext; |
875 | 875 |
876 typedef SkRefCnt INHERITED; | 876 typedef SkRefCnt INHERITED; |
877 }; | 877 }; |
878 | 878 |
879 #endif | 879 #endif |
OLD | NEW |