summaryrefslogtreecommitdiff
path: root/chromium/ui
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-10-24 18:26:59 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-06-04 18:10:21 +0200
commit743758ab8a8af172fe8d20b27f53e244ffb8fc05 (patch)
treeac6f0730e3905ef0e94be350f1aed06d197c9872 /chromium/ui
parentbf1fb16eebf9ca9e29acfa63b42e68c6e96abdf9 (diff)
downloadqtwebengine-chromium-743758ab8a8af172fe8d20b27f53e244ffb8fc05.tar.gz
<chromium> Add seams to setup GL contexts sharing with QtQuick.
This will allow us to know right before the first GL context is instantiated by Chromium so that we can install those contexts to be shared with QtQuick GL contexts as well. Change-Id: Id55337a7b42d25ac084698a23dbfab06cb273505 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/ui')
-rw-r--r--chromium/ui/gl/gl_share_group.cc3
-rw-r--r--chromium/ui/gl/gl_share_group.h7
2 files changed, 8 insertions, 2 deletions
diff --git a/chromium/ui/gl/gl_share_group.cc b/chromium/ui/gl/gl_share_group.cc
index 8e8958b49a4..347873dc3ab 100644
--- a/chromium/ui/gl/gl_share_group.cc
+++ b/chromium/ui/gl/gl_share_group.cc
@@ -18,6 +18,9 @@ GLShareGroup::GLShareGroup()
}
void GLShareGroup::AddContext(GLContext* context) {
+ if (contexts_.empty())
+ AboutToAddFirstContext();
+
contexts_.insert(context);
}
diff --git a/chromium/ui/gl/gl_share_group.h b/chromium/ui/gl/gl_share_group.h
index 1deed63c541..f1b03690f34 100644
--- a/chromium/ui/gl/gl_share_group.h
+++ b/chromium/ui/gl/gl_share_group.h
@@ -31,7 +31,7 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
// Returns a pointer to any initialized context in the share group
// or NULL if there are no initialized contexts in the share group.
- GLContext* GetContext();
+ virtual GLContext* GetContext();
// Sets and returns the unique shared GL context. Used for context
// virtualization.
@@ -45,10 +45,13 @@ class GL_EXPORT GLShareGroup : public base::RefCounted<GLShareGroup> {
int GetRendererID();
#endif
+ protected:
+ virtual ~GLShareGroup();
+ virtual void AboutToAddFirstContext() { }
+
private:
friend class base::RefCounted<GLShareGroup>;
- ~GLShareGroup();
// References to GLContext are by raw pointer to avoid a reference count
// cycle.