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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter 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') | tests/GpuColorFilterTest.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
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 virtual bool onIsEqual(const GrProcessor& sBase) const { 105 virtual bool onIsEqual(const GrProcessor& sBase) const {
106 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>(); 106 const YUVtoRGBEffect& s = sBase.cast<YUVtoRGBEffect>();
107 return fYAccess.getTexture() == s.fYAccess.getTexture() && 107 return fYAccess.getTexture() == s.fYAccess.getTexture() &&
108 fUAccess.getTexture() == s.fUAccess.getTexture() && 108 fUAccess.getTexture() == s.fUAccess.getTexture() &&
109 fVAccess.getTexture() == s.fVAccess.getTexture() && 109 fVAccess.getTexture() == s.fVAccess.getTexture() &&
110 fColorSpace == s.getColorSpace(); 110 fColorSpace == s.getColorSpace();
111 } 111 }
112 112
113 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 113 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
114 // YUV is opaque 114 // YUV is opaque
115 inout->fColor = 0xFF; 115 inout->setToOther(kA_GrColorComponentFlag, 0xFF << GrColor_SHIFT_A);
116 inout->fValidFlags = kA_GrColorComponentFlag;
117 inout->fIsSingleComponent = false;
118 } 116 }
119 117
120 GrCoordTransform fCoordTransform; 118 GrCoordTransform fCoordTransform;
121 GrTextureAccess fYAccess; 119 GrTextureAccess fYAccess;
122 GrTextureAccess fUAccess; 120 GrTextureAccess fUAccess;
123 GrTextureAccess fVAccess; 121 GrTextureAccess fVAccess;
124 SkYUVColorSpace fColorSpace; 122 SkYUVColorSpace fColorSpace;
125 123
126 typedef GrFragmentProcessor INHERITED; 124 typedef GrFragmentProcessor INHERITED;
127 }; 125 };
(...skipping 10 matching lines...) Expand all
138 0.0f, 0.0f, 0.0f, 1.0}; 136 0.0f, 0.0f, 0.0f, 1.0};
139 } 137 }
140 138
141 ////////////////////////////////////////////////////////////////////////////// 139 //////////////////////////////////////////////////////////////////////////////
142 140
143 GrFragmentProcessor* 141 GrFragmentProcessor*
144 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture, 142 GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vT exture,
145 SkYUVColorSpace colorSpace) { 143 SkYUVColorSpace colorSpace) {
146 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace); 144 return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture, colorSpace);
147 } 145 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureDomain.cpp ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698