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

Unified Diff: src/gpu/gl/GrGLProgramDataManager.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLPrimitiveProcessor.h ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDataManager.h
diff --git a/src/gpu/gl/GrGLProgramDataManager.h b/src/gpu/gl/GrGLProgramDataManager.h
index 644ba951c4a5f68dd84dcb8952de6bf8f9c36900..7931768ddb56a8bb7b260fcad0946a269705a254 100644
--- a/src/gpu/gl/GrGLProgramDataManager.h
+++ b/src/gpu/gl/GrGLProgramDataManager.h
@@ -24,38 +24,29 @@ class GrGLProgramBuilder;
*/
class GrGLProgramDataManager : SkNoncopyable {
public:
- // Opaque handle to a uniform
+ // Opaque handle to a resource
class ShaderResourceHandle {
public:
- bool isValid() const { return -1 != fValue; }
- ShaderResourceHandle()
- : fValue(-1) {
- }
- protected:
ShaderResourceHandle(int value)
: fValue(value) {
- SkASSERT(isValid());
+ SkASSERT(this->isValid());
}
- int fValue;
- };
- class UniformHandle : public ShaderResourceHandle {
- public:
- /** Creates a reference to an unifrom of a GrGLShaderBuilder.
- * The ref can be used to set the uniform with corresponding the GrGLProgramDataManager.*/
- static UniformHandle CreateFromUniformIndex(int i);
- UniformHandle() { }
- bool operator==(const UniformHandle& other) const { return other.fValue == fValue; }
- private:
- UniformHandle(int value) : ShaderResourceHandle(value) { }
- int toProgramDataIndex() const { SkASSERT(isValid()); return fValue; }
- int toShaderBuilderIndex() const { return toProgramDataIndex(); }
+ ShaderResourceHandle()
+ : fValue(kInvalid_ShaderResourceHandle) {
+ }
+
+ bool operator==(const ShaderResourceHandle& other) const { return other.fValue == fValue; }
+ bool isValid() const { return kInvalid_ShaderResourceHandle != fValue; }
+ int toIndex() const { SkASSERT(this->isValid()); return fValue; }
- friend class GrGLProgramDataManager; // For accessing toProgramDataIndex().
- friend class GrGLProgramBuilder; // For accessing toShaderBuilderIndex().
- friend class GrGLGeometryProcessor;
+ private:
+ static const int kInvalid_ShaderResourceHandle = -1;
+ int fValue;
};
+ typedef ShaderResourceHandle UniformHandle;
+
struct UniformInfo {
GrGLShaderVar fVariable;
uint32_t fVisibility;
« no previous file with comments | « src/gpu/gl/GrGLPrimitiveProcessor.h ('k') | src/gpu/gl/GrGLProgramDataManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698