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

Unified Diff: ui/gl/gl_context.h

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « ui/gl/gl_bindings_autogen_mock.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index 4577be31cc370673742358c8b76fe465bb15c702..95986613e0b7e3f1392f11dc70be8b6834f59538 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/cancellation_flag.h"
@@ -16,6 +17,10 @@
#include "ui/gl/gl_state_restorer.h"
#include "ui/gl/gpu_preference.h"
+namespace gpu {
+class GLContextVirtual;
+} // namespace gpu
+
namespace gfx {
class GLSurface;
@@ -130,6 +135,14 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// Returns the GL renderer string. The context must be current.
virtual std::string GetGLRenderer();
+ // Return a callback that, when called, indicates that the state the
+ // underlying context has been changed by code outside of the command buffer,
+ // and will need to be restored.
+ virtual base::Closure GetStateWasDirtiedExternallyCallback();
+
+ // Restore the context's state if it was dirtied by an external caller.
+ virtual void RestoreStateIfDirtiedExternally();
+
protected:
virtual ~GLContext();
@@ -159,20 +172,27 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
virtual void OnSetSwapInterval(int interval) = 0;
+ bool GetStateWasDirtiedExternally() const;
+ void SetStateWasDirtiedExternally(bool dirtied_externally);
+
private:
friend class base::RefCounted<GLContext>;
// For GetRealCurrent.
friend class VirtualGLApi;
+ friend class gpu::GLContextVirtual;
scoped_refptr<GLShareGroup> share_group_;
scoped_ptr<VirtualGLApi> virtual_gl_api_;
+ bool state_dirtied_externally_;
scoped_ptr<GLStateRestorer> state_restorer_;
scoped_ptr<GLVersionInfo> version_info_;
int swap_interval_;
bool force_swap_interval_zero_;
+ base::CancelableCallback<void()> state_dirtied_callback_;
+
DISALLOW_COPY_AND_ASSIGN(GLContext);
};
« no previous file with comments | « ui/gl/gl_bindings_autogen_mock.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698