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

Side by Side Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1215643006: more threading of GrShaderDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@GrShaderDataManager3
Patch Set: tweaks Created 5 years, 5 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/effects/SkArithmeticMode_gpu.h ('k') | src/effects/SkDisplacementMapEffect.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 2015 Google Inc. 2 * Copyright 2015 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 "SkArithmeticMode_gpu.h" 8 #include "SkArithmeticMode_gpu.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 private: 95 private:
96 GrGLProgramDataManager::UniformHandle fKUni; 96 GrGLProgramDataManager::UniformHandle fKUni;
97 bool fEnforcePMColor; 97 bool fEnforcePMColor;
98 98
99 typedef GrGLFragmentProcessor INHERITED; 99 typedef GrGLFragmentProcessor INHERITED;
100 }; 100 };
101 101
102 /////////////////////////////////////////////////////////////////////////////// 102 ///////////////////////////////////////////////////////////////////////////////
103 103
104 GrArithmeticFP::GrArithmeticFP(float k1, float k2, float k3, float k4, 104 GrArithmeticFP::GrArithmeticFP(GrShaderDataManager*, float k1, float k2, float k 3, float k4,
105 bool enforcePMColor, GrTexture* background) 105 bool enforcePMColor, GrTexture* background)
106 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) { 106 : fK1(k1), fK2(k2), fK3(k3), fK4(k4), fEnforcePMColor(enforcePMColor) {
107 this->initClassID<GrArithmeticFP>(); 107 this->initClassID<GrArithmeticFP>();
108 108
109 SkASSERT(background); 109 SkASSERT(background);
110 110
111 fBackgroundTransform.reset(kLocal_GrCoordSet, background, 111 fBackgroundTransform.reset(kLocal_GrCoordSet, background,
112 GrTextureParams::kNone_FilterMode); 112 GrTextureParams::kNone_FilterMode);
113 this->addCoordTransform(&fBackgroundTransform); 113 this->addCoordTransform(&fBackgroundTransform);
114 fBackgroundAccess.reset(background); 114 fBackgroundAccess.reset(background);
(...skipping 27 matching lines...) Expand all
142 GrFragmentProcessor* GrArithmeticFP::TestCreate(SkRandom* rand, 142 GrFragmentProcessor* GrArithmeticFP::TestCreate(SkRandom* rand,
143 GrContext*, 143 GrContext*,
144 const GrCaps&, 144 const GrCaps&,
145 GrTexture* textures[]) { 145 GrTexture* textures[]) {
146 float k1 = rand->nextF(); 146 float k1 = rand->nextF();
147 float k2 = rand->nextF(); 147 float k2 = rand->nextF();
148 float k3 = rand->nextF(); 148 float k3 = rand->nextF();
149 float k4 = rand->nextF(); 149 float k4 = rand->nextF();
150 bool enforcePMColor = rand->nextBool(); 150 bool enforcePMColor = rand->nextBool();
151 151
152 return SkNEW_ARGS(GrArithmeticFP, (k1, k2, k3, k4, enforcePMColor, textures[ 0])); 152 GrShaderDataManager shaderDataManager;
153 return SkNEW_ARGS(GrArithmeticFP, (&shaderDataManager, k1, k2, k3, k4, enfor cePMColor,
154 textures[0]));
153 } 155 }
154 156
155 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP); 157 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrArithmeticFP);
156 158
157 /////////////////////////////////////////////////////////////////////////////// 159 ///////////////////////////////////////////////////////////////////////////////
158 // Xfer Processor 160 // Xfer Processor
159 /////////////////////////////////////////////////////////////////////////////// 161 ///////////////////////////////////////////////////////////////////////////////
160 162
161 class ArithmeticXP : public GrXferProcessor { 163 class ArithmeticXP : public GrXferProcessor {
162 public: 164 public:
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 float k1 = random->nextF(); 312 float k1 = random->nextF();
311 float k2 = random->nextF(); 313 float k2 = random->nextF();
312 float k3 = random->nextF(); 314 float k3 = random->nextF();
313 float k4 = random->nextF(); 315 float k4 = random->nextF();
314 bool enforcePMColor = random->nextBool(); 316 bool enforcePMColor = random->nextBool();
315 317
316 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor); 318 return GrArithmeticXPFactory::Create(k1, k2, k3, k4, enforcePMColor);
317 } 319 }
318 320
319 #endif 321 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.h ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698