Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 2710593003: cc: Fix const value pattern by replacing it by non-const or reference. (Closed)
Patch Set: update rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/test/pixel_comparator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 EXPECT_EQ(expected_created, 1023 EXPECT_EQ(expected_created,
1024 fake_ui_resource_manager_->TotalUIResourceCreated()); 1024 fake_ui_resource_manager_->TotalUIResourceCreated());
1025 EXPECT_EQ(expected_deleted, 1025 EXPECT_EQ(expected_deleted,
1026 fake_ui_resource_manager_->TotalUIResourceDeleted()); 1026 fake_ui_resource_manager_->TotalUIResourceDeleted());
1027 1027
1028 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); 1028 testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get());
1029 } 1029 }
1030 1030
1031 class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest { 1031 class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest {
1032 public: 1032 public:
1033 void TestResourceUpload(const float test_scale) { 1033 void TestResourceUpload(float test_scale) {
1034 gfx::Point scrollbar_location(0, 185); 1034 gfx::Point scrollbar_location(0, 185);
1035 scoped_refptr<Layer> layer_tree_root = Layer::Create(); 1035 scoped_refptr<Layer> layer_tree_root = Layer::Create();
1036 scoped_refptr<Layer> content_layer = Layer::Create(); 1036 scoped_refptr<Layer> content_layer = Layer::Create();
1037 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = 1037 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
1038 FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id()); 1038 FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id());
1039 1039
1040 layer_tree_root->AddChild(content_layer); 1040 layer_tree_root->AddChild(content_layer);
1041 layer_tree_root->AddChild(scrollbar_layer); 1041 layer_tree_root->AddChild(scrollbar_layer);
1042 1042
1043 layer_tree_host_->SetRootLayer(layer_tree_root); 1043 layer_tree_host_->SetRootLayer(layer_tree_root);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 context->UnboundTestContext3d()->set_max_texture_size(512); 1092 context->UnboundTestContext3d()->set_max_texture_size(512);
1093 context->BindToCurrentThread(); 1093 context->BindToCurrentThread();
1094 int max_texture_size = 0; 1094 int max_texture_size = 0;
1095 context->ContextGL()->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size); 1095 context->ContextGL()->GetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
1096 EXPECT_EQ(512, max_texture_size); 1096 EXPECT_EQ(512, max_texture_size);
1097 TestResourceUpload(max_texture_size / 9.9f); 1097 TestResourceUpload(max_texture_size / 9.9f);
1098 } 1098 }
1099 1099
1100 class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest { 1100 class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest {
1101 public: 1101 public:
1102 void TestScale(const gfx::Rect scrollbar_rect, const float test_scale) { 1102 void TestScale(const gfx::Rect& scrollbar_rect, float test_scale) {
1103 bool paint_during_update = true; 1103 bool paint_during_update = true;
1104 bool has_thumb = false; 1104 bool has_thumb = false;
1105 scoped_refptr<Layer> layer_tree_root = Layer::Create(); 1105 scoped_refptr<Layer> layer_tree_root = Layer::Create();
1106 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer = 1106 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
1107 FakePaintedScrollbarLayer::Create(paint_during_update, has_thumb, 1107 FakePaintedScrollbarLayer::Create(paint_during_update, has_thumb,
1108 layer_tree_root->id()); 1108 layer_tree_root->id());
1109 1109
1110 layer_tree_root->AddChild(scrollbar_layer); 1110 layer_tree_root->AddChild(scrollbar_layer);
1111 1111
1112 layer_tree_host_->SetRootLayer(layer_tree_root); 1112 layer_tree_host_->SetRootLayer(layer_tree_root);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); 1169 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f);
1170 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); 1170 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f);
1171 1171
1172 // Horizontal Scrollbars. 1172 // Horizontal Scrollbars.
1173 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); 1173 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f);
1174 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); 1174 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f);
1175 } 1175 }
1176 1176
1177 } // namespace 1177 } // namespace
1178 } // namespace cc 1178 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/page_scale_animation.h ('k') | cc/test/pixel_comparator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698