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(const SkMatrix& localMatrix = SkMatrix::I()) | 22 GrGeometryProcessor() |
23 : INHERITED(localMatrix, false) | 23 : INHERITED(false) |
24 , fWillUseGeoShader(false) | 24 , fWillUseGeoShader(false) |
25 , fHasLocalCoords(false) {} | 25 , fHasLocalCoords(false) {} |
26 | 26 |
27 bool willUseGeoShader() const { return fWillUseGeoShader; } | 27 bool willUseGeoShader() const { return fWillUseGeoShader; } |
28 | 28 |
29 // TODO delete this when paths are in batch | 29 // TODO delete this when paths are in batch |
30 bool canMakeEqual(const GrBatchTracker& mine, | 30 bool canMakeEqual(const GrBatchTracker& mine, |
31 const GrPrimitiveProcessor& that, | 31 const GrPrimitiveProcessor& that, |
32 const GrBatchTracker& theirs) const override { | 32 const GrBatchTracker& theirs) const override { |
33 SkFAIL("Unsupported\n"); | 33 SkFAIL("Unsupported\n"); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 private: | 96 private: |
97 bool hasExplicitLocalCoords() const override { return fHasLocalCoords; } | 97 bool hasExplicitLocalCoords() const override { return fHasLocalCoords; } |
98 | 98 |
99 bool fWillUseGeoShader; | 99 bool fWillUseGeoShader; |
100 bool fHasLocalCoords; | 100 bool fHasLocalCoords; |
101 | 101 |
102 typedef GrPrimitiveProcessor INHERITED; | 102 typedef GrPrimitiveProcessor INHERITED; |
103 }; | 103 }; |
104 | 104 |
105 #endif | 105 #endif |
OLD | NEW |