| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |