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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "cc/animation/scrollbar_animation_controller.h" | 6 #include "cc/animation/scrollbar_animation_controller.h" |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/layers/painted_scrollbar_layer.h" | 8 #include "cc/layers/painted_scrollbar_layer.h" |
9 #include "cc/layers/painted_scrollbar_layer_impl.h" | 9 #include "cc/layers/painted_scrollbar_layer_impl.h" |
10 #include "cc/layers/scrollbar_layer_interface.h" | 10 #include "cc/layers/scrollbar_layer_interface.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 scoped_ptr<TestWebGraphicsContext3D> context = | 505 scoped_ptr<TestWebGraphicsContext3D> context = |
506 TestWebGraphicsContext3D::Create(); | 506 TestWebGraphicsContext3D::Create(); |
507 int max_size = 0; | 507 int max_size = 0; |
508 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 508 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
509 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 509 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
510 RunTest(true, true, true); | 510 RunTest(true, true, true); |
511 } | 511 } |
512 | 512 |
513 class MockLayerTreeHost : public LayerTreeHost { | 513 class MockLayerTreeHost : public LayerTreeHost { |
514 public: | 514 public: |
515 MockLayerTreeHost(LayerTreeHostClient* client, | 515 MockLayerTreeHost(FakeLayerTreeHostClient* client, |
516 const LayerTreeSettings& settings) | 516 const LayerTreeSettings& settings) |
517 : LayerTreeHost(client, NULL, settings), | 517 : LayerTreeHost(client, NULL, settings), |
518 next_id_(1), | 518 next_id_(1), |
519 total_ui_resource_created_(0), | 519 total_ui_resource_created_(0), |
520 total_ui_resource_deleted_(0) { | 520 total_ui_resource_deleted_(0) { |
521 Initialize(NULL); | 521 InitializeSingleThreaded(client); |
522 } | 522 } |
523 | 523 |
524 virtual UIResourceId CreateUIResource(UIResourceClient* content) OVERRIDE { | 524 virtual UIResourceId CreateUIResource(UIResourceClient* content) OVERRIDE { |
525 total_ui_resource_created_++; | 525 total_ui_resource_created_++; |
526 UIResourceId nid = next_id_++; | 526 UIResourceId nid = next_id_++; |
527 ui_resource_bitmap_map_.insert( | 527 ui_resource_bitmap_map_.insert( |
528 std::make_pair(nid, content->GetBitmap(nid, false))); | 528 std::make_pair(nid, content->GetBitmap(nid, false))); |
529 return nid; | 529 return nid; |
530 } | 530 } |
531 | 531 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { | 729 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { |
730 // Pick a test scale that moves the scrollbar's (non-zero) position to | 730 // Pick a test scale that moves the scrollbar's (non-zero) position to |
731 // a non-pixel-aligned location. | 731 // a non-pixel-aligned location. |
732 TestResourceUpload(.041f); | 732 TestResourceUpload(.041f); |
733 TestResourceUpload(1.41f); | 733 TestResourceUpload(1.41f); |
734 TestResourceUpload(4.1f); | 734 TestResourceUpload(4.1f); |
735 } | 735 } |
736 | 736 |
737 } // namespace | 737 } // namespace |
738 } // namespace cc | 738 } // namespace cc |
OLD | NEW |