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

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

Issue 1152733009: Screenspace AA tessellated path rendering. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make GLPrograms test generate only simple fills. Created 4 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
« no previous file with comments | « src/gpu/GrPathRendererChain.cpp ('k') | src/gpu/GrTessellator.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 2015 Google Inc. 2 * Copyright 2015 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 GrTessellator_DEFINED 8 #ifndef GrTessellator_DEFINED
9 #define GrTessellator_DEFINED 9 #define GrTessellator_DEFINED
10 10
11 #include "GrColor.h"
11 #include "SkPoint.h" 12 #include "SkPoint.h"
12 13
13 class SkPath; 14 class SkPath;
14 struct SkRect; 15 struct SkRect;
15 16
16 /** 17 /**
17 * Provides utility functions for converting paths to a collection of triangles. 18 * Provides utility functions for converting paths to a collection of triangles.
18 */ 19 */
19 20
20 #define TESSELLATOR_WIREFRAME 0 21 #define TESSELLATOR_WIREFRAME 0
21 22
22 namespace GrTessellator { 23 namespace GrTessellator {
23 24
24 class VertexAllocator { 25 class VertexAllocator {
25 public: 26 public:
27 VertexAllocator(size_t stride) : fStride(stride) {}
26 virtual ~VertexAllocator() {} 28 virtual ~VertexAllocator() {}
27 virtual SkPoint* lock(int vertexCount) = 0; 29 virtual void* lock(int vertexCount) = 0;
28 virtual void unlock(int actualCount) = 0; 30 virtual void unlock(int actualCount) = 0;
31 size_t stride() const { return fStride; }
32 private:
33 size_t fStride;
29 }; 34 };
30 35
31 struct WindingVertex { 36 struct WindingVertex {
32 SkPoint fPos; 37 SkPoint fPos;
33 int fWinding; 38 int fWinding;
34 }; 39 };
35 40
36 // Triangulates a path to an array of vertices. Each triangle is represented as a set of three 41 // Triangulates a path to an array of vertices. Each triangle is represented as a set of three
37 // WindingVertex entries, each of which contains the position and winding count (which is the same 42 // WindingVertex entries, each of which contains the position and winding count (which is the same
38 // for all three vertices of a triangle). The 'verts' out parameter is set to po int to the resultant 43 // for all three vertices of a triangle). The 'verts' out parameter is set to po int to the resultant
39 // vertex array. CALLER IS RESPONSIBLE for deleting this buffer to avoid a memor y leak! 44 // vertex array. CALLER IS RESPONSIBLE for deleting this buffer to avoid a memor y leak!
40 int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBou nds, 45 int PathToVertices(const SkPath& path, SkScalar tolerance, const SkRect& clipBou nds,
41 WindingVertex** verts); 46 WindingVertex** verts);
42 47
43 int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBo unds, 48 int PathToTriangles(const SkPath& path, SkScalar tolerance, const SkRect& clipBo unds,
44 VertexAllocator*, bool *isLinear); 49 VertexAllocator*, bool antialias, const GrColor& color,
50 bool canTweakAlphaForCoverage, bool *isLinear);
45 } 51 }
46 52
47 #endif 53 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPathRendererChain.cpp ('k') | src/gpu/GrTessellator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698