| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 GrPipelineOptimizations& opts, | 27 const GrPipelineOptimizations& opts, |
| 28 const SkMatrix& viewMatrix = SkMatrix::I(), | 28 const SkMatrix& viewMatrix = SkMatrix::I(), |
| 29 const SkMatrix& localMatrix = SkMatrix::I())
{ | 29 const SkMatrix& localMatrix = SkMatrix::I())
{ |
| 30 return new GrPathProcessor(color, opts, viewMatrix, localMatrix); | 30 return new GrPathProcessor(color, opts, viewMatrix, localMatrix); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void initBatchTracker(GrBatchTracker*, const GrPipelineOptimizations&) const
override; | |
| 34 | |
| 35 bool isEqual(const GrBatchTracker& mine, | |
| 36 const GrPrimitiveProcessor& that, | |
| 37 const GrBatchTracker& theirs) const; | |
| 38 | |
| 39 const char* name() const override { return "PathProcessor"; } | 33 const char* name() const override { return "PathProcessor"; } |
| 40 | 34 |
| 41 GrColor color() const { return fColor; } | 35 GrColor color() const { return fColor; } |
| 42 const SkMatrix& viewMatrix() const { return fViewMatrix; } | 36 const SkMatrix& viewMatrix() const { return fViewMatrix; } |
| 43 const SkMatrix& localMatrix() const { return fLocalMatrix; } | 37 const SkMatrix& localMatrix() const { return fLocalMatrix; } |
| 44 | 38 |
| 45 void getInvariantOutputColor(GrInitInvariantOutput* out) const override; | |
| 46 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override; | |
| 47 | |
| 48 bool willUseGeoShader() const override { return false; } | 39 bool willUseGeoShader() const override { return false; } |
| 49 | 40 |
| 50 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 41 virtual void getGLProcessorKey(const GrGLSLCaps& caps, |
| 51 const GrGLSLCaps& caps, | |
| 52 GrProcessorKeyBuilder* b) const override; | 42 GrProcessorKeyBuilder* b) const override; |
| 53 | 43 |
| 54 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 44 virtual GrGLPrimitiveProcessor* createGLInstance(const GrGLSLCaps& caps) con
st override; |
| 55 const GrGLSLCaps& caps) con
st override; | |
| 56 | 45 |
| 57 bool hasTransformedLocalCoords() const override { return false; } | 46 bool hasTransformedLocalCoords() const override { return false; } |
| 58 | 47 |
| 59 const GrPipelineOptimizations& opts() const { return fOpts; } | 48 const GrPipelineOptimizations& opts() const { return fOpts; } |
| 60 | 49 |
| 61 private: | 50 private: |
| 62 GrPathProcessor(GrColor color, const GrPipelineOptimizations& opts, | 51 GrPathProcessor(GrColor color, const GrPipelineOptimizations& opts, |
| 63 const SkMatrix& viewMatrix, const SkMatrix& localMatrix); | 52 const SkMatrix& viewMatrix, const SkMatrix& localMatrix); |
| 64 | 53 |
| 65 bool hasExplicitLocalCoords() const override { return false; } | 54 bool hasExplicitLocalCoords() const override { return false; } |
| 66 | 55 |
| 67 GrColor fColor; | 56 GrColor fColor; |
| 68 const SkMatrix fViewMatrix; | 57 const SkMatrix fViewMatrix; |
| 69 const SkMatrix fLocalMatrix; | 58 const SkMatrix fLocalMatrix; |
| 70 GrPipelineOptimizations fOpts; | 59 GrPipelineOptimizations fOpts; |
| 71 | 60 |
| 72 typedef GrPrimitiveProcessor INHERITED; | 61 typedef GrPrimitiveProcessor INHERITED; |
| 73 }; | 62 }; |
| 74 | 63 |
| 75 #endif | 64 #endif |
| OLD | NEW |