| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrDefaultGeoProcFactory.h" | 8 #include "GrDefaultGeoProcFactory.h" |
| 9 | 9 |
| 10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 class DefaultGeoProc : public GrGeometryProcessor { | 27 class DefaultGeoProc : public GrGeometryProcessor { |
| 28 public: | 28 public: |
| 29 static GrGeometryProcessor* Create(uint32_t gpTypeFlags, | 29 static GrGeometryProcessor* Create(uint32_t gpTypeFlags, |
| 30 GrColor color, | 30 GrColor color, |
| 31 const SkMatrix& viewMatrix, | 31 const SkMatrix& viewMatrix, |
| 32 const SkMatrix& localMatrix, | 32 const SkMatrix& localMatrix, |
| 33 bool localCoordsWillBeRead, | 33 bool localCoordsWillBeRead, |
| 34 bool coverageWillBeIgnored, | 34 bool coverageWillBeIgnored, |
| 35 uint8_t coverage) { | 35 uint8_t coverage) { |
| 36 return SkNEW_ARGS(DefaultGeoProc, (gpTypeFlags, | 36 return new DefaultGeoProc(gpTypeFlags, color, viewMatrix, localMatrix, c
overage, |
| 37 color, | 37 localCoordsWillBeRead, coverageWillBeIgnored); |
| 38 viewMatrix, | |
| 39 localMatrix, | |
| 40 coverage, | |
| 41 localCoordsWillBeRead, | |
| 42 coverageWillBeIgnored)); | |
| 43 } | 38 } |
| 44 | 39 |
| 45 const char* name() const override { return "DefaultGeometryProcessor"; } | 40 const char* name() const override { return "DefaultGeometryProcessor"; } |
| 46 | 41 |
| 47 const Attribute* inPosition() const { return fInPosition; } | 42 const Attribute* inPosition() const { return fInPosition; } |
| 48 const Attribute* inColor() const { return fInColor; } | 43 const Attribute* inColor() const { return fInColor; } |
| 49 const Attribute* inLocalCoords() const { return fInLocalCoords; } | 44 const Attribute* inLocalCoords() const { return fInLocalCoords; } |
| 50 const Attribute* inCoverage() const { return fInCoverage; } | 45 const Attribute* inCoverage() const { return fInCoverage; } |
| 51 GrColor color() const { return fColor; } | 46 GrColor color() const { return fColor; } |
| 52 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } | 47 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 }; | 176 }; |
| 182 | 177 |
| 183 virtual void getGLProcessorKey(const GrBatchTracker& bt, | 178 virtual void getGLProcessorKey(const GrBatchTracker& bt, |
| 184 const GrGLSLCaps& caps, | 179 const GrGLSLCaps& caps, |
| 185 GrProcessorKeyBuilder* b) const override { | 180 GrProcessorKeyBuilder* b) const override { |
| 186 GLProcessor::GenKey(*this, bt, caps, b); | 181 GLProcessor::GenKey(*this, bt, caps, b); |
| 187 } | 182 } |
| 188 | 183 |
| 189 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 184 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
| 190 const GrGLSLCaps&) const ov
erride { | 185 const GrGLSLCaps&) const ov
erride { |
| 191 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 186 return new GLProcessor(*this, bt); |
| 192 } | 187 } |
| 193 | 188 |
| 194 private: | 189 private: |
| 195 DefaultGeoProc(uint32_t gpTypeFlags, | 190 DefaultGeoProc(uint32_t gpTypeFlags, |
| 196 GrColor color, | 191 GrColor color, |
| 197 const SkMatrix& viewMatrix, | 192 const SkMatrix& viewMatrix, |
| 198 const SkMatrix& localMatrix, | 193 const SkMatrix& localMatrix, |
| 199 uint8_t coverage, | 194 uint8_t coverage, |
| 200 bool localCoordsWillBeRead, | 195 bool localCoordsWillBeRead, |
| 201 bool coverageWillBeIgnored) | 196 bool coverageWillBeIgnored) |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 314 } |
| 320 | 315 |
| 321 if (localCoords.hasLocalMatrix()) { | 316 if (localCoords.hasLocalMatrix()) { |
| 322 invert.preConcat(*localCoords.fMatrix); | 317 invert.preConcat(*localCoords.fMatrix); |
| 323 } | 318 } |
| 324 } | 319 } |
| 325 | 320 |
| 326 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 321 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
| 327 return Create(color, coverage, inverted, SkMatrix::I()); | 322 return Create(color, coverage, inverted, SkMatrix::I()); |
| 328 } | 323 } |
| OLD | NEW |