| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 fsBuilder->codeAppend(".r,\n\t\t"); | 65 fsBuilder->codeAppend(".r,\n\t\t"); |
| 66 fsBuilder->appendTextureLookup(samplers[2], coords[0].c_str(), coord
s[0].type()); | 66 fsBuilder->appendTextureLookup(samplers[2], coords[0].c_str(), coord
s[0].type()); |
| 67 fsBuilder->codeAppendf(".r,\n\t\t1.0) * %s;\n", yuvMatrix); | 67 fsBuilder->codeAppendf(".r,\n\t\t1.0) * %s;\n", yuvMatrix); |
| 68 } | 68 } |
| 69 | 69 |
| 70 typedef GrGLEffect INHERITED; | 70 typedef GrGLEffect INHERITED; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 YUVtoRGBEffect(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vTexture
) | 74 YUVtoRGBEffect(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vTexture
) |
| 75 : fCoordTransform(kLocal_GrCoordSet, MakeDivByTextureWHMatrix(yTexture), yTe
xture) | 75 : fCoordTransform(kLocal_GrCoordSet, GrCoordTransform::MakeDivByTextureWHMat
rix(yTexture), |
| 76 yTexture) |
| 76 , fYAccess(yTexture) | 77 , fYAccess(yTexture) |
| 77 , fUAccess(uTexture) | 78 , fUAccess(uTexture) |
| 78 , fVAccess(vTexture) { | 79 , fVAccess(vTexture) { |
| 79 this->addCoordTransform(&fCoordTransform); | 80 this->addCoordTransform(&fCoordTransform); |
| 80 this->addTextureAccess(&fYAccess); | 81 this->addTextureAccess(&fYAccess); |
| 81 this->addTextureAccess(&fUAccess); | 82 this->addTextureAccess(&fUAccess); |
| 82 this->addTextureAccess(&fVAccess); | 83 this->addTextureAccess(&fVAccess); |
| 83 this->setWillNotUseInputColor(); | 84 this->setWillNotUseInputColor(); |
| 84 } | 85 } |
| 85 | 86 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 98 typedef GrEffect INHERITED; | 99 typedef GrEffect INHERITED; |
| 99 }; | 100 }; |
| 100 | 101 |
| 101 } | 102 } |
| 102 | 103 |
| 103 ////////////////////////////////////////////////////////////////////////////// | 104 ////////////////////////////////////////////////////////////////////////////// |
| 104 | 105 |
| 105 GrEffect* GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrT
exture* vTexture) { | 106 GrEffect* GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrT
exture* vTexture) { |
| 106 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture); | 107 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture); |
| 107 } | 108 } |
| OLD | NEW |