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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
9 #include "GrYUVtoRGBEffect.h" | 9 #include "GrYUVtoRGBEffect.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // this class always generates the same code. | 41 // this class always generates the same code. |
42 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu
ilder*) {} | 42 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu
ilder*) {} |
43 | 43 |
44 GLProcessor(const GrBackendProcessorFactory& factory, | 44 GLProcessor(const GrBackendProcessorFactory& factory, |
45 const GrProcessor&) | 45 const GrProcessor&) |
46 : INHERITED(factory) { | 46 : INHERITED(factory) { |
47 } | 47 } |
48 | 48 |
49 virtual void emitCode(GrGLFPBuilder* builder, | 49 virtual void emitCode(GrGLFPBuilder* builder, |
50 const GrFragmentProcessor&, | 50 const GrFragmentProcessor&, |
51 const GrProcessorKey&, | |
52 const char* outputColor, | 51 const char* outputColor, |
53 const char* inputColor, | 52 const char* inputColor, |
54 const TransformedCoordsArray& coords, | 53 const TransformedCoordsArray& coords, |
55 const TextureSamplerArray& samplers) SK_OVERRIDE { | 54 const TextureSamplerArray& samplers) SK_OVERRIDE { |
56 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder
(); | 55 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder
(); |
57 | 56 |
58 const char* yuvMatrix = NULL; | 57 const char* yuvMatrix = NULL; |
59 fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib
ility, | 58 fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib
ility, |
60 kMat44f_GrSLType, "YUVMatrix", | 59 kMat44f_GrSLType, "YUVMatrix", |
61 &yuvMatrix); | 60 &yuvMatrix); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 0.0f, 0.0f, 0.0f, 1.0}; | 133 0.0f, 0.0f, 0.0f, 1.0}; |
135 } | 134 } |
136 | 135 |
137 ////////////////////////////////////////////////////////////////////////////// | 136 ////////////////////////////////////////////////////////////////////////////// |
138 | 137 |
139 GrFragmentProcessor* | 138 GrFragmentProcessor* |
140 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT
exture, | 139 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT
exture, |
141 SkYUVColorSpace colorSpace) { | 140 SkYUVColorSpace colorSpace) { |
142 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); | 141 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); |
143 } | 142 } |
OLD | NEW |