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

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

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add fix for empty scroll-layer bounds. Created 6 years, 11 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/delegated_frame_provider.h" 9 #include "cc/layers/delegated_frame_provider.h"
10 #include "cc/layers/delegated_frame_resource_collection.h" 10 #include "cc/layers/delegated_frame_resource_collection.h"
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 root->AddChild(io_surface); 1109 root->AddChild(io_surface);
1110 } 1110 }
1111 1111
1112 // Enable the hud. 1112 // Enable the hud.
1113 LayerTreeDebugState debug_state; 1113 LayerTreeDebugState debug_state;
1114 debug_state.show_property_changed_rects = true; 1114 debug_state.show_property_changed_rects = true;
1115 layer_tree_host()->SetDebugState(debug_state); 1115 layer_tree_host()->SetDebugState(debug_state);
1116 1116
1117 scoped_refptr<PaintedScrollbarLayer> scrollbar = 1117 scoped_refptr<PaintedScrollbarLayer> scrollbar =
1118 PaintedScrollbarLayer::Create( 1118 PaintedScrollbarLayer::Create(
1119 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id()); 1119 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content.get());
1120 scrollbar->SetBounds(gfx::Size(10, 10)); 1120 scrollbar->SetBounds(gfx::Size(10, 10));
1121 scrollbar->SetAnchorPoint(gfx::PointF()); 1121 scrollbar->SetAnchorPoint(gfx::PointF());
1122 scrollbar->SetIsDrawable(true); 1122 scrollbar->SetIsDrawable(true);
1123 root->AddChild(scrollbar); 1123 root->AddChild(scrollbar);
1124 1124
1125 layer_tree_host()->SetRootLayer(root); 1125 layer_tree_host()->SetRootLayer(root);
1126 LayerTreeHostContextTest::SetupTree(); 1126 LayerTreeHostContextTest::SetupTree();
1127 } 1127 }
1128 1128
1129 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 1129 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 1479
1480 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); 1480 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting);
1481 1481
1482 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { 1482 class ScrollbarLayerLostContext : public LayerTreeHostContextTest {
1483 public: 1483 public:
1484 ScrollbarLayerLostContext() : commits_(0) {} 1484 ScrollbarLayerLostContext() : commits_(0) {}
1485 1485
1486 virtual void BeginTest() OVERRIDE { 1486 virtual void BeginTest() OVERRIDE {
1487 scoped_refptr<Layer> scroll_layer = Layer::Create(); 1487 scoped_refptr<Layer> scroll_layer = Layer::Create();
1488 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( 1488 scrollbar_layer_ = FakePaintedScrollbarLayer::Create(
1489 false, true, scroll_layer->id()); 1489 false, true, scroll_layer.get());
1490 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); 1490 scrollbar_layer_->SetBounds(gfx::Size(10, 100));
1491 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); 1491 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
1492 layer_tree_host()->root_layer()->AddChild(scroll_layer); 1492 layer_tree_host()->root_layer()->AddChild(scroll_layer);
1493 PostSetNeedsCommitToMainThread(); 1493 PostSetNeedsCommitToMainThread();
1494 } 1494 }
1495 1495
1496 virtual void AfterTest() OVERRIDE {} 1496 virtual void AfterTest() OVERRIDE {}
1497 1497
1498 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { 1498 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
1499 LayerTreeHostContextTest::CommitCompleteOnThread(impl); 1499 LayerTreeHostContextTest::CommitCompleteOnThread(impl);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 protected: 2021 protected:
2022 FakeContentLayerClient client_; 2022 FakeContentLayerClient client_;
2023 scoped_refptr<FakeContentLayer> layer_; 2023 scoped_refptr<FakeContentLayer> layer_;
2024 int num_commits_; 2024 int num_commits_;
2025 }; 2025 };
2026 2026
2027 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); 2027 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback);
2028 2028
2029 } // namespace 2029 } // namespace
2030 } // namespace cc 2030 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698