| 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 "GrCustomCoordsTextureEffect.h" | 8 #include "GrCustomCoordsTextureEffect.h" |
| 9 #include "gl/builders/GrGLFullProgramBuilder.h" | 9 #include "gl/builders/GrGLSkiaProgramBuilder.h" |
| 10 #include "gl/GrGLProcessor.h" | 10 #include "gl/GrGLProcessor.h" |
| 11 #include "gl/GrGLSL.h" | 11 #include "gl/GrGLSL.h" |
| 12 #include "gl/GrGLTexture.h" | 12 #include "gl/GrGLTexture.h" |
| 13 #include "gl/GrGLGeometryProcessor.h" | 13 #include "gl/GrGLGeometryProcessor.h" |
| 14 #include "GrTBackendProcessorFactory.h" | 14 #include "GrTBackendProcessorFactory.h" |
| 15 #include "GrTexture.h" | 15 #include "GrTexture.h" |
| 16 | 16 |
| 17 class GrGLCustomCoordsTextureEffect : public GrGLGeometryProcessor { | 17 class GrGLCustomCoordsTextureEffect : public GrGLGeometryProcessor { |
| 18 public: | 18 public: |
| 19 GrGLCustomCoordsTextureEffect(const GrBackendProcessorFactory& factory, cons
t GrProcessor&) | 19 GrGLCustomCoordsTextureEffect(const GrBackendProcessorFactory& factory, cons
t GrProcessor&) |
| 20 : INHERITED (factory) {} | 20 : INHERITED (factory) {} |
| 21 | 21 |
| 22 virtual void emitCode(GrGLFullProgramBuilder* builder, | 22 virtual void emitCode(GrGLGeometryProcessorProgramBuilder* builder, |
| 23 const GrGeometryProcessor& geometryProcessor, | 23 const GrGeometryProcessor& geometryProcessor, |
| 24 const GrProcessorKey& key, | 24 const GrProcessorKey& key, |
| 25 const char* outputColor, | 25 const char* outputColor, |
| 26 const char* inputColor, | 26 const char* inputColor, |
| 27 const TransformedCoordsArray&, | 27 const TransformedCoordsArray&, |
| 28 const TextureSamplerArray& samplers) SK_OVERRIDE { | 28 const TextureSamplerArray& samplers) SK_OVERRIDE { |
| 29 const GrCustomCoordsTextureEffect& customCoordsTextureEffect = | 29 const GrCustomCoordsTextureEffect& customCoordsTextureEffect = |
| 30 geometryProcessor.cast<GrCustomCoordsTextureEffect>(); | 30 geometryProcessor.cast<GrCustomCoordsTextureEffect>(); |
| 31 SkASSERT(1 == customCoordsTextureEffect.getVertexAttribs().count()); | 31 SkASSERT(1 == customCoordsTextureEffect.getVertexAttribs().count()); |
| 32 | 32 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 }; | 103 }; |
| 104 SkShader::TileMode tileModes[] = { | 104 SkShader::TileMode tileModes[] = { |
| 105 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 105 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 106 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], | 106 kTileModes[random->nextULessThan(SK_ARRAY_COUNT(kTileModes))], |
| 107 }; | 107 }; |
| 108 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : | 108 GrTextureParams params(tileModes, random->nextBool() ? GrTextureParams::kBil
erp_FilterMode : |
| 109 GrTextureParams::kNon
e_FilterMode); | 109 GrTextureParams::kNon
e_FilterMode); |
| 110 | 110 |
| 111 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); | 111 return GrCustomCoordsTextureEffect::Create(textures[texIdx], params); |
| 112 } | 112 } |
| OLD | NEW |