OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkColorMatrixFilter.h" | 8 #include "SkColorMatrixFilter.h" |
9 #include "SkColorMatrix.h" | 9 #include "SkColorMatrix.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 GR_DECLARE_EFFECT_TEST; | 385 GR_DECLARE_EFFECT_TEST; |
386 | 386 |
387 class GLEffect : public GrGLEffect { | 387 class GLEffect : public GrGLEffect { |
388 public: | 388 public: |
389 // this class always generates the same code. | 389 // this class always generates the same code. |
390 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) { return 0
; } | 390 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) { return 0
; } |
391 | 391 |
392 GLEffect(const GrBackendEffectFactory& factory, | 392 GLEffect(const GrBackendEffectFactory& factory, |
393 const GrDrawEffect&) | 393 const GrDrawEffect&) |
394 : INHERITED(factory) | 394 : INHERITED(factory) { |
395 , fMatrixHandle(GrGLUniformManager::kInvalidUniformHandle) | 395 } |
396 , fVectorHandle(GrGLUniformManager::kInvalidUniformHandle) {} | |
397 | 396 |
398 virtual void emitCode(GrGLShaderBuilder* builder, | 397 virtual void emitCode(GrGLShaderBuilder* builder, |
399 const GrDrawEffect&, | 398 const GrDrawEffect&, |
400 EffectKey, | 399 EffectKey, |
401 const char* outputColor, | 400 const char* outputColor, |
402 const char* inputColor, | 401 const char* inputColor, |
403 const TextureSamplerArray&) SK_OVERRIDE { | 402 const TextureSamplerArray&) SK_OVERRIDE { |
404 fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Sha
derType, | 403 fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Sha
derType, |
405 kMat44f_GrSLType, | 404 kMat44f_GrSLType, |
406 "ColorMatrix"); | 405 "ColorMatrix"); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 str->append("matrix: ("); | 485 str->append("matrix: ("); |
487 for (int i = 0; i < 20; ++i) { | 486 for (int i = 0; i < 20; ++i) { |
488 str->appendScalar(fMatrix.fMat[i]); | 487 str->appendScalar(fMatrix.fMat[i]); |
489 if (i < 19) { | 488 if (i < 19) { |
490 str->append(", "); | 489 str->append(", "); |
491 } | 490 } |
492 } | 491 } |
493 str->append(")"); | 492 str->append(")"); |
494 } | 493 } |
495 #endif | 494 #endif |
OLD | NEW |