OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/shell/test_runner/pixel_dump.h" | 5 #include "content/shell/test_runner/pixel_dump.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 blink::Platform::Current()->Clipboard()->SequenceNumber( | 197 blink::Platform::Current()->Clipboard()->SequenceNumber( |
198 blink::WebClipboard::Buffer())) { | 198 blink::WebClipboard::Buffer())) { |
199 SkBitmap emptyBitmap; | 199 SkBitmap emptyBitmap; |
200 callback.Run(emptyBitmap); | 200 callback.Run(emptyBitmap); |
201 return; | 201 return; |
202 } | 202 } |
203 | 203 |
204 blink::WebImage image = static_cast<blink::WebMockClipboard*>( | 204 blink::WebImage image = static_cast<blink::WebMockClipboard*>( |
205 blink::Platform::Current()->Clipboard()) | 205 blink::Platform::Current()->Clipboard()) |
206 ->ReadRawImage(blink::WebClipboard::Buffer()); | 206 ->ReadRawImage(blink::WebClipboard::Buffer()); |
207 const SkBitmap& bitmap = image.GetSkBitmap(); | 207 callback.Run(image.GetSkBitmap()); |
208 SkAutoLockPixels autoLock(bitmap); | |
209 callback.Run(bitmap); | |
210 } | 208 } |
211 | 209 |
212 } // namespace test_runner | 210 } // namespace test_runner |
OLD | NEW |