OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <unordered_map> | 7 #include <unordered_map> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 gfx::Rect screen_space_clip_rect; | 1188 gfx::Rect screen_space_clip_rect; |
1189 scrollbar_layer->SavePaintProperties(); | 1189 scrollbar_layer->SavePaintProperties(); |
1190 | 1190 |
1191 scrollbar_layer->Update(); | 1191 scrollbar_layer->Update(); |
1192 | 1192 |
1193 UIResourceBitmap* bitmap = fake_ui_resource_manager_->ui_resource_bitmap( | 1193 UIResourceBitmap* bitmap = fake_ui_resource_manager_->ui_resource_bitmap( |
1194 scrollbar_layer->track_resource_id()); | 1194 scrollbar_layer->track_resource_id()); |
1195 | 1195 |
1196 DCHECK(bitmap); | 1196 DCHECK(bitmap); |
1197 | 1197 |
1198 AutoLockUIResourceBitmap locked_bitmap(*bitmap); | |
1199 | |
1200 const SkColor* pixels = | 1198 const SkColor* pixels = |
1201 reinterpret_cast<const SkColor*>(locked_bitmap.GetPixels()); | 1199 reinterpret_cast<const SkColor*>(bitmap->GetPixels()); |
1202 SkColor color = argb_to_skia( | 1200 SkColor color = argb_to_skia( |
1203 scrollbar_layer->fake_scrollbar()->paint_fill_color()); | 1201 scrollbar_layer->fake_scrollbar()->paint_fill_color()); |
1204 int width = bitmap->GetSize().width(); | 1202 int width = bitmap->GetSize().width(); |
1205 int height = bitmap->GetSize().height(); | 1203 int height = bitmap->GetSize().height(); |
1206 | 1204 |
1207 // Make sure none of the corners of the bitmap were inadvertently clipped. | 1205 // Make sure none of the corners of the bitmap were inadvertently clipped. |
1208 EXPECT_EQ(color, pixels[0]) | 1206 EXPECT_EQ(color, pixels[0]) |
1209 << "Top left pixel doesn't match scrollbar color."; | 1207 << "Top left pixel doesn't match scrollbar color."; |
1210 | 1208 |
1211 EXPECT_EQ(color, pixels[width - 1]) | 1209 EXPECT_EQ(color, pixels[width - 1]) |
(...skipping 23 matching lines...) Expand all Loading... |
1235 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1233 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1236 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1234 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1237 | 1235 |
1238 // Horizontal Scrollbars. | 1236 // Horizontal Scrollbars. |
1239 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1237 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1240 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1238 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1241 } | 1239 } |
1242 | 1240 |
1243 } // namespace | 1241 } // namespace |
1244 } // namespace cc | 1242 } // namespace cc |
OLD | NEW |