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 "GrYUVtoRGBEffect.h" | 8 #include "GrYUVtoRGBEffect.h" |
9 | 9 |
10 #include "GrCoordTransform.h" | 10 #include "GrCoordTransform.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 , fUAccess(uTexture) | 97 , fUAccess(uTexture) |
98 , fVAccess(vTexture) | 98 , fVAccess(vTexture) |
99 , fColorSpace(colorSpace) { | 99 , fColorSpace(colorSpace) { |
100 this->initClassID<YUVtoRGBEffect>(); | 100 this->initClassID<YUVtoRGBEffect>(); |
101 this->addCoordTransform(&fCoordTransform); | 101 this->addCoordTransform(&fCoordTransform); |
102 this->addTextureAccess(&fYAccess); | 102 this->addTextureAccess(&fYAccess); |
103 this->addTextureAccess(&fUAccess); | 103 this->addTextureAccess(&fUAccess); |
104 this->addTextureAccess(&fVAccess); | 104 this->addTextureAccess(&fVAccess); |
105 } | 105 } |
106 | 106 |
107 virtual bool onIsEqual(const GrFragmentProcessor& sBase) const { | 107 virtual bool onIsEqual(const GrFragmentProcessor& sBase) const SK_OVERRIDE { |
108 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>(); | 108 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>(); |
109 return fColorSpace == s.getColorSpace(); | 109 return fColorSpace == s.getColorSpace(); |
110 } | 110 } |
111 | 111 |
112 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { | 112 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
113 // YUV is opaque | 113 // YUV is opaque |
114 inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A, | 114 inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A, |
115 GrInvariantOutput::kWillNot_ReadInput); | 115 GrInvariantOutput::kWillNot_ReadInput); |
116 } | 116 } |
117 | 117 |
(...skipping 18 matching lines...) Expand all Loading... |
136 0.0f, 0.0f, 0.0f, 1.0}; | 136 0.0f, 0.0f, 0.0f, 1.0}; |
137 } | 137 } |
138 | 138 |
139 ////////////////////////////////////////////////////////////////////////////// | 139 ////////////////////////////////////////////////////////////////////////////// |
140 | 140 |
141 GrFragmentProcessor* | 141 GrFragmentProcessor* |
142 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT
exture, | 142 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT
exture, |
143 SkYUVColorSpace colorSpace) { | 143 SkYUVColorSpace colorSpace) { |
144 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); | 144 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); |
145 } | 145 } |
OLD | NEW |