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

Unified Diff: cc/test/layer_tree_test_common.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: Restart with GrContext owned in cc 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/layer_tree_test_common.cc
diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc
index 052fef3746f8cf64ef5a9524f8d141e90a7caf7e..166a6d6b53ad9f152765856ae13b217a67e6742e 100644
--- a/cc/test/layer_tree_test_common.cc
+++ b/cc/test/layer_tree_test_common.cc
@@ -29,6 +29,10 @@ using namespace WebKit;
namespace cc {
+TestHooks::TestHooks() { }
+
+TestHooks::~TestHooks() { }
+
bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*, LayerTreeHostImpl::FrameData&, bool)
{
return true;
@@ -44,6 +48,21 @@ scoped_ptr<OutputSurface> TestHooks::createOutputSurface()
return createFakeOutputSurface();
}
+WebKit::WebGraphicsContext3D* TestHooks::OffscreenContext3dForMainThread()
+{
+ return OffscreenContext3dForCompositorThread();
+}
+
+WebKit::WebGraphicsContext3D* TestHooks::OffscreenContext3dForCompositorThread()
+{
+ if (m_offscreenContext3d)
+ return m_offscreenContext3d.get();
+
+ WebKit::WebGraphicsContext3D::Attributes attrs;
+ m_offscreenContext3d = FakeWebGraphicsContext3D::Create(attrs).PassAs<WebKit::WebGraphicsContext3D>();
+ return m_offscreenContext3d.get();
+}
+
scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testHooks, const LayerTreeSettings& settings, LayerTreeHostImplClient* client, Proxy* proxy)
{
return make_scoped_ptr(new MockLayerTreeHostImpl(testHooks, settings, client, proxy));
@@ -199,6 +218,21 @@ public:
m_testHooks->didRecreateOutputSurface(succeeded);
}
+ virtual void willRetryRecreateOutputSurface() OVERRIDE
+ {
+ m_testHooks->willRetryRecreateOutputSurface();
+ }
+
+ virtual WebKit::WebGraphicsContext3D* OffscreenContext3dForMainThread() OVERRIDE
+ {
+ return m_testHooks->OffscreenContext3dForMainThread();
+ }
+
+ virtual WebKit::WebGraphicsContext3D* OffscreenContext3dForCompositorThread() OVERRIDE
+ {
+ return m_testHooks->OffscreenContext3dForCompositorThread();
+ }
+
virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE
{
return scoped_ptr<InputHandler>();
@@ -318,8 +352,6 @@ void ThreadedTest::doBeginTest()
if (m_endWhenBeginReturns)
realEndTest();
- LayerTreeHost::setNeedsFilterContext(false);
-
// Allow commits to happen once beginTest() has had a chance to post tasks
// so that those tasks will happen before the first commit.
if (m_layerTreeHost)

Powered by Google App Engine
This is Rietveld 408576698