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

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

Issue 1333273003: Start trying to collapse path program stuff (Closed) Base URL: https://skia.googlesource.com/skia.git@removebt
Patch Set: windows Created 5 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/gl/GrGLPathProgramDataManager.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.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
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this 65 GrPrimitiveProcessor parameter is guaranteed to be of the same type that created this
66 GrGLPrimitiveProcessor and to have an identical processor key as the one that created this 66 GrGLPrimitiveProcessor and to have an identical processor key as the one that created this
67 GrGLPrimitiveProcessor. */ 67 GrGLPrimitiveProcessor. */
68 virtual void setData(const GrGLProgramDataManager&, const GrPrimitiveProcess or&) = 0; 68 virtual void setData(const GrGLProgramDataManager&, const GrPrimitiveProcess or&) = 0;
69 69
70 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&); 70 static SkMatrix GetTransformMatrix(const SkMatrix& localMatrix, const GrCoor dTransform&);
71 71
72 protected: 72 protected:
73 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan dle* colorUniform); 73 void setupUniformColor(GrGLGPBuilder* pb, const char* outputName, UniformHan dle* colorUniform);
74 74
75 class ShaderVarHandle {
76 public:
77 bool isValid() const { return fHandle > -1; }
78 ShaderVarHandle() : fHandle(-1) {}
79 ShaderVarHandle(int value) : fHandle(value) { SkASSERT(this->isValid()); }
80 int handle() const { SkASSERT(this->isValid()); return fHandle; }
81 UniformHandle convertToUniformHandle() {
82 SkASSERT(this->isValid());
83 return GrGLProgramDataManager::UniformHandle::CreateFromUniformIndex (fHandle);
84 }
85 SeparableVaryingHandle convertToSeparableVaryingHandle() {
86 SkASSERT(this->isValid());
87 return SeparableVaryingHandle::CreateFromSeparableVaryingIndex(fHand le);
88 }
89
90 private:
91 int fHandle;
92 };
93
94 struct Transform { 75 struct Transform {
95 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); } 76 Transform() : fType(kVoid_GrSLType) { fCurrentValue = SkMatrix::InvalidM atrix(); }
96 ShaderVarHandle fHandle; 77 GrGLProgramDataManager::UniformHandle fHandle;
97 SkMatrix fCurrentValue; 78 SkMatrix fCurrentValue;
98 GrSLType fType; 79 GrSLType fType;
99 }; 80 };
100 81
101 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms; 82 SkSTArray<8, SkSTArray<2, Transform, true> > fInstalledTransforms;
102 }; 83 };
103 84
104 #endif 85 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathProgramDataManager.cpp ('k') | src/gpu/gl/GrGLProgramDataManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698