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

Unified Diff: cc/test/fake_layer_tree_host_client.cc

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the GrContextProvider::ScopedContexts guard classes Created 7 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: cc/test/fake_layer_tree_host_client.cc
diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc
index 077cf18b520048cf450611476f2d44877a2d392c..92ab6d809f0e592df6e2f6c515fc7e6e42317c5b 100644
--- a/cc/test/fake_layer_tree_host_client.cc
+++ b/cc/test/fake_layer_tree_host_client.cc
@@ -6,6 +6,14 @@
namespace cc {
+FakeLayerImplTreeHostClient::FakeLayerImplTreeHostClient(bool useSoftwareRendering, bool useDelegatingRenderer)
+ : m_useSoftwareRendering(useSoftwareRendering)
+ , m_useDelegatingRenderer(useDelegatingRenderer)
+{
+}
+
+FakeLayerImplTreeHostClient::~FakeLayerImplTreeHostClient() { }
+
scoped_ptr<OutputSurface> FakeLayerImplTreeHostClient::createOutputSurface()
{
if (m_useSoftwareRendering) {
@@ -22,6 +30,36 @@ scoped_ptr<OutputSurface> FakeLayerImplTreeHostClient::createOutputSurface()
return FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create(attrs).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>();
}
+WebKit::WebGraphicsContext3D* FakeLayerImplTreeHostClient::OffscreenContext3dForMainThread() {
+ return OffscreenContext3dForCompositorThread();
+}
+
+WebKit::WebGraphicsContext3D* FakeLayerImplTreeHostClient::OffscreenContext3dForCompositorThread()
+{
+ if (m_offscreenContext3d)
+ return m_offscreenContext3d.get();
+
+ WebKit::WebGraphicsContext3D::Attributes attrs;
+ m_offscreenContext3d = TestWebGraphicsContext3D::Create(attrs).PassAs<WebKit::WebGraphicsContext3D>();
+ return m_offscreenContext3d.get();
+}
+
+GrContext* FakeLayerImplTreeHostClient::OffscreenGrContextForMainThread()
+{
+ return OffscreenGrContextForCompositorThread();
+}
+
+GrContext* FakeLayerImplTreeHostClient::OffscreenGrContextForCompositorThread()
+{
+ // TODO(danakj): Make a FakeGrContext.
+ return NULL;
+}
+
+void FakeLayerImplTreeHostClient::DestroyOffscreenContext3dForCompositorThread() {
+ // TODO(danakj): Kill the GrContext.
+ m_offscreenContext3d.reset();
+}
+
scoped_ptr<InputHandler> FakeLayerImplTreeHostClient::createInputHandler()
{
return scoped_ptr<InputHandler>();

Powered by Google App Engine
This is Rietveld 408576698