| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 virtual void AfterTest() OVERRIDE {} | 374 virtual void AfterTest() OVERRIDE {} |
| 375 | 375 |
| 376 private: | 376 private: |
| 377 scoped_refptr<ScrollbarLayer> scrollbar_layer_; | 377 scoped_refptr<ScrollbarLayer> scrollbar_layer_; |
| 378 scoped_refptr<Layer> scroll_layer_; | 378 scoped_refptr<Layer> scroll_layer_; |
| 379 gfx::Size bounds_; | 379 gfx::Size bounds_; |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 TEST_F(ScrollbarLayerTestMaxTextureSize, DirectRenderer) { | 382 TEST_F(ScrollbarLayerTestMaxTextureSize, DirectRenderer) { |
| 383 scoped_ptr<TestWebGraphicsContext3D> context = | 383 scoped_ptr<TestWebGraphicsContext3D> context = |
| 384 TestWebGraphicsContext3D::Create(); | 384 TestWebGraphicsContext3D::CreateShared(); |
| 385 int max_size = 0; | 385 int max_size = 0; |
| 386 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 386 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 387 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 387 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 388 RunTest(true, false, true); | 388 RunTest(true, false, true); |
| 389 } | 389 } |
| 390 | 390 |
| 391 TEST_F(ScrollbarLayerTestMaxTextureSize, DelegatingRenderer) { | 391 TEST_F(ScrollbarLayerTestMaxTextureSize, DelegatingRenderer) { |
| 392 scoped_ptr<TestWebGraphicsContext3D> context = | 392 scoped_ptr<TestWebGraphicsContext3D> context = |
| 393 TestWebGraphicsContext3D::Create(); | 393 TestWebGraphicsContext3D::CreateShared(); |
| 394 int max_size = 0; | 394 int max_size = 0; |
| 395 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 395 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 396 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 396 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 397 RunTest(true, true, true); | 397 RunTest(true, true, true); |
| 398 } | 398 } |
| 399 | 399 |
| 400 class MockLayerTreeHost : public LayerTreeHost { | 400 class MockLayerTreeHost : public LayerTreeHost { |
| 401 public: | 401 public: |
| 402 MockLayerTreeHost(LayerTreeHostClient* client, | 402 MockLayerTreeHost(LayerTreeHostClient* client, |
| 403 const LayerTreeSettings& settings) | 403 const LayerTreeSettings& settings) |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 558 |
| 559 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { | 559 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { |
| 560 layer_tree_settings_.solid_color_scrollbars = false; | 560 layer_tree_settings_.solid_color_scrollbars = false; |
| 561 // Pick a test scale that moves the scrollbar's (non-zero) position to | 561 // Pick a test scale that moves the scrollbar's (non-zero) position to |
| 562 // a non-pixel-aligned location. | 562 // a non-pixel-aligned location. |
| 563 TestResourceUpload(2, 1.41f); | 563 TestResourceUpload(2, 1.41f); |
| 564 } | 564 } |
| 565 | 565 |
| 566 } // namespace | 566 } // namespace |
| 567 } // namespace cc | 567 } // namespace cc |
| OLD | NEW |