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

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: rebase Created 7 years, 2 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 const SkRect* devBounds = NULL); 322 const SkRect* devBounds = NULL);
323 323
324 /** 324 /**
325 * Draws path into the stencil buffer. The fill must be either even/odd or 325 * Draws path into the stencil buffer. The fill must be either even/odd or
326 * winding (not inverse or hairline). It will respect the HW antialias flag 326 * winding (not inverse or hairline). It will respect the HW antialias flag
327 * on the draw state (if possible in the 3D API). 327 * on the draw state (if possible in the 3D API).
328 */ 328 */
329 void stencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fill); 329 void stencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fill);
330 330
331 /** 331 /**
332 * Fills a path. Fill must not be a hairline. It will respect the HW
333 * antialias flag on the draw state (if possible in the 3D API).
334 */
335 void fillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType fil l);
336
337 /**
332 * 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
333 * and thus will finalize any reserved geometry. 339 * and thus will finalize any reserved geometry.
334 * 340 *
335 * @param rect the rect to draw 341 * @param rect the rect to draw
336 * @param matrix optional matrix applied to rect (before viewMatrix) 342 * @param matrix optional matrix applied to rect (before viewMatrix)
337 * @param localRect optional rect that specifies local coords to map onto 343 * @param localRect optional rect that specifies local coords to map onto
338 * rect. If NULL then rect serves as the local coords. 344 * rect. If NULL then rect serves as the local coords.
339 * @param localMatrix optional matrix applied to localRect. If 345 * @param localMatrix optional matrix applied to localRect. If
340 * srcRect is non-NULL and srcMatrix is non-NULL 346 * srcRect is non-NULL and srcMatrix is non-NULL
341 * 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
827 // 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
828 // 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
829 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed, 835 // one of the public GrDrawTarget draw methods (e.g. drawNonIndexed,
830 // drawIndexedInstances, ...). The base class draws a two triangle fan using 836 // drawIndexedInstances, ...). The base class draws a two triangle fan using
831 // drawNonIndexed from reserved vertex space. 837 // drawNonIndexed from reserved vertex space.
832 virtual void onDrawRect(const SkRect& rect, 838 virtual void onDrawRect(const SkRect& rect,
833 const SkMatrix* matrix, 839 const SkMatrix* matrix,
834 const SkRect* localRect, 840 const SkRect* localRect,
835 const SkMatrix* localMatrix); 841 const SkMatrix* localMatrix);
836 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 onFillPath(const GrPath*, const SkStrokeRec& stroke, SkPath::Fi llType fill) = 0;
837 844
838 // helpers for reserving vertex and index space. 845 // helpers for reserving vertex and index space.
839 bool reserveVertexSpace(size_t vertexSize, 846 bool reserveVertexSpace(size_t vertexSize,
840 int vertexCount, 847 int vertexCount,
841 void** vertices); 848 void** vertices);
842 bool reserveIndexSpace(int indexCount, void** indices); 849 bool reserveIndexSpace(int indexCount, void** indices);
843 850
844 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to 851 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to
845 // indicate non-indexed drawing. 852 // indicate non-indexed drawing.
846 bool checkDraw(GrPrimitiveType type, int startVertex, 853 bool checkDraw(GrPrimitiveType type, int startVertex,
(...skipping 17 matching lines...) Expand all
864 const GrClipData* fClip; 871 const GrClipData* fClip;
865 GrDrawState* fDrawState; 872 GrDrawState* fDrawState;
866 GrDrawState fDefaultDraw State; 873 GrDrawState fDefaultDraw State;
867 // 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.
868 GrContext* fContext; 875 GrContext* fContext;
869 876
870 typedef SkRefCnt INHERITED; 877 typedef SkRefCnt INHERITED;
871 }; 878 };
872 879
873 #endif 880 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698