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

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

Issue 913133004: cc: Make PaintedScrollbarLayer not use ContentsScalingLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix thumb rects under device scale Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/layers/painted_scrollbar_layer_impl.h" 5 #include "cc/layers/painted_scrollbar_layer_impl.h"
6 6
7 #include "cc/test/layer_test_common.h" 7 #include "cc/test/layer_test_common.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 18 matching lines...) Expand all
29 UIResourceId track_uid = 6; 29 UIResourceId track_uid = 6;
30 UIResourceBitmap track_bitmap(track_sk_bitmap); 30 UIResourceBitmap track_bitmap(track_sk_bitmap);
31 impl.host_impl()->CreateUIResource(track_uid, track_bitmap); 31 impl.host_impl()->CreateUIResource(track_uid, track_bitmap);
32 32
33 ScrollbarOrientation orientation = VERTICAL; 33 ScrollbarOrientation orientation = VERTICAL;
34 34
35 PaintedScrollbarLayerImpl* scrollbar_layer_impl = 35 PaintedScrollbarLayerImpl* scrollbar_layer_impl =
36 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation); 36 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation);
37 scrollbar_layer_impl->SetBounds(layer_size); 37 scrollbar_layer_impl->SetBounds(layer_size);
38 scrollbar_layer_impl->SetContentBounds(layer_size); 38 scrollbar_layer_impl->SetContentBounds(layer_size);
39 scrollbar_layer_impl->set_internal_content_scale_and_bounds(1.f, layer_size);
danakj 2015/02/12 19:35:43 maybe we should have some scale here. would it pas
enne (OOO) 2015/02/12 21:55:56 Excellent call. It wouldn't. Fixed.
39 scrollbar_layer_impl->SetDrawsContent(true); 40 scrollbar_layer_impl->SetDrawsContent(true);
40 scrollbar_layer_impl->SetThumbThickness(layer_size.width()); 41 scrollbar_layer_impl->SetThumbThickness(layer_size.width());
41 scrollbar_layer_impl->SetThumbLength(500); 42 scrollbar_layer_impl->SetThumbLength(500);
42 scrollbar_layer_impl->SetTrackLength(layer_size.height()); 43 scrollbar_layer_impl->SetTrackLength(layer_size.height());
43 scrollbar_layer_impl->SetCurrentPos(100.f / 4); 44 scrollbar_layer_impl->SetCurrentPos(100.f / 4);
44 scrollbar_layer_impl->SetMaximum(100); 45 scrollbar_layer_impl->SetMaximum(100);
45 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2); 46 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2);
46 scrollbar_layer_impl->set_track_ui_resource_id(track_uid); 47 scrollbar_layer_impl->set_track_ui_resource_id(track_uid);
47 scrollbar_layer_impl->set_thumb_ui_resource_id(thumb_uid); 48 scrollbar_layer_impl->set_thumb_ui_resource_id(thumb_uid);
48 49
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 LayerTestCommon::VerifyQuadsAreOccluded( 83 LayerTestCommon::VerifyQuadsAreOccluded(
83 impl.quad_list(), occluded, &partially_occluded_count); 84 impl.quad_list(), occluded, &partially_occluded_count);
84 // The layer outputs two quads, which is partially occluded. 85 // The layer outputs two quads, which is partially occluded.
85 EXPECT_EQ(2u, impl.quad_list().size()); 86 EXPECT_EQ(2u, impl.quad_list().size());
86 EXPECT_EQ(2u, partially_occluded_count); 87 EXPECT_EQ(2u, partially_occluded_count);
87 } 88 }
88 } 89 }
89 90
90 } // namespace 91 } // namespace
91 } // namespace cc 92 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698