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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <unordered_map> | 7 #include <unordered_map> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 EXPECT_EQ(expected_created, | 1022 EXPECT_EQ(expected_created, |
1023 fake_ui_resource_manager_->TotalUIResourceCreated()); | 1023 fake_ui_resource_manager_->TotalUIResourceCreated()); |
1024 EXPECT_EQ(expected_deleted, | 1024 EXPECT_EQ(expected_deleted, |
1025 fake_ui_resource_manager_->TotalUIResourceDeleted()); | 1025 fake_ui_resource_manager_->TotalUIResourceDeleted()); |
1026 | 1026 |
1027 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 1027 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
1028 } | 1028 } |
1029 | 1029 |
1030 class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest { | 1030 class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest { |
1031 public: | 1031 public: |
1032 void TestResourceUpload(const float test_scale) { | 1032 void TestResourceUpload(float test_scale) { |
1033 gfx::Point scrollbar_location(0, 185); | 1033 gfx::Point scrollbar_location(0, 185); |
1034 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 1034 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
1035 scoped_refptr<Layer> content_layer = Layer::Create(); | 1035 scoped_refptr<Layer> content_layer = Layer::Create(); |
1036 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = | 1036 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = |
1037 FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id()); | 1037 FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id()); |
1038 | 1038 |
1039 layer_tree_root->AddChild(content_layer); | 1039 layer_tree_root->AddChild(content_layer); |
1040 layer_tree_root->AddChild(scrollbar_layer); | 1040 layer_tree_root->AddChild(scrollbar_layer); |
1041 | 1041 |
1042 layer_tree_host_->SetRootLayer(layer_tree_root); | 1042 layer_tree_host_->SetRootLayer(layer_tree_root); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 context->UnboundTestContext3d()->set_max_texture_size(512); | 1091 context->UnboundTestContext3d()->set_max_texture_size(512); |
1092 context->BindToCurrentThread(); | 1092 context->BindToCurrentThread(); |
1093 int max_texture_size = 0; | 1093 int max_texture_size = 0; |
1094 context->ContextGL()->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size); | 1094 context->ContextGL()->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size); |
1095 EXPECT_EQ(512, max_texture_size); | 1095 EXPECT_EQ(512, max_texture_size); |
1096 TestResourceUpload(max_texture_size / 9.9f); | 1096 TestResourceUpload(max_texture_size / 9.9f); |
1097 } | 1097 } |
1098 | 1098 |
1099 class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest { | 1099 class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest { |
1100 public: | 1100 public: |
1101 void TestScale(const gfx::Rect scrollbar_rect, const float test_scale) { | 1101 void TestScale(const gfx::Rect& scrollbar_rect, float test_scale) { |
1102 bool paint_during_update = true; | 1102 bool paint_during_update = true; |
1103 bool has_thumb = false; | 1103 bool has_thumb = false; |
1104 scoped_refptr<Layer> layer_tree_root = Layer::Create(); | 1104 scoped_refptr<Layer> layer_tree_root = Layer::Create(); |
1105 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = | 1105 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = |
1106 FakePaintedScrollbarLayer::Create(paint_during_update, has_thumb, | 1106 FakePaintedScrollbarLayer::Create(paint_during_update, has_thumb, |
1107 layer_tree_root->id()); | 1107 layer_tree_root->id()); |
1108 | 1108 |
1109 layer_tree_root->AddChild(scrollbar_layer); | 1109 layer_tree_root->AddChild(scrollbar_layer); |
1110 | 1110 |
1111 layer_tree_host_->SetRootLayer(layer_tree_root); | 1111 layer_tree_host_->SetRootLayer(layer_tree_root); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1168 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1169 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1169 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1170 | 1170 |
1171 // Horizontal Scrollbars. | 1171 // Horizontal Scrollbars. |
1172 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1172 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1173 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1173 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1174 } | 1174 } |
1175 | 1175 |
1176 } // namespace | 1176 } // namespace |
1177 } // namespace cc | 1177 } // namespace cc |
OLD | NEW |