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

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: Omission with non-inverted path bounds fixed 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
332 * antialias flag on the draw state (if possible in the 3D API).
333 */
334 void fillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fil l);
335
336 /**
331 * 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
332 * and thus will finalize any reserved geometry. 338 * and thus will finalize any reserved geometry.
333 * 339 *
334 * @param rect the rect to draw 340 * @param rect the rect to draw
335 * @param matrix optional matrix applied to rect (before viewMatrix) 341 * @param matrix optional matrix applied to rect (before viewMatrix)
336 * @param localRect optional rect that specifies local coords to map onto 342 * @param localRect optional rect that specifies local coords to map onto
337 * rect. If NULL then rect serves as the local coords. 343 * rect. If NULL then rect serves as the local coords.
338 * @param localMatrix optional matrix applied to localRect. If 344 * @param localMatrix optional matrix applied to localRect. If
339 * srcRect is non-NULL and srcMatrix is non-NULL 345 * srcRect is non-NULL and srcMatrix is non-NULL
340 * then srcRect will be transformed by srcMatrix. 346 * 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 832 // 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 833 // this to perform more optimal rect rendering. Its draws should be funneled through
828 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed, 834 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed,
829 // drawIndexedInstances, ...). The base class draws a two triangle fan using 835 // drawIndexedInstances, ...). The base class draws a two triangle fan using
830 // drawNonIndexed from reserved vertex space. 836 // drawNonIndexed from reserved vertex space.
831 virtual void onDrawRect(const SkRect& rect, 837 virtual void onDrawRect(const SkRect& rect,
832 const SkMatrix* matrix, 838 const SkMatrix* matrix,
833 const SkRect* localRect, 839 const SkRect* localRect,
834 const SkMatrix* localMatrix); 840 const SkMatrix* localMatrix);
835 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;
836 843
837 // helpers for reserving vertex and index space. 844 // helpers for reserving vertex and index space.
838 bool reserveVertexSpace(size_t vertexSize, 845 bool reserveVertexSpace(size_t vertexSize,
839 int vertexCount, 846 int vertexCount,
840 void** vertices); 847 void** vertices);
841 bool reserveIndexSpace(int indexCount, void** indices); 848 bool reserveIndexSpace(int indexCount, void** indices);
842 849
843 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to 850 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to
844 // indicate non-indexed drawing. 851 // indicate non-indexed drawing.
845 bool checkDraw(GrPrimitiveType type, int startVertex, 852 bool checkDraw(GrPrimitiveType type, int startVertex,
(...skipping 17 matching lines...) Expand all
863 const GrClipData* fClip; 870 const GrClipData* fClip;
864 GrDrawState* fDrawState; 871 GrDrawState* fDrawState;
865 GrDrawState fDefaultDraw State; 872 GrDrawState fDefaultDraw State;
866 // 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.
867 GrContext* fContext; 874 GrContext* fContext;
868 875
869 typedef SkRefCnt INHERITED; 876 typedef SkRefCnt INHERITED;
870 }; 877 };
871 878
872 #endif 879 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698