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

Unified Diff: src/gpu/glsl/GrGLSLProgramDataManager.h

Issue 1955893002: Allow gpu ResourceHandle class to be shared for multiple purposes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/GrResourceHandle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLProgramDataManager.h
diff --git a/src/gpu/glsl/GrGLSLProgramDataManager.h b/src/gpu/glsl/GrGLSLProgramDataManager.h
index e578e11808868163ce18c41e0093601f78d025bf..5d502cfd7591dcf271a0c65062d26dfcfd4954c0 100644
--- a/src/gpu/glsl/GrGLSLProgramDataManager.h
+++ b/src/gpu/glsl/GrGLSLProgramDataManager.h
@@ -8,6 +8,7 @@
#ifndef GrGLSLProgramDataManager_DEFINED
#define GrGLSLProgramDataManager_DEFINED
+#include "GrResourceHandle.h"
#include "SkTypes.h"
class SkMatrix;
@@ -18,28 +19,7 @@ class SkMatrix;
*/
class GrGLSLProgramDataManager : SkNoncopyable {
public:
- // Opaque handle to a resource
- class ShaderResourceHandle {
- public:
- ShaderResourceHandle(int value)
- : fValue(value) {
- SkASSERT(this->isValid());
- }
-
- 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; }
-
- private:
- static const int kInvalid_ShaderResourceHandle = -1;
- int fValue;
- };
-
- typedef ShaderResourceHandle UniformHandle;
+ GR_DEFINE_RESOURCE_HANDLE_CLASS(UniformHandle);
virtual ~GrGLSLProgramDataManager() {}
@@ -67,7 +47,7 @@ public:
void setSkMatrix(UniformHandle, const SkMatrix&) const;
// for nvpr only
- typedef ShaderResourceHandle VaryingHandle;
+ GR_DEFINE_RESOURCE_HANDLE_CLASS(VaryingHandle);
virtual void setPathFragmentInputTransform(VaryingHandle u, int components,
const SkMatrix& matrix) const = 0;
@@ -75,7 +55,6 @@ protected:
GrGLSLProgramDataManager() {}
private:
-
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « src/gpu/GrResourceHandle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698