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

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: Back to a single OffscreenContext class 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 f7d9ac01f6c36f808ffcfb8f79269f686cdcc265..d168e76179f0d88f0c733acb00e5c1f49c38f84a 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,31 @@ scoped_ptr<OutputSurface> FakeLayerImplTreeHostClient::createOutputSurface()
return FakeOutputSurface::Create3d(FakeWebGraphicsContext3D::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 = FakeWebGraphicsContext3D::Create(attrs).PassAs<WebKit::WebGraphicsContext3D>();
+ return m_offscreenContext3d.get();
+}
+
+GrContext* FakeLayerImplTreeHostClient::OffscreenGrContextForMainThread()
+{
+ return OffscreenGrContextForCompositorThread();
+}
+
+GrContext* FakeLayerImplTreeHostClient::OffscreenGrContextForCompositorThread()
+{
+ // TODO(danakj): Make a FakeGrContext.
+ return NULL;
+}
+
scoped_ptr<InputHandler> FakeLayerImplTreeHostClient::createInputHandler()
{
return scoped_ptr<InputHandler>();

Powered by Google App Engine
This is Rietveld 408576698