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

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

Issue 1180073015: cc: Remove LayerImpl::SetContentBounds() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm-setcontentbounds: . Created 5 years, 6 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/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 #include "cc/test/layer_test_common.h" 8 #include "cc/test/layer_test_common.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 20 matching lines...) Expand all
31 track_sk_bitmap.setImmutable(); 31 track_sk_bitmap.setImmutable();
32 UIResourceId track_uid = 6; 32 UIResourceId track_uid = 6;
33 UIResourceBitmap track_bitmap(track_sk_bitmap); 33 UIResourceBitmap track_bitmap(track_sk_bitmap);
34 impl.host_impl()->CreateUIResource(track_uid, track_bitmap); 34 impl.host_impl()->CreateUIResource(track_uid, track_bitmap);
35 35
36 ScrollbarOrientation orientation = VERTICAL; 36 ScrollbarOrientation orientation = VERTICAL;
37 37
38 PaintedScrollbarLayerImpl* scrollbar_layer_impl = 38 PaintedScrollbarLayerImpl* scrollbar_layer_impl =
39 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation); 39 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation);
40 scrollbar_layer_impl->SetBounds(layer_size); 40 scrollbar_layer_impl->SetBounds(layer_size);
41 scrollbar_layer_impl->SetContentBounds(layer_size);
42 scrollbar_layer_impl->SetContentsOpaque(true); 41 scrollbar_layer_impl->SetContentsOpaque(true);
43 scrollbar_layer_impl->set_internal_contents_scale_and_bounds( 42 scrollbar_layer_impl->set_internal_contents_scale_and_bounds(
44 scale, scaled_layer_size); 43 scale, scaled_layer_size);
45 scrollbar_layer_impl->SetDrawsContent(true); 44 scrollbar_layer_impl->SetDrawsContent(true);
46 scrollbar_layer_impl->SetThumbThickness(layer_size.width()); 45 scrollbar_layer_impl->SetThumbThickness(layer_size.width());
47 scrollbar_layer_impl->SetThumbLength(500); 46 scrollbar_layer_impl->SetThumbLength(500);
48 scrollbar_layer_impl->SetTrackLength(layer_size.height()); 47 scrollbar_layer_impl->SetTrackLength(layer_size.height());
49 scrollbar_layer_impl->SetCurrentPos(100.f / 4); 48 scrollbar_layer_impl->SetCurrentPos(100.f / 4);
50 scrollbar_layer_impl->SetMaximum(100); 49 scrollbar_layer_impl->SetMaximum(100);
51 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2); 50 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 LayerTestCommon::VerifyQuadsAreOccluded( 104 LayerTestCommon::VerifyQuadsAreOccluded(
106 impl.quad_list(), occluded, &partially_occluded_count); 105 impl.quad_list(), occluded, &partially_occluded_count);
107 // The layer outputs two quads, which is partially occluded. 106 // The layer outputs two quads, which is partially occluded.
108 EXPECT_EQ(2u, impl.quad_list().size()); 107 EXPECT_EQ(2u, impl.quad_list().size());
109 EXPECT_EQ(2u, partially_occluded_count); 108 EXPECT_EQ(2u, partially_occluded_count);
110 } 109 }
111 } 110 }
112 111
113 } // namespace 112 } // namespace
114 } // namespace cc 113 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl_unittest.cc ('k') | cc/layers/picture_image_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698