Make GrGLInterface a per-GrContext refcounted object rather than a global
Review URL: http://codereview.appspot.com/4901046/
git-svn-id: http://skia.googlecode.com/svn/trunk@2140 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLTexture.h b/gpu/src/GrGLTexture.h
index 6020928..b0dc368 100644
--- a/gpu/src/GrGLTexture.h
+++ b/gpu/src/GrGLTexture.h
@@ -20,11 +20,15 @@
class GrGLTexID : public GrRefCnt {
public:
- GrGLTexID(GrGLuint texID, bool ownsID) : fTexID(texID), fOwnsID(ownsID) {}
+ GrGLTexID(const GrGLInterface* gl, GrGLuint texID, bool ownsID)
+ : fGL(gl)
+ , fTexID(texID)
+ , fOwnsID(ownsID) {
+ }
virtual ~GrGLTexID() {
if (0 != fTexID && fOwnsID) {
- GR_GL(DeleteTextures(1, &fTexID));
+ GR_GL_CALL(fGL, DeleteTextures(1, &fTexID));
}
}
@@ -32,8 +36,9 @@
GrGLuint id() const { return fTexID; }
private:
- GrGLuint fTexID;
- bool fOwnsID;
+ const GrGLInterface* fGL;
+ GrGLuint fTexID;
+ bool fOwnsID;
};
////////////////////////////////////////////////////////////////////////////////
@@ -119,7 +124,7 @@
// and it is up to the GrGpuGL derivative to handle y-mirroing.
Orientation orientation() const { return fOrientation; }
- static const GrGLenum* WrapMode2GLWrap();
+ static const GrGLenum* WrapMode2GLWrap(GrGLBinding binding);
protected: