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

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

Issue 2468423004: Left side vertical MD scrollbars grow toward right. (Closed)
Patch Set: Created 4 years, 1 month 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/painted_scrollbar_layer_impl.cc ('k') | cc/layers/scrollbar_layer_unittest.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 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/quads/draw_quad.h" 9 #include "cc/quads/draw_quad.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 23 matching lines...) Expand all
34 SkBitmap track_sk_bitmap; 34 SkBitmap track_sk_bitmap;
35 track_sk_bitmap.allocN32Pixels(10, 10); 35 track_sk_bitmap.allocN32Pixels(10, 10);
36 track_sk_bitmap.setImmutable(); 36 track_sk_bitmap.setImmutable();
37 UIResourceId track_uid = 6; 37 UIResourceId track_uid = 6;
38 UIResourceBitmap track_bitmap(track_sk_bitmap); 38 UIResourceBitmap track_bitmap(track_sk_bitmap);
39 impl.host_impl()->CreateUIResource(track_uid, track_bitmap); 39 impl.host_impl()->CreateUIResource(track_uid, track_bitmap);
40 40
41 ScrollbarOrientation orientation = VERTICAL; 41 ScrollbarOrientation orientation = VERTICAL;
42 42
43 PaintedScrollbarLayerImpl* scrollbar_layer_impl = 43 PaintedScrollbarLayerImpl* scrollbar_layer_impl =
44 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation); 44 impl.AddChildToRoot<PaintedScrollbarLayerImpl>(orientation, false, false);
45 scrollbar_layer_impl->SetBounds(layer_size); 45 scrollbar_layer_impl->SetBounds(layer_size);
46 scrollbar_layer_impl->SetContentsOpaque(true); 46 scrollbar_layer_impl->SetContentsOpaque(true);
47 scrollbar_layer_impl->set_internal_contents_scale_and_bounds( 47 scrollbar_layer_impl->set_internal_contents_scale_and_bounds(
48 scale, scaled_layer_size); 48 scale, scaled_layer_size);
49 scrollbar_layer_impl->SetDrawsContent(true); 49 scrollbar_layer_impl->SetDrawsContent(true);
50 scrollbar_layer_impl->SetThumbThickness(layer_size.width()); 50 scrollbar_layer_impl->SetThumbThickness(layer_size.width());
51 scrollbar_layer_impl->SetThumbLength(500); 51 scrollbar_layer_impl->SetThumbLength(500);
52 scrollbar_layer_impl->SetTrackLength(layer_size.height()); 52 scrollbar_layer_impl->SetTrackLength(layer_size.height());
53 scrollbar_layer_impl->SetCurrentPos(100.f / 4); 53 scrollbar_layer_impl->SetCurrentPos(100.f / 4);
54 scrollbar_layer_impl->SetClipLayerLength(100.f); 54 scrollbar_layer_impl->SetClipLayerLength(100.f);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 LayerTestCommon::VerifyQuadsAreOccluded( 124 LayerTestCommon::VerifyQuadsAreOccluded(
125 impl.quad_list(), occluded, &partially_occluded_count); 125 impl.quad_list(), occluded, &partially_occluded_count);
126 // The layer outputs two quads, which is partially occluded. 126 // The layer outputs two quads, which is partially occluded.
127 EXPECT_EQ(2u, impl.quad_list().size()); 127 EXPECT_EQ(2u, impl.quad_list().size());
128 EXPECT_EQ(2u, partially_occluded_count); 128 EXPECT_EQ(2u, partially_occluded_count);
129 } 129 }
130 } 130 }
131 131
132 } // namespace 132 } // namespace
133 } // namespace cc 133 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/painted_scrollbar_layer_impl.cc ('k') | cc/layers/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698