| 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 GrPathProcessor_DEFINED | 8 #ifndef GrPathProcessor_DEFINED |
| 9 #define GrPathProcessor_DEFINED | 9 #define GrPathProcessor_DEFINED |
| 10 | 10 |
| 11 #include "GrPrimitiveProcessor.h" | 11 #include "GrPrimitiveProcessor.h" |
| 12 | 12 |
| 13 struct PathBatchTracker { | 13 struct PathBatchTracker { |
| 14 GrGPInput fInputColorType; | 14 GrGPInput fInputColorType; |
| 15 GrGPInput fInputCoverageType; | 15 GrGPInput fInputCoverageType; |
| 16 GrColor fColor; | 16 GrColor fColor; |
| 17 bool fUsesLocalCoords; | 17 bool fUsesLocalCoords; |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 /* | 20 /* |
| 21 * The path equivalent of the GP. For now this just manages color. In the long
term we plan on | 21 * The path equivalent of the GP. For now this just manages color. In the long
term we plan on |
| 22 * extending this class to handle all nvpr uniform / varying / program work. | 22 * extending this class to handle all nvpr uniform / varying / program work. |
| 23 */ | 23 */ |
| 24 class GrPathProcessor : public GrPrimitiveProcessor { | 24 class GrPathProcessor : public GrPrimitiveProcessor { |
| 25 public: | 25 public: |
| 26 static GrPathProcessor* Create(GrColor color, | 26 static GrPathProcessor* Create(GrColor color, |
| 27 const SkMatrix& viewMatrix = SkMatrix::I(), | 27 const SkMatrix& viewMatrix = SkMatrix::I(), |
| 28 const SkMatrix& localMatrix = SkMatrix::I())
{ | 28 const SkMatrix& localMatrix = SkMatrix::I())
{ |
| 29 return SkNEW_ARGS(GrPathProcessor, (color, viewMatrix, localMatrix)); | 29 return new GrPathProcessor(color, viewMatrix, localMatrix); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void initBatchTracker(GrBatchTracker*, const GrPipelineOptimizations&) const
override; | 32 void initBatchTracker(GrBatchTracker*, const GrPipelineOptimizations&) const
override; |
| 33 | 33 |
| 34 bool canMakeEqual(const GrBatchTracker& mine, | 34 bool canMakeEqual(const GrBatchTracker& mine, |
| 35 const GrPrimitiveProcessor& that, | 35 const GrPrimitiveProcessor& that, |
| 36 const GrBatchTracker& theirs) const override; | 36 const GrBatchTracker& theirs) const override; |
| 37 | 37 |
| 38 const char* name() const override { return "PathProcessor"; } | 38 const char* name() const override { return "PathProcessor"; } |
| 39 | 39 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 62 bool hasExplicitLocalCoords() const override { return false; } | 62 bool hasExplicitLocalCoords() const override { return false; } |
| 63 | 63 |
| 64 GrColor fColor; | 64 GrColor fColor; |
| 65 const SkMatrix fViewMatrix; | 65 const SkMatrix fViewMatrix; |
| 66 const SkMatrix fLocalMatrix; | 66 const SkMatrix fLocalMatrix; |
| 67 | 67 |
| 68 typedef GrPrimitiveProcessor INHERITED; | 68 typedef GrPrimitiveProcessor INHERITED; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif | 71 #endif |
| OLD | NEW |