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

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

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 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 | Annotate | Revision Log
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 16 matching lines...) Expand all
27 track_sk_bitmap.allocN32Pixels(10, 10); 27 track_sk_bitmap.allocN32Pixels(10, 10);
28 track_sk_bitmap.setImmutable(); 28 track_sk_bitmap.setImmutable();
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->SetAnchorPoint(gfx::PointF()); 37 scrollbar_layer_impl->SetTransformOrigin(gfx::Point3F());
38 scrollbar_layer_impl->SetBounds(layer_size); 38 scrollbar_layer_impl->SetBounds(layer_size);
39 scrollbar_layer_impl->SetContentBounds(layer_size); 39 scrollbar_layer_impl->SetContentBounds(layer_size);
40 scrollbar_layer_impl->SetDrawsContent(true); 40 scrollbar_layer_impl->SetDrawsContent(true);
41 scrollbar_layer_impl->SetThumbThickness(layer_size.width()); 41 scrollbar_layer_impl->SetThumbThickness(layer_size.width());
42 scrollbar_layer_impl->SetThumbLength(500); 42 scrollbar_layer_impl->SetThumbLength(500);
43 scrollbar_layer_impl->SetTrackLength(layer_size.height()); 43 scrollbar_layer_impl->SetTrackLength(layer_size.height());
44 scrollbar_layer_impl->SetCurrentPos(100.f / 4); 44 scrollbar_layer_impl->SetCurrentPos(100.f / 4);
45 scrollbar_layer_impl->SetMaximum(100); 45 scrollbar_layer_impl->SetMaximum(100);
46 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2); 46 scrollbar_layer_impl->SetVisibleToTotalLengthRatio(1.f / 2);
47 scrollbar_layer_impl->set_track_ui_resource_id(track_uid); 47 scrollbar_layer_impl->set_track_ui_resource_id(track_uid);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 LayerTestCommon::VerifyQuadsCoverRectWithOcclusion( 86 LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
87 impl.quad_list(), thumb_rect, occluded, &partially_occluded_count); 87 impl.quad_list(), thumb_rect, occluded, &partially_occluded_count);
88 // The layer outputs two quads, which is partially occluded. 88 // The layer outputs two quads, which is partially occluded.
89 EXPECT_EQ(2u, impl.quad_list().size()); 89 EXPECT_EQ(2u, impl.quad_list().size());
90 EXPECT_EQ(2u, partially_occluded_count); 90 EXPECT_EQ(2u, partially_occluded_count);
91 } 91 }
92 } 92 }
93 93
94 } // namespace 94 } // namespace
95 } // namespace cc 95 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698