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

Side by Side Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 19267016: Add a flag to allow renderer to use software compositor when GL compositor doesn't work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "cc/layers/content_layer.h" 8 #include "cc/layers/content_layer.h"
9 #include "cc/layers/heads_up_display_layer.h" 9 #include "cc/layers/heads_up_display_layer.h"
10 #include "cc/layers/io_surface_layer.h" 10 #include "cc/layers/io_surface_layer.h"
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 1568
1569 // Not reusing LayerTreeTest because it expects creating LTH to always succeed. 1569 // Not reusing LayerTreeTest because it expects creating LTH to always succeed.
1570 class LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface 1570 class LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface
1571 : public testing::Test, 1571 : public testing::Test,
1572 public FakeLayerTreeHostClient { 1572 public FakeLayerTreeHostClient {
1573 public: 1573 public:
1574 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface() 1574 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface()
1575 : FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D) {} 1575 : FakeLayerTreeHostClient(FakeLayerTreeHostClient::DIRECT_3D) {}
1576 1576
1577 // FakeLayerTreeHostClient implementation. 1577 // FakeLayerTreeHostClient implementation.
1578 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { 1578 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
1579 OVERRIDE {
1579 return scoped_ptr<OutputSurface>(); 1580 return scoped_ptr<OutputSurface>();
1580 } 1581 }
1581 1582
1582 void RunTest(bool threaded, 1583 void RunTest(bool threaded,
1583 bool delegating_renderer, 1584 bool delegating_renderer,
1584 bool impl_side_painting) { 1585 bool impl_side_painting) {
1585 scoped_ptr<base::Thread> impl_thread; 1586 scoped_ptr<base::Thread> impl_thread;
1586 if (threaded) { 1587 if (threaded) {
1587 impl_thread.reset(new base::Thread("LayerTreeTest")); 1588 impl_thread.reset(new base::Thread("LayerTreeTest"));
1588 ASSERT_TRUE(impl_thread->Start()); 1589 ASSERT_TRUE(impl_thread->Start());
1589 ASSERT_TRUE(impl_thread->message_loop_proxy().get()); 1590 ASSERT_TRUE(impl_thread->message_loop_proxy().get());
1590 } 1591 }
1591 1592
1592 LayerTreeSettings settings; 1593 LayerTreeSettings settings;
1593 settings.impl_side_painting = impl_side_painting; 1594 settings.impl_side_painting = impl_side_painting;
1594 scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::Create( 1595 scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::Create(
1595 this, 1596 this,
1596 settings, 1597 settings,
1597 impl_thread ? impl_thread->message_loop_proxy() : NULL); 1598 impl_thread ? impl_thread->message_loop_proxy() : NULL);
1598 EXPECT_FALSE(layer_tree_host); 1599 EXPECT_FALSE(layer_tree_host);
1599 } 1600 }
1600 }; 1601 };
1601 1602
1602 SINGLE_AND_MULTI_THREAD_TEST_F( 1603 SINGLE_AND_MULTI_THREAD_TEST_F(
1603 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); 1604 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface);
1604 1605
1605 } // namespace 1606 } // namespace
1606 } // namespace cc 1607 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698