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

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

Issue 17550008: Make IsSolidColor() a property on CC scrollbar layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use DCHECK(layer_tree_host()) instead. 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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 io_surface_->SetIOSurfaceProperties(1, gfx::Size(10, 10)); 1168 io_surface_->SetIOSurfaceProperties(1, gfx::Size(10, 10));
1169 root_->AddChild(io_surface_); 1169 root_->AddChild(io_surface_);
1170 } 1170 }
1171 1171
1172 // Enable the hud. 1172 // Enable the hud.
1173 LayerTreeDebugState debug_state; 1173 LayerTreeDebugState debug_state;
1174 debug_state.show_property_changed_rects = true; 1174 debug_state.show_property_changed_rects = true;
1175 layer_tree_host()->SetDebugState(debug_state); 1175 layer_tree_host()->SetDebugState(debug_state);
1176 1176
1177 scoped_refptr<ScrollbarLayer> scrollbar_ = ScrollbarLayer::Create( 1177 scoped_refptr<ScrollbarLayer> scrollbar_ = ScrollbarLayer::Create(
1178 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), 1178 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content_->id(), false);
1179 content_->id());
1180 scrollbar_->SetBounds(gfx::Size(10, 10)); 1179 scrollbar_->SetBounds(gfx::Size(10, 10));
1181 scrollbar_->SetAnchorPoint(gfx::PointF()); 1180 scrollbar_->SetAnchorPoint(gfx::PointF());
1182 scrollbar_->SetIsDrawable(true); 1181 scrollbar_->SetIsDrawable(true);
1183 root_->AddChild(scrollbar_); 1182 root_->AddChild(scrollbar_);
1184 1183
1185 layer_tree_host()->SetRootLayer(root_); 1184 layer_tree_host()->SetRootLayer(root_);
1186 LayerTreeHostContextTest::SetupTree(); 1185 LayerTreeHostContextTest::SetupTree();
1187 } 1186 }
1188 1187
1189 virtual void BeginTest() OVERRIDE { 1188 virtual void BeginTest() OVERRIDE {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 1473
1475 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); 1474 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting);
1476 1475
1477 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { 1476 class ScrollbarLayerLostContext : public LayerTreeHostContextTest {
1478 public: 1477 public:
1479 ScrollbarLayerLostContext() : commits_(0) {} 1478 ScrollbarLayerLostContext() : commits_(0) {}
1480 1479
1481 virtual void BeginTest() OVERRIDE { 1480 virtual void BeginTest() OVERRIDE {
1482 scoped_refptr<Layer> scroll_layer = Layer::Create(); 1481 scoped_refptr<Layer> scroll_layer = Layer::Create();
1483 scrollbar_layer_ = FakeScrollbarLayer::Create( 1482 scrollbar_layer_ = FakeScrollbarLayer::Create(
1484 false, true, scroll_layer->id()); 1483 false, true, scroll_layer->id(), false);
1485 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); 1484 scrollbar_layer_->SetBounds(gfx::Size(10, 100));
1486 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); 1485 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
1487 layer_tree_host()->root_layer()->AddChild(scroll_layer); 1486 layer_tree_host()->root_layer()->AddChild(scroll_layer);
1488 PostSetNeedsCommitToMainThread(); 1487 PostSetNeedsCommitToMainThread();
1489 } 1488 }
1490 1489
1491 virtual void AfterTest() OVERRIDE {} 1490 virtual void AfterTest() OVERRIDE {}
1492 1491
1493 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { 1492 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
1494 LayerTreeHostContextTest::CommitCompleteOnThread(impl); 1493 LayerTreeHostContextTest::CommitCompleteOnThread(impl);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 impl_thread ? impl_thread->message_loop_proxy() : NULL); 1589 impl_thread ? impl_thread->message_loop_proxy() : NULL);
1591 EXPECT_FALSE(layer_tree_host); 1590 EXPECT_FALSE(layer_tree_host);
1592 } 1591 }
1593 }; 1592 };
1594 1593
1595 SINGLE_AND_MULTI_THREAD_TEST_F( 1594 SINGLE_AND_MULTI_THREAD_TEST_F(
1596 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); 1595 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface);
1597 1596
1598 } // namespace 1597 } // namespace
1599 } // namespace cc 1598 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698