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 "cc/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 gfx::Rect device_viewport_rect) { | 60 gfx::Rect device_viewport_rect) { |
61 std::unique_ptr<SkBitmap> bitmap_result; | 61 std::unique_ptr<SkBitmap> bitmap_result; |
62 base::RunLoop loop; | 62 base::RunLoop loop; |
63 | 63 |
64 list->back()->copy_requests.push_back( | 64 list->back()->copy_requests.push_back( |
65 CopyOutputRequest::CreateBitmapRequest( | 65 CopyOutputRequest::CreateBitmapRequest( |
66 base::Bind(&SoftwareRendererTest::SaveBitmapResult, | 66 base::Bind(&SoftwareRendererTest::SaveBitmapResult, |
67 base::Unretained(&bitmap_result), | 67 base::Unretained(&bitmap_result), |
68 loop.QuitClosure()))); | 68 loop.QuitClosure()))); |
69 | 69 |
70 renderer()->DrawFrame(list, | 70 renderer()->DrawFrame(list, device_scale_factor, gfx::ColorSpace(), |
71 device_scale_factor, | 71 device_viewport_rect, device_viewport_rect, false); |
72 device_viewport_rect, | |
73 device_viewport_rect, | |
74 false); | |
75 loop.Run(); | 72 loop.Run(); |
76 return bitmap_result; | 73 return bitmap_result; |
77 } | 74 } |
78 | 75 |
79 static void SaveBitmapResult(std::unique_ptr<SkBitmap>* bitmap_result, | 76 static void SaveBitmapResult(std::unique_ptr<SkBitmap>* bitmap_result, |
80 const base::Closure& quit_closure, | 77 const base::Closure& quit_closure, |
81 std::unique_ptr<CopyOutputResult> result) { | 78 std::unique_ptr<CopyOutputResult> result) { |
82 DCHECK(result->HasBitmap()); | 79 DCHECK(result->HasBitmap()); |
83 *bitmap_result = result->TakeBitmap(); | 80 *bitmap_result = result->TakeBitmap(); |
84 quit_closure.Run(); | 81 quit_closure.Run(); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 EXPECT_EQ( | 391 EXPECT_EQ( |
395 SK_ColorMAGENTA, | 392 SK_ColorMAGENTA, |
396 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); | 393 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); |
397 EXPECT_EQ(SK_ColorMAGENTA, | 394 EXPECT_EQ(SK_ColorMAGENTA, |
398 output->getColor(interior_visible_rect.right() - 1, | 395 output->getColor(interior_visible_rect.right() - 1, |
399 interior_visible_rect.bottom() - 1)); | 396 interior_visible_rect.bottom() - 1)); |
400 } | 397 } |
401 | 398 |
402 } // namespace | 399 } // namespace |
403 } // namespace cc | 400 } // namespace cc |
OLD | NEW |