| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 contents->SetBounds(content_size); | 1363 contents->SetBounds(content_size); |
| 1364 contents->SetContentBounds(content_size); | 1364 contents->SetContentBounds(content_size); |
| 1365 | 1365 |
| 1366 // The scrollbar is on the right side. | 1366 // The scrollbar is on the right side. |
| 1367 scoped_ptr<PaintedScrollbarLayerImpl> scrollbar = | 1367 scoped_ptr<PaintedScrollbarLayerImpl> scrollbar = |
| 1368 PaintedScrollbarLayerImpl::Create(host_impl_->active_tree(), 5, VERTICAL); | 1368 PaintedScrollbarLayerImpl::Create(host_impl_->active_tree(), 5, VERTICAL); |
| 1369 scrollbar->SetDrawsContent(true); | 1369 scrollbar->SetDrawsContent(true); |
| 1370 scrollbar->SetBounds(gfx::Size(15, viewport_size.height())); | 1370 scrollbar->SetBounds(gfx::Size(15, viewport_size.height())); |
| 1371 scrollbar->SetContentBounds(gfx::Size(15, viewport_size.height())); | 1371 scrollbar->SetContentBounds(gfx::Size(15, viewport_size.height())); |
| 1372 scrollbar->SetPosition(gfx::Point(285, 0)); | 1372 scrollbar->SetPosition(gfx::Point(285, 0)); |
| 1373 scrollbar->SetClipLayerById(1); |
| 1373 scrollbar->SetScrollLayerById(2); | 1374 scrollbar->SetScrollLayerById(2); |
| 1374 | 1375 |
| 1375 scroll->AddChild(contents.Pass()); | 1376 scroll->AddChild(contents.Pass()); |
| 1376 root->AddChild(scroll.Pass()); | 1377 root->AddChild(scroll.Pass()); |
| 1377 root->AddChild(scrollbar.PassAs<LayerImpl>()); | 1378 root->AddChild(scrollbar.PassAs<LayerImpl>()); |
| 1378 | 1379 |
| 1379 host_impl_->active_tree()->SetRootLayer(root.Pass()); | 1380 host_impl_->active_tree()->SetRootLayer(root.Pass()); |
| 1380 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID); | 1381 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID); |
| 1381 host_impl_->active_tree()->DidBecomeActive(); | 1382 host_impl_->active_tree()->DidBecomeActive(); |
| 1382 DrawFrame(); | 1383 DrawFrame(); |
| (...skipping 5003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6386 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, | 6387 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, |
| 6387 300u * 1024u * 1024u); | 6388 300u * 1024u * 1024u); |
| 6388 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, | 6389 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, |
| 6389 150u * 1024u * 1024u); | 6390 150u * 1024u * 1024u); |
| 6390 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, | 6391 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, |
| 6391 75u * 1024u * 1024u); | 6392 75u * 1024u * 1024u); |
| 6392 } | 6393 } |
| 6393 | 6394 |
| 6394 } // namespace | 6395 } // namespace |
| 6395 } // namespace cc | 6396 } // namespace cc |
| OLD | NEW |