diff options
Diffstat (limited to 'ui/gl/scoped_binders.h')
-rw-r--r-- | ui/gl/scoped_binders.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ui/gl/scoped_binders.h b/ui/gl/scoped_binders.h index c133673..dab7b31 100644 --- a/ui/gl/scoped_binders.h +++ b/ui/gl/scoped_binders.h @@ -5,9 +5,11 @@ #ifndef UI_GL_SCOPED_BINDERS_H_ #define UI_GL_SCOPED_BINDERS_H_ +#include "base/basictypes.h" #include "ui/gl/gl_export.h" -namespace ui { +namespace gfx { +class GLStateRestorer; class GL_EXPORT ScopedFrameBufferBinder { public: @@ -15,19 +17,34 @@ class GL_EXPORT ScopedFrameBufferBinder { ~ScopedFrameBufferBinder(); private: + // Whenever possible we prefer to use the current GLContext's + // GLStateRestorer to maximize driver compabitility. + GLStateRestorer* state_restorer_; + + // Failing that we use GL calls to save and restore state. int old_fbo_; + + DISALLOW_COPY_AND_ASSIGN(ScopedFrameBufferBinder); }; + class GL_EXPORT ScopedTextureBinder { public: ScopedTextureBinder(unsigned int target, unsigned int id); ~ScopedTextureBinder(); private: + // Whenever possible we prefer to use the current GLContext's + // GLStateRestorer to maximize driver compabitility. + GLStateRestorer* state_restorer_; + + // Failing that we use GL calls to save and restore state. int target_; int old_id_; + + DISALLOW_COPY_AND_ASSIGN(ScopedTextureBinder); }; -} // namespace ui +} // namespace gfx #endif // UI_GL_SCOPED_BINDERS_H_ |