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

Side by Side Diff: src/gpu/gl/GrGLPrimitiveProcessor.h

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 6 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/gl/GrGLPathProgramDataManager.cpp ('k') | src/gpu/gl/GrGLProgram.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 2013 Google Inc. 2 * Copyright 2013 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 #ifndef GrGLPrimitiveProcessor_DEFINED 8 #ifndef GrGLPrimitiveProcessor_DEFINED
9 #define GrGLPrimitiveProcessor_DEFINED 9 #define GrGLPrimitiveProcessor_DEFINED
10 10
11 #include "GrPrimitiveProcessor.h" 11 #include "GrPrimitiveProcessor.h"
12 #include "GrGLProcessor.h" 12 #include "GrGLProcessor.h"
13 #include "GrGLPathProgramDataManager.h"
13 14
14 class GrBatchTracker; 15 class GrBatchTracker;
15 class GrPrimitiveProcessor; 16 class GrPrimitiveProcessor;
16 class GrGLGPBuilder; 17 class GrGLGPBuilder;
17 18
18 class GrGLPrimitiveProcessor { 19 class GrGLPrimitiveProcessor {
19 public: 20 public:
20 virtual ~GrGLPrimitiveProcessor() {} 21 virtual ~GrGLPrimitiveProcessor() {}
21 22
22 typedef GrGLProgramDataManager::UniformHandle UniformHandle; 23 typedef GrGLProgramDataManager::UniformHandle UniformHandle;
24 typedef GrGLPathProgramDataManager::SeparableVaryingHandle SeparableVaryingH andle;
23 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray; 25 typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
24 26
25 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords; 27 typedef SkSTArray<2, const GrCoordTransform*, true> ProcCoords;
26 typedef SkSTArray<8, ProcCoords> TransformsIn; 28 typedef SkSTArray<8, ProcCoords> TransformsIn;
27 typedef SkSTArray<8, GrGLProcessor::TransformedCoordsArray> TransformsOut; 29 typedef SkSTArray<8, GrGLProcessor::TransformedCoordsArray> TransformsOut;
28 30
29 struct EmitArgs { 31 struct EmitArgs {
30 EmitArgs(GrGLGPBuilder* pb, 32 EmitArgs(GrGLGPBuilder* pb,
31 const GrPrimitiveProcessor& gp, 33 const GrPrimitiveProcessor& gp,
32 const GrBatchTracker& bt, 34 const GrBatchTracker& bt,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 class ShaderVarHandle { 80 class ShaderVarHandle {
79 public: 81 public:
80 bool isValid() const { return fHandle > -1; } 82 bool isValid() const { return fHandle > -1; }
81 ShaderVarHandle() : fHandle(-1) {} 83 ShaderVarHandle() : fHandle(-1) {}
82 ShaderVarHandle(int value) : fHandle(value) { SkASSERT(this->isValid()); } 84 ShaderVarHandle(int value) : fHandle(value) { SkASSERT(this->isValid()); }
83 int handle() const { SkASSERT(this->isValid()); return fHandle; } 85 int handle() const { SkASSERT(this->isValid()); return fHandle; }
84 UniformHandle convertToUniformHandle() { 86 UniformHandle convertToUniformHandle() {
85 SkASSERT(this->isValid()); 87 SkASSERT(this->isValid());
86 return GrGLProgramDataManager::UniformHandle::CreateFromUniformIndex (fHandle); 88 return GrGLProgramDataManager::UniformHandle::CreateFromUniformIndex (fHandle);
87 } 89 }
90 SeparableVaryingHandle convertToSeparableVaryingHandle() {
91 SkASSERT(this->isValid());
92 return SeparableVaryingHandle::CreateFromSeparableVaryingIndex(fHand le);
93 }
88 94
89 private: 95 private:
90 int fHandle; 96 int fHandle;
91 }; 97 };
92 98
93 struct Transform { 99 struct Transform {
94 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } 100 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); }
95 ShaderVarHandle fHandle; 101 ShaderVarHandle fHandle;
96 SkMatrix fCurrentValue; 102 SkMatrix fCurrentValue;
97 GrSLType fType; 103 GrSLType fType;
98 }; 104 };
99 105
100 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; 106 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms;
101 }; 107 };
102 108
103 #endif 109 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathProgramDataManager.cpp ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698