OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrGeometryProcessor_DEFINED | 8 #ifndef GrGeometryProcessor_DEFINED |
9 #define GrGeometryProcessor_DEFINED | 9 #define GrGeometryProcessor_DEFINED |
10 | 10 |
11 #include "GrPrimitiveProcessor.h" | 11 #include "GrPrimitiveProcessor.h" |
12 | 12 |
13 /** | 13 /** |
14 * A GrGeometryProcessor is a flexible method for rendering a primitive. The Gr GeometryProcessor | 14 * A GrGeometryProcessor is a flexible method for rendering a primitive. The Gr GeometryProcessor |
15 * has complete control over vertex attributes and uniforms(aside from the rende r target) but it | 15 * has complete control over vertex attributes and uniforms(aside from the rende r target) but it |
16 * must obey the same contract as any GrPrimitiveProcessor, specifically it must emit a color and | 16 * must obey the same contract as any GrPrimitiveProcessor, specifically it must emit a color and |
17 * coverage into the fragment shader. Where this color and coverage come from i s completely the | 17 * coverage into the fragment shader. Where this color and coverage come from i s completely the |
18 * responsibility of the GrGeometryProcessor. | 18 * responsibility of the GrGeometryProcessor. |
19 */ | 19 */ |
20 class GrGeometryProcessor : public GrPrimitiveProcessor { | 20 class GrGeometryProcessor : public GrPrimitiveProcessor { |
21 public: | 21 public: |
22 /** | |
23 * Creates a simple geometry processor that reads device-space positions as the first vertex | |
24 * attribute (vec1, offset=0) and passes it through. It does no color or co verage calculation | |
egdaniel
2015/10/14 21:22:13
extra space at start of comment?
| |
25 * and assumes no coord transforms are required by any FPs. | |
26 */ | |
27 static const GrGeometryProcessor* CreatePassthroughGP(size_t vertexStride); | |
28 | |
22 GrGeometryProcessor() | 29 GrGeometryProcessor() |
23 : INHERITED(false) | 30 : INHERITED(false) |
24 , fWillUseGeoShader(false) | 31 , fWillUseGeoShader(false) |
25 , fLocalCoordsType(kUnused_LocalCoordsType) {} | 32 , fLocalCoordsType(kUnused_LocalCoordsType) {} |
26 | 33 |
27 bool willUseGeoShader() const override { return fWillUseGeoShader; } | 34 bool willUseGeoShader() const override { return fWillUseGeoShader; } |
28 | 35 |
29 bool hasTransformedLocalCoords() const override { | 36 bool hasTransformedLocalCoords() const override { |
30 return kHasTransformed_LocalCoordsType == fLocalCoordsType; | 37 return kHasTransformed_LocalCoordsType == fLocalCoordsType; |
31 } | 38 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 } | 84 } |
78 | 85 |
79 private: | 86 private: |
80 bool fWillUseGeoShader; | 87 bool fWillUseGeoShader; |
81 LocalCoordsType fLocalCoordsType; | 88 LocalCoordsType fLocalCoordsType; |
82 | 89 |
83 typedef GrPrimitiveProcessor INHERITED; | 90 typedef GrPrimitiveProcessor INHERITED; |
84 }; | 91 }; |
85 | 92 |
86 #endif | 93 #endif |
OLD | NEW |