OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/snapshot/snapshot.h" | 5 #include "ui/snapshot/snapshot.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 std::vector<unsigned char>* png_representation, | 29 std::vector<unsigned char>* png_representation, |
30 const gfx::Rect& snapshot_bounds) { | 30 const gfx::Rect& snapshot_bounds) { |
31 // Not supported in Aura. Callers should fall back to the async version. | 31 // Not supported in Aura. Callers should fall back to the async version. |
32 return false; | 32 return false; |
33 } | 33 } |
34 | 34 |
35 static void MakeAsyncCopyRequest( | 35 static void MakeAsyncCopyRequest( |
36 gfx::NativeWindow window, | 36 gfx::NativeWindow window, |
37 const gfx::Rect& source_rect, | 37 const gfx::Rect& source_rect, |
38 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) { | 38 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) { |
39 scoped_ptr<cc::CopyOutputRequest> request = | 39 std::unique_ptr<cc::CopyOutputRequest> request = |
40 cc::CopyOutputRequest::CreateBitmapRequest(callback); | 40 cc::CopyOutputRequest::CreateBitmapRequest(callback); |
41 request->set_area(source_rect); | 41 request->set_area(source_rect); |
42 window->layer()->RequestCopyOfOutput(std::move(request)); | 42 window->layer()->RequestCopyOfOutput(std::move(request)); |
43 } | 43 } |
44 | 44 |
45 void GrabWindowSnapshotAndScaleAsync( | 45 void GrabWindowSnapshotAndScaleAsync( |
46 gfx::NativeWindow window, | 46 gfx::NativeWindow window, |
47 const gfx::Rect& source_rect, | 47 const gfx::Rect& source_rect, |
48 const gfx::Size& target_size, | 48 const gfx::Size& target_size, |
49 scoped_refptr<base::TaskRunner> background_task_runner, | 49 scoped_refptr<base::TaskRunner> background_task_runner, |
(...skipping 21 matching lines...) Expand all Loading... |
71 void GrabViewSnapshotAsync( | 71 void GrabViewSnapshotAsync( |
72 gfx::NativeView view, | 72 gfx::NativeView view, |
73 const gfx::Rect& source_rect, | 73 const gfx::Rect& source_rect, |
74 scoped_refptr<base::TaskRunner> background_task_runner, | 74 scoped_refptr<base::TaskRunner> background_task_runner, |
75 const GrabWindowSnapshotAsyncPNGCallback& callback) { | 75 const GrabWindowSnapshotAsyncPNGCallback& callback) { |
76 GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback); | 76 GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback); |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 } // namespace ui | 80 } // namespace ui |
OLD | NEW |