| 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 #include "GrBezierEffect.h" | 8 #include "GrBezierEffect.h" |
| 9 | 9 |
| 10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
| 11 #include "gl/GrGLSL.h" | 11 #include "gl/GrGLSL.h" |
| 12 #include "gl/GrGLGeometryProcessor.h" | 12 #include "gl/GrGLGeometryProcessor.h" |
| 13 #include "gl/builders/GrGLProgramBuilder.h" | 13 #include "gl/builders/GrGLProgramBuilder.h" |
| 14 | 14 |
| 15 struct ConicBatchTracker { | 15 struct ConicBatchTracker { |
| 16 GrGPInput fInputColorType; | 16 GrGPInput fInputColorType; |
| 17 GrColor fColor; | 17 GrColor fColor; |
| 18 uint8_t fCoverageScale; | 18 uint8_t fCoverageScale; |
| 19 bool fUsesLocalCoords; | 19 bool fUsesLocalCoords; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 class GrGLConicEffect : public GrGLGeometryProcessor { | 22 class GrGLConicEffect : public GrGLGeometryProcessor { |
| 23 public: | 23 public: |
| 24 GrGLConicEffect(const GrGeometryProcessor&, | 24 GrGLConicEffect(const GrGeometryProcessor&, |
| 25 const GrBatchTracker&); | 25 const GrBatchTracker&); |
| 26 | 26 |
| 27 virtual void emitCode(const EmitArgs&) SK_OVERRIDE; | 27 void emitCode(const EmitArgs&) SK_OVERRIDE; |
| 28 | 28 |
| 29 static inline void GenKey(const GrGeometryProcessor&, | 29 static inline void GenKey(const GrGeometryProcessor&, |
| 30 const GrBatchTracker&, | 30 const GrBatchTracker&, |
| 31 const GrGLCaps&, | 31 const GrGLCaps&, |
| 32 GrProcessorKeyBuilder*); | 32 GrProcessorKeyBuilder*); |
| 33 | 33 |
| 34 virtual void setData(const GrGLProgramDataManager& pdman, | 34 virtual void setData(const GrGLProgramDataManager& pdman, |
| 35 const GrPrimitiveProcessor& primProc, | 35 const GrPrimitiveProcessor& primProc, |
| 36 const GrBatchTracker& bt) SK_OVERRIDE { | 36 const GrBatchTracker& bt) SK_OVERRIDE { |
| 37 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); | 37 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 GrColor fColor; | 251 GrColor fColor; |
| 252 uint8_t fCoverageScale; | 252 uint8_t fCoverageScale; |
| 253 bool fUsesLocalCoords; | 253 bool fUsesLocalCoords; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 class GrGLQuadEffect : public GrGLGeometryProcessor { | 256 class GrGLQuadEffect : public GrGLGeometryProcessor { |
| 257 public: | 257 public: |
| 258 GrGLQuadEffect(const GrGeometryProcessor&, | 258 GrGLQuadEffect(const GrGeometryProcessor&, |
| 259 const GrBatchTracker&); | 259 const GrBatchTracker&); |
| 260 | 260 |
| 261 virtual void emitCode(const EmitArgs&) SK_OVERRIDE; | 261 void emitCode(const EmitArgs&) SK_OVERRIDE; |
| 262 | 262 |
| 263 static inline void GenKey(const GrGeometryProcessor&, | 263 static inline void GenKey(const GrGeometryProcessor&, |
| 264 const GrBatchTracker&, | 264 const GrBatchTracker&, |
| 265 const GrGLCaps&, | 265 const GrGLCaps&, |
| 266 GrProcessorKeyBuilder*); | 266 GrProcessorKeyBuilder*); |
| 267 | 267 |
| 268 virtual void setData(const GrGLProgramDataManager& pdman, | 268 virtual void setData(const GrGLProgramDataManager& pdman, |
| 269 const GrPrimitiveProcessor& primProc, | 269 const GrPrimitiveProcessor& primProc, |
| 270 const GrBatchTracker& bt) SK_OVERRIDE { | 270 const GrBatchTracker& bt) SK_OVERRIDE { |
| 271 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); | 271 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 GrGPInput fInputColorType; | 471 GrGPInput fInputColorType; |
| 472 GrColor fColor; | 472 GrColor fColor; |
| 473 bool fUsesLocalCoords; | 473 bool fUsesLocalCoords; |
| 474 }; | 474 }; |
| 475 | 475 |
| 476 class GrGLCubicEffect : public GrGLGeometryProcessor { | 476 class GrGLCubicEffect : public GrGLGeometryProcessor { |
| 477 public: | 477 public: |
| 478 GrGLCubicEffect(const GrGeometryProcessor&, | 478 GrGLCubicEffect(const GrGeometryProcessor&, |
| 479 const GrBatchTracker&); | 479 const GrBatchTracker&); |
| 480 | 480 |
| 481 virtual void emitCode(const EmitArgs&) SK_OVERRIDE; | 481 void emitCode(const EmitArgs&) SK_OVERRIDE; |
| 482 | 482 |
| 483 static inline void GenKey(const GrGeometryProcessor&, | 483 static inline void GenKey(const GrGeometryProcessor&, |
| 484 const GrBatchTracker&, | 484 const GrBatchTracker&, |
| 485 const GrGLCaps&, | 485 const GrGLCaps&, |
| 486 GrProcessorKeyBuilder*); | 486 GrProcessorKeyBuilder*); |
| 487 | 487 |
| 488 virtual void setData(const GrGLProgramDataManager& pdman, | 488 virtual void setData(const GrGLProgramDataManager& pdman, |
| 489 const GrPrimitiveProcessor& primProc, | 489 const GrPrimitiveProcessor& primProc, |
| 490 const GrBatchTracker& bt) SK_OVERRIDE { | 490 const GrBatchTracker& bt) SK_OVERRIDE { |
| 491 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); | 491 this->setUniformViewMatrix(pdman, primProc.viewMatrix()); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 GrGeometryProcessor* gp; | 693 GrGeometryProcessor* gp; |
| 694 do { | 694 do { |
| 695 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( | 695 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( |
| 696 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); | 696 random->nextULessThan(kGrPro
cessorEdgeTypeCnt)); |
| 697 gp = GrCubicEffect::Create(GrRandomColor(random), | 697 gp = GrCubicEffect::Create(GrRandomColor(random), |
| 698 GrProcessorUnitTest::TestMatrix(random), edge
Type, caps); | 698 GrProcessorUnitTest::TestMatrix(random), edge
Type, caps); |
| 699 } while (NULL == gp); | 699 } while (NULL == gp); |
| 700 return gp; | 700 return gp; |
| 701 } | 701 } |
| 702 | 702 |
| OLD | NEW |