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

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

Issue 1314943008: cc: Remove implicit conversions from Rect to RectF in src/cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rectfconvert-cc: rebase-and-sandwich-strategy Created 5 years, 3 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/layers/render_surface_impl.cc ('k') | cc/output/direct_renderer.cc » ('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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "base/thread_task_runner_handle.h" 6 #include "base/thread_task_runner_handle.h"
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/painted_scrollbar_layer.h" 9 #include "cc/layers/painted_scrollbar_layer.h"
10 #include "cc/layers/painted_scrollbar_layer_impl.h" 10 #include "cc/layers/painted_scrollbar_layer_impl.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 SolidColorScrollbarLayerImpl* layers[2] = 592 SolidColorScrollbarLayerImpl* layers[2] =
593 { horizontal_scrollbar_layer_.get(), vertical_scrollbar_layer_.get() }; 593 { horizontal_scrollbar_layer_.get(), vertical_scrollbar_layer_.get() };
594 for (size_t i = 0; i < 2; ++i) { 594 for (size_t i = 0; i < 2; ++i) {
595 layers[i]->SetVisibleToTotalLengthRatio(0.2f); 595 layers[i]->SetVisibleToTotalLengthRatio(0.2f);
596 layers[i]->SetCurrentPos(25); 596 layers[i]->SetCurrentPos(25);
597 layers[i]->SetMaximum(100); 597 layers[i]->SetMaximum(100);
598 } 598 }
599 layers[0]->SetBounds(gfx::Size(100, 3)); 599 layers[0]->SetBounds(gfx::Size(100, 3));
600 layers[1]->SetBounds(gfx::Size(3, 100)); 600 layers[1]->SetBounds(gfx::Size(3, 100));
601 601
602 EXPECT_EQ(gfx::RectF(20.f, 0.f, 20.f, 3.f), 602 EXPECT_EQ(gfx::Rect(20, 0, 20, 3),
603 horizontal_scrollbar_layer_->ComputeThumbQuadRect()); 603 horizontal_scrollbar_layer_->ComputeThumbQuadRect());
604 EXPECT_EQ(gfx::RectF(0.f, 20.f, 3.f, 20.f), 604 EXPECT_EQ(gfx::Rect(0, 20, 3, 20),
605 vertical_scrollbar_layer_->ComputeThumbQuadRect()); 605 vertical_scrollbar_layer_->ComputeThumbQuadRect());
606 606
607 horizontal_scrollbar_layer_->SetVerticalAdjust(10.f); 607 horizontal_scrollbar_layer_->SetVerticalAdjust(10.f);
608 vertical_scrollbar_layer_->SetVerticalAdjust(10.f); 608 vertical_scrollbar_layer_->SetVerticalAdjust(10.f);
609 609
610 // The vertical adjustment factor has two effects: 610 // The vertical adjustment factor has two effects:
611 // 1.) Moves the horizontal scrollbar down 611 // 1.) Moves the horizontal scrollbar down
612 // 2.) Increases the vertical scrollbar's effective track length which both 612 // 2.) Increases the vertical scrollbar's effective track length which both
613 // increases the thumb's length and its position within the track. 613 // increases the thumb's length and its position within the track.
614 EXPECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f), 614 EXPECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f),
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); 1009 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f);
1010 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); 1010 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f);
1011 1011
1012 // Horizontal Scrollbars. 1012 // Horizontal Scrollbars.
1013 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); 1013 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f);
1014 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); 1014 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f);
1015 } 1015 }
1016 1016
1017 } // namespace 1017 } // namespace
1018 } // namespace cc 1018 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698