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

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

Issue 2329553002: Cleanup GPU gamut transformation code (Closed)
Patch Set: Switch from float[16] to SkMatrix44 Created 4 years, 3 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/GrBicubicEffect.cpp ('k') | src/gpu/glsl/GrGLSLColorSpaceXformHelper.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 2012 Google Inc. 2 * Copyright 2012 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 "GrSimpleTextureEffect.h" 8 #include "GrSimpleTextureEffect.h"
9 #include "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 22 matching lines...) Expand all
33 static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&, 33 static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&,
34 GrProcessorKeyBuilder* b) { 34 GrProcessorKeyBuilder* b) {
35 const GrSimpleTextureEffect& textureEffect = effect.cast<GrSimpleTexture Effect>(); 35 const GrSimpleTextureEffect& textureEffect = effect.cast<GrSimpleTexture Effect>();
36 b->add32(GrColorSpaceXform::XformKey(textureEffect.colorSpaceXform())); 36 b->add32(GrColorSpaceXform::XformKey(textureEffect.colorSpaceXform()));
37 } 37 }
38 38
39 protected: 39 protected:
40 void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& pro cessor) override { 40 void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& pro cessor) override {
41 const GrSimpleTextureEffect& textureEffect = processor.cast<GrSimpleText ureEffect>(); 41 const GrSimpleTextureEffect& textureEffect = processor.cast<GrSimpleText ureEffect>();
42 if (SkToBool(textureEffect.colorSpaceXform())) { 42 if (SkToBool(textureEffect.colorSpaceXform())) {
43 pdman.setMatrix4f(fColorSpaceXformUni, textureEffect.colorSpaceXform ()->srcToDst()); 43 pdman.setSkMatrix44(fColorSpaceXformUni, textureEffect.colorSpaceXfo rm()->srcToDst());
44 } 44 }
45 } 45 }
46 46
47 private: 47 private:
48 typedef GrGLSLFragmentProcessor INHERITED; 48 typedef GrGLSLFragmentProcessor INHERITED;
49 49
50 UniformHandle fColorSpaceXformUni; 50 UniformHandle fColorSpaceXformUni;
51 }; 51 };
52 52
53 /////////////////////////////////////////////////////////////////////////////// 53 ///////////////////////////////////////////////////////////////////////////////
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 static const GrCoordSet kCoordSets[] = { 87 static const GrCoordSet kCoordSets[] = {
88 kLocal_GrCoordSet, 88 kLocal_GrCoordSet,
89 kDevice_GrCoordSet 89 kDevice_GrCoordSet
90 }; 90 };
91 GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kC oordSets))]; 91 GrCoordSet coordSet = kCoordSets[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kC oordSets))];
92 92
93 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); 93 const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
94 return GrSimpleTextureEffect::Make(d->fTextures[texIdx], nullptr, matrix, co ordSet); 94 return GrSimpleTextureEffect::Make(d->fTextures[texIdx], nullptr, matrix, co ordSet);
95 } 95 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.cpp ('k') | src/gpu/glsl/GrGLSLColorSpaceXformHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698