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 GrGeometryProcessor() | 22 GrGeometryProcessor() |
23 : INHERITED(false) | 23 : INHERITED(false) |
24 , fWillUseGeoShader(false) | 24 , fWillUseGeoShader(false) |
25 , fLocalCoordsType(kUnused_LocalCoordsType) {} | 25 , fLocalCoordsType(kUnused_LocalCoordsType) {} |
26 | 26 |
27 bool willUseGeoShader() const override { return fWillUseGeoShader; } | 27 bool willUseGeoShader() const override { return fWillUseGeoShader; } |
28 | 28 |
29 // TODO delete when paths are in batch | |
30 void initBatchTracker(GrBatchTracker*, const GrPipelineOptimizations&) const
override {} | |
31 | |
32 // TODO Delete when paths are in batch | |
33 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | |
34 SkFAIL("Unsupported\n"); | |
35 } | |
36 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | |
37 SkFAIL("Unsupported\n"); | |
38 } | |
39 | |
40 bool hasTransformedLocalCoords() const override { | 29 bool hasTransformedLocalCoords() const override { |
41 return kHasTransformed_LocalCoordsType == fLocalCoordsType; | 30 return kHasTransformed_LocalCoordsType == fLocalCoordsType; |
42 } | 31 } |
43 | 32 |
44 bool hasExplicitLocalCoords() const override { | 33 bool hasExplicitLocalCoords() const override { |
45 return kHasExplicit_LocalCoordsType == fLocalCoordsType; | 34 return kHasExplicit_LocalCoordsType == fLocalCoordsType; |
46 } | 35 } |
47 | 36 |
48 protected: | 37 protected: |
49 /** | 38 /** |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 77 } |
89 | 78 |
90 private: | 79 private: |
91 bool fWillUseGeoShader; | 80 bool fWillUseGeoShader; |
92 LocalCoordsType fLocalCoordsType; | 81 LocalCoordsType fLocalCoordsType; |
93 | 82 |
94 typedef GrPrimitiveProcessor INHERITED; | 83 typedef GrPrimitiveProcessor INHERITED; |
95 }; | 84 }; |
96 | 85 |
97 #endif | 86 #endif |
OLD | NEW |