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

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

Issue 22686002: Implement path cover with nv_path_rendering (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebased to issue 23537028 Created 7 years, 3 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
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
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 int vertexCount, 320 int vertexCount,
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 /**
Mark Kilgard 2013/09/13 15:42:24 Kimmo, I notice other method explanation comments
Chris Dalton 2013/09/13 19:49:58 About a year ago the convention changed from 80 li
bsalomon 2013/09/13 20:25:28 In practice it's not quite so strict as whole-file
Kimmo Kinnunen 2013/09/18 07:52:38 Done.
331 * Draws a path definedy by the path and the bits in the stencil buffer. The fill must be
332 * either even/odd or winding (not inverse or hairline). It will respect the HW antialias flag
333 * on the draw state (if possible in the 3D API).
334 */
335 void drawPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fil l);
Mark Kilgard 2013/09/13 15:42:24 Really drawPath is filling the path so does fillPa
Kimmo Kinnunen 2013/09/18 07:52:38 The fillPath does not seem to differ that signific
336
337 /**
331 * Helper function for drawing rects. It performs a geometry src push and po p 338 * Helper function for drawing rects. It performs a geometry src push and po p
332 * and thus will finalize any reserved geometry. 339 * and thus will finalize any reserved geometry.
333 * 340 *
334 * @param rect the rect to draw 341 * @param rect the rect to draw
335 * @param matrix optional matrix applied to rect (before viewMatrix) 342 * @param matrix optional matrix applied to rect (before viewMatrix)
336 * @param localRect optional rect that specifies local coords to map onto 343 * @param localRect optional rect that specifies local coords to map onto
337 * rect. If NULL then rect serves as the local coords. 344 * rect. If NULL then rect serves as the local coords.
338 * @param localMatrix optional matrix applied to localRect. If 345 * @param localMatrix optional matrix applied to localRect. If
339 * srcRect is non-NULL and srcMatrix is non-NULL 346 * srcRect is non-NULL and srcMatrix is non-NULL
340 * then srcRect will be transformed by srcMatrix. 347 * then srcRect will be transformed by srcMatrix.
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 // be saved before this is called and restored afterwards. A subclass may ov erride 833 // be saved before this is called and restored afterwards. A subclass may ov erride
827 // this to perform more optimal rect rendering. Its draws should be funneled through 834 // this to perform more optimal rect rendering. Its draws should be funneled through
828 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed, 835 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed,
829 // drawIndexedInstances, ...). The base class draws a two triangle fan using 836 // drawIndexedInstances, ...). The base class draws a two triangle fan using
830 // drawNonIndexed from reserved vertex space. 837 // drawNonIndexed from reserved vertex space.
831 virtual void onDrawRect(const SkRect& rect, 838 virtual void onDrawRect(const SkRect& rect,
832 const SkMatrix* matrix, 839 const SkMatrix* matrix,
833 const SkRect* localRect, 840 const SkRect* localRect,
834 const SkMatrix* localMatrix); 841 const SkMatrix* localMatrix);
835 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath: :FillType fill) = 0; 842 virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath: :FillType fill) = 0;
843 virtual void onDrawPath(const GrPath*, const SkStrokeRec& stroke, SkPath::Fi llType fill) = 0;
836 844
837 // helpers for reserving vertex and index space. 845 // helpers for reserving vertex and index space.
838 bool reserveVertexSpace(size_t vertexSize, 846 bool reserveVertexSpace(size_t vertexSize,
839 int vertexCount, 847 int vertexCount,
840 void** vertices); 848 void** vertices);
841 bool reserveIndexSpace(int indexCount, void** indices); 849 bool reserveIndexSpace(int indexCount, void** indices);
842 850
843 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to 851 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to
844 // indicate non-indexed drawing. 852 // indicate non-indexed drawing.
845 bool checkDraw(GrPrimitiveType type, int startVertex, 853 bool checkDraw(GrPrimitiveType type, int startVertex,
(...skipping 17 matching lines...) Expand all
863 const GrClipData* fClip; 871 const GrClipData* fClip;
864 GrDrawState* fDrawState; 872 GrDrawState* fDrawState;
865 GrDrawState fDefaultDraw State; 873 GrDrawState fDefaultDraw State;
866 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. 874 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get.
867 GrContext* fContext; 875 GrContext* fContext;
868 876
869 typedef SkRefCnt INHERITED; 877 typedef SkRefCnt INHERITED;
870 }; 878 };
871 879
872 #endif 880 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698