#ifndef UI_GL_SCOPED_MAKE_CURRENT_H_
#define UI_GL_SCOPED_MAKE_CURRENT_H_
#include "base/memory/scoped_refptr.h"
#include "ui/gl/gl_export.h"
namespace gl {
class GLContext;
class GLSurface;
}
namespace ui {
class GL_EXPORT ScopedMakeCurrent {
public:
ScopedMakeCurrent(gl::GLContext* context, gl::GLSurface* surface);
ScopedMakeCurrent(const ScopedMakeCurrent&) = delete;
ScopedMakeCurrent& operator=(const ScopedMakeCurrent&) = delete;
~ScopedMakeCurrent();
bool IsContextCurrent() { return is_context_current_; }
private:
scoped_refptr<gl::GLContext> previous_context_;
scoped_refptr<gl::GLSurface> previous_surface_;
scoped_refptr<gl::GLContext> context_;
scoped_refptr<gl::GLSurface> surface_;
bool is_context_current_ = false;
};
}
#endif