Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: src/gpu/effects/GrYUVtoRGBEffect.cpp

Issue 648463003: FPs now use the correct builder types(just a rename) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 static const GrGLfloat kRec601ConversionMatrix[16]; 38 static const GrGLfloat kRec601ConversionMatrix[16];
39 39
40 // this class always generates the same code. 40 // this class always generates the same code.
41 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu ilder*) {} 41 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBu ilder*) {}
42 42
43 GLProcessor(const GrBackendProcessorFactory& factory, 43 GLProcessor(const GrBackendProcessorFactory& factory,
44 const GrProcessor&) 44 const GrProcessor&)
45 : INHERITED(factory) { 45 : INHERITED(factory) {
46 } 46 }
47 47
48 virtual void emitCode(GrGLProgramBuilder* builder, 48 virtual void emitCode(GrGLFPBuilder* builder,
49 const GrFragmentProcessor&, 49 const GrFragmentProcessor&,
50 const GrProcessorKey&, 50 const GrProcessorKey&,
51 const char* outputColor, 51 const char* outputColor,
52 const char* inputColor, 52 const char* inputColor,
53 const TransformedCoordsArray& coords, 53 const TransformedCoordsArray& coords,
54 const TextureSamplerArray& samplers) SK_OVERRIDE { 54 const TextureSamplerArray& samplers) SK_OVERRIDE {
55 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBui lder(); 55 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder ();
56 56
57 const char* yuvMatrix = NULL; 57 const char* yuvMatrix = NULL;
58 fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility, 58 fMatrixUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visib ility,
59 kMat44f_GrSLType, "YUVMatrix", 59 kMat44f_GrSLType, "YUVMatrix",
60 &yuvMatrix); 60 &yuvMatrix);
61 fsBuilder->codeAppendf("\t%s = vec4(\n\t\t", outputColor); 61 fsBuilder->codeAppendf("\t%s = vec4(\n\t\t", outputColor);
62 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coord s[0].getType()); 62 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coord s[0].getType());
63 fsBuilder->codeAppend(".r,\n\t\t"); 63 fsBuilder->codeAppend(".r,\n\t\t");
64 fsBuilder->appendTextureLookup(samplers[1], coords[0].c_str(), coord s[0].getType()); 64 fsBuilder->appendTextureLookup(samplers[1], coords[0].c_str(), coord s[0].getType());
65 fsBuilder->codeAppend(".r,\n\t\t"); 65 fsBuilder->codeAppend(".r,\n\t\t");
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 0.0f, 0.0f, 0.0f, 1.0}; 138 0.0f, 0.0f, 0.0f, 1.0};
139 } 139 }
140 140
141 ////////////////////////////////////////////////////////////////////////////// 141 //////////////////////////////////////////////////////////////////////////////
142 142
143 GrFragmentProcessor* 143 GrFragmentProcessor*
144 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture, 144 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture,
145 SkYUVColorSpace colorSpace) { 145 SkYUVColorSpace colorSpace) {
146 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); 146 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace);
147 } 147 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | src/gpu/gl/GrGLProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698