summaryrefslogtreecommitdiffstats
path: root/cc/test/test_web_graphics_context_3d.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 20:32:05 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-22 20:32:05 +0000
commit0a4517266a77d10a276d6c674efafc79e4c7f7a5 (patch)
tree88b095919aa268128698e980d9b780b09f839aad /cc/test/test_web_graphics_context_3d.h
parent3395887c69c58e75b084ef919dc88fd037bb9bc0 (diff)
downloadchromium_src-0a4517266a77d10a276d6c674efafc79e4c7f7a5.zip
chromium_src-0a4517266a77d10a276d6c674efafc79e4c7f7a5.tar.gz
chromium_src-0a4517266a77d10a276d6c674efafc79e4c7f7a5.tar.bz2
cc: Route offscreen context creation for compositor to the browser.
Currently the compositor asks WebKit for the SharedGraphicsContext. For the browser compositor, we instead route requests for an offscreen context to ui/compositor, where we are able to create the context. This patch only addresses offscreen contexts for the browser compositor. The renderer compositor still gets its contexts from WebKit, but now via the LayerTreeHostClient interface instead of directly going to the WebSharedGraphicsContext3D. Tested by the lost context unit tests. They now test that on context loss, the shared context is also recreated, and that if it fails to be recreated that we retry context creation. BUG=169373,175383 Review URL: https://chromiumcodereview.appspot.com/12212007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_web_graphics_context_3d.h')
-rw-r--r--cc/test/test_web_graphics_context_3d.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h
index abfd9c9..212da16 100644
--- a/cc/test/test_web_graphics_context_3d.h
+++ b/cc/test/test_web_graphics_context_3d.h
@@ -122,6 +122,11 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
have_extension_egl_image_ = have;
}
+ // When this context is lost, all contexts in its share group are also lost.
+ void add_share_group_context(WebKit::WebGraphicsContext3D* context3d) {
+ shared_contexts_.push_back(context3d);
+ }
+
static const WebKit::WebGLId kExternalTextureId;
virtual WebKit::WebGLId NextTextureId();
@@ -142,6 +147,7 @@ class TestWebGraphicsContext3D : public FakeWebGraphicsContext3D {
WebGraphicsContextLostCallback* context_lost_callback_;
std::vector<WebKit::WebGLId> textures_;
base::hash_set<WebKit::WebGLId> used_textures_;
+ std::vector<WebKit::WebGraphicsContext3D*> shared_contexts_;
int width_;
int height_;
};