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

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

Issue 699943003: Move GrInvariantOutput out of GrProcessor and into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup Created 6 years, 1 month 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') | tests/GLProgramsTest.cpp » ('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
11 #include "GrCoordTransform.h" 11 #include "GrCoordTransform.h"
12 #include "GrInvariantOutput.h"
12 #include "GrProcessor.h" 13 #include "GrProcessor.h"
13 #include "gl/GrGLProcessor.h" 14 #include "gl/GrGLProcessor.h"
14 #include "GrTBackendProcessorFactory.h" 15 #include "GrTBackendProcessorFactory.h"
15 16
16 namespace { 17 namespace {
17 18
18 class YUVtoRGBEffect : public GrFragmentProcessor { 19 class YUVtoRGBEffect : public GrFragmentProcessor {
19 public: 20 public:
20 static GrFragmentProcessor* Create(GrTexture* yTexture, GrTexture* uTexture, 21 static GrFragmentProcessor* Create(GrTexture* yTexture, GrTexture* uTexture,
21 GrTexture* vTexture, SkYUVColorSpace colo rSpace) { 22 GrTexture* vTexture, SkYUVColorSpace colo rSpace) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 this->addTextureAccess(&fYAccess); 100 this->addTextureAccess(&fYAccess);
100 this->addTextureAccess(&fUAccess); 101 this->addTextureAccess(&fUAccess);
101 this->addTextureAccess(&fVAccess); 102 this->addTextureAccess(&fVAccess);
102 } 103 }
103 104
104 virtual bool onIsEqual(const GrFragmentProcessor& sBase) const { 105 virtual bool onIsEqual(const GrFragmentProcessor& sBase) const {
105 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>(); 106 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>();
106 return fColorSpace == s.getColorSpace(); 107 return fColorSpace == s.getColorSpace();
107 } 108 }
108 109
109 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 110 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE RRIDE {
110 // YUV is opaque 111 // YUV is opaque
111 inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A, 112 inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A,
112 InvariantOutput::kWillNot_ReadInput); 113 GrInvariantOutput::kWillNot_ReadInput);
113 } 114 }
114 115
115 GrCoordTransform fCoordTransform; 116 GrCoordTransform fCoordTransform;
116 GrTextureAccess fYAccess; 117 GrTextureAccess fYAccess;
117 GrTextureAccess fUAccess; 118 GrTextureAccess fUAccess;
118 GrTextureAccess fVAccess; 119 GrTextureAccess fVAccess;
119 SkYUVColorSpace fColorSpace; 120 SkYUVColorSpace fColorSpace;
120 121
121 typedef GrFragmentProcessor INHERITED; 122 typedef GrFragmentProcessor INHERITED;
122 }; 123 };
(...skipping 10 matching lines...) Expand all
133 0.0f, 0.0f, 0.0f, 1.0}; 134 0.0f, 0.0f, 0.0f, 1.0};
134 } 135 }
135 136
136 ////////////////////////////////////////////////////////////////////////////// 137 //////////////////////////////////////////////////////////////////////////////
137 138
138 GrFragmentProcessor* 139 GrFragmentProcessor*
139 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture, 140 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture,
140 SkYUVColorSpace colorSpace) { 141 SkYUVColorSpace colorSpace) {
141 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); 142 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace);
142 } 143 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698