| OLD | NEW |
| 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/layers/scrollbar_layer.h" | 5 #include "cc/layers/scrollbar_layer.h" |
| 6 | 6 |
| 7 #include "cc/animation/scrollbar_animation_controller.h" | 7 #include "cc/animation/scrollbar_animation_controller.h" |
| 8 #include "cc/layers/append_quads_data.h" | 8 #include "cc/layers/append_quads_data.h" |
| 9 #include "cc/layers/scrollbar_layer_impl.h" | 9 #include "cc/layers/scrollbar_layer_impl.h" |
| 10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 413 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 414 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 414 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 415 RunTest(true, true, true); | 415 RunTest(true, true, true); |
| 416 } | 416 } |
| 417 | 417 |
| 418 class MockLayerTreeHost : public LayerTreeHost { | 418 class MockLayerTreeHost : public LayerTreeHost { |
| 419 public: | 419 public: |
| 420 MockLayerTreeHost(LayerTreeHostClient* client, | 420 MockLayerTreeHost(LayerTreeHostClient* client, |
| 421 const LayerTreeSettings& settings) | 421 const LayerTreeSettings& settings) |
| 422 : LayerTreeHost(client, settings) { | 422 : LayerTreeHost(client, settings) { |
| 423 Initialize(scoped_ptr<Thread>(NULL)); | 423 Initialize(scoped_ptr<Thread>()); |
| 424 } | 424 } |
| 425 }; | 425 }; |
| 426 | 426 |
| 427 | 427 |
| 428 class ScrollbarLayerTestResourceCreation : public testing::Test { | 428 class ScrollbarLayerTestResourceCreation : public testing::Test { |
| 429 public: | 429 public: |
| 430 ScrollbarLayerTestResourceCreation() | 430 ScrollbarLayerTestResourceCreation() |
| 431 : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 431 : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
| 432 | 432 |
| 433 void TestResourceUpload(size_t expected_resources) { | 433 void TestResourceUpload(size_t expected_resources) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 | 576 |
| 577 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { | 577 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { |
| 578 layer_tree_settings_.solid_color_scrollbars = false; | 578 layer_tree_settings_.solid_color_scrollbars = false; |
| 579 // Pick a test scale that moves the scrollbar's (non-zero) position to | 579 // Pick a test scale that moves the scrollbar's (non-zero) position to |
| 580 // a non-pixel-aligned location. | 580 // a non-pixel-aligned location. |
| 581 TestResourceUpload(2, 1.41f); | 581 TestResourceUpload(2, 1.41f); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace | 584 } // namespace |
| 585 } // namespace cc | 585 } // namespace cc |
| OLD | NEW |