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

Unified Diff: ui/gl/gl_context.h

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 10 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
Index: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index 2b4ec0e660920e68bead1121508f5ad90b57731b..5e48d2a3a217daa197acfa632a552bda17da33b7 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -15,6 +15,7 @@
#include "base/synchronization/cancellation_flag.h"
#include "ui/gl/gl_share_group.h"
#include "ui/gl/gl_state_restorer.h"
+#include "ui/gl/gl_surface.h"
#include "ui/gl/gpu_preference.h"
namespace gpu {
@@ -74,18 +75,21 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// Returns space separated list of extensions. The context must be current.
virtual std::string GetExtensions();
- // Indicate that it is safe to force this context to switch GPUs, since
+ // Indicates that it is safe to force this context to switch GPUs, since
// transitioning can cause corruption and hangs (OS X only).
virtual void SetSafeToForceGpuSwitch();
- // Attempt to force the context to move to the GPU of its sharegroup. Return
+ // Attempts to force the context to move to the GPU of its sharegroup. Return
// false only in the event of an unexpected error on the context.
virtual bool ForceGpuSwitchIfNeeded();
- // Indicate that the real context switches should unbind the FBO first
+ // Indicates that the real context switches should unbind the FBO first
// (For an Android work-around only).
virtual void SetUnbindFboOnMakeCurrent();
+ // Updates the shared context to a matched configuration.
+ virtual void UpdateSharedContext(GLContext* context);
+
// Returns whether the current context supports the named extension. The
// context must be current.
bool HasExtension(const char* name);
@@ -135,6 +139,8 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// Restore the context's state if it was dirtied by an external caller.
virtual void RestoreStateIfDirtiedExternally();
+ GLSurface::Format GetFormat() { return format_; }
+
protected:
virtual ~GLContext();
@@ -167,7 +173,9 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
bool GetStateWasDirtiedExternally() const;
void SetStateWasDirtiedExternally(bool dirtied_externally);
- private:
+ GLSurface::Format format_;
+
+private:
friend class base::RefCounted<GLContext>;
// For GetRealCurrent.

Powered by Google App Engine
This is Rietveld 408576698