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

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

Issue 142863008: Revert of [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/tiled_layer.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 "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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 EXPECT_RECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f), 446 EXPECT_RECT_EQ(gfx::Rect(20.f, 10.f, 20.f, 3.f),
447 horizontal_scrollbar_layer_->ComputeThumbQuadRect()); 447 horizontal_scrollbar_layer_->ComputeThumbQuadRect());
448 EXPECT_RECT_EQ(gfx::Rect(0.f, 22, 3.f, 22.f), 448 EXPECT_RECT_EQ(gfx::Rect(0.f, 22, 3.f, 22.f),
449 vertical_scrollbar_layer_->ComputeThumbQuadRect()); 449 vertical_scrollbar_layer_->ComputeThumbQuadRect());
450 } 450 }
451 451
452 class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { 452 class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest {
453 public: 453 public:
454 ScrollbarLayerTestMaxTextureSize() {} 454 ScrollbarLayerTestMaxTextureSize() {}
455 455
456 void SetScrollbarBounds(const gfx::Size& bounds) { bounds_ = bounds; } 456 void SetScrollbarBounds(gfx::Size bounds) { bounds_ = bounds; }
457 457
458 virtual void BeginTest() OVERRIDE { 458 virtual void BeginTest() OVERRIDE {
459 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar); 459 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar);
460 scrollbar_layer_ = PaintedScrollbarLayer::Create(scrollbar.Pass(), 1); 460 scrollbar_layer_ = PaintedScrollbarLayer::Create(scrollbar.Pass(), 1);
461 scrollbar_layer_->SetLayerTreeHost(layer_tree_host()); 461 scrollbar_layer_->SetLayerTreeHost(layer_tree_host());
462 scrollbar_layer_->SetBounds(bounds_); 462 scrollbar_layer_->SetBounds(bounds_);
463 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); 463 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
464 464
465 scroll_layer_ = Layer::Create(); 465 scroll_layer_ = Layer::Create();
466 scrollbar_layer_->SetScrollLayerId(scroll_layer_->id()); 466 scrollbar_layer_->SetScrollLayerId(scroll_layer_->id());
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) { 727 TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) {
728 // Pick a test scale that moves the scrollbar's (non-zero) position to 728 // Pick a test scale that moves the scrollbar's (non-zero) position to
729 // a non-pixel-aligned location. 729 // a non-pixel-aligned location.
730 TestResourceUpload(.041f); 730 TestResourceUpload(.041f);
731 TestResourceUpload(1.41f); 731 TestResourceUpload(1.41f);
732 TestResourceUpload(4.1f); 732 TestResourceUpload(4.1f);
733 } 733 }
734 734
735 } // namespace 735 } // namespace
736 } // namespace cc 736 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/tiled_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698