Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1001)

Side by Side Diff: ui/snapshot/snapshot_aura.cc

Issue 331453004: android: Fix inconsistent sizes in GetScaledContentBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make set_area consistent Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 18 matching lines...) Expand all
29 // Not supported in Aura. Callers should fall back to the async version. 29 // Not supported in Aura. Callers should fall back to the async version.
30 return false; 30 return false;
31 } 31 }
32 32
33 static void MakeAsyncCopyRequest( 33 static void MakeAsyncCopyRequest(
34 gfx::NativeWindow window, 34 gfx::NativeWindow window,
35 const gfx::Rect& source_rect, 35 const gfx::Rect& source_rect,
36 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) { 36 const cc::CopyOutputRequest::CopyOutputRequestCallback& callback) {
37 scoped_ptr<cc::CopyOutputRequest> request = 37 scoped_ptr<cc::CopyOutputRequest> request =
38 cc::CopyOutputRequest::CreateBitmapRequest(callback); 38 cc::CopyOutputRequest::CreateBitmapRequest(callback);
39 request->set_area(ui::ConvertRectToPixel(window->layer(), source_rect)); 39 request->set_area(source_rect);
40 window->layer()->RequestCopyOfOutput(request.Pass()); 40 window->layer()->RequestCopyOfOutput(request.Pass());
41 } 41 }
42 42
43 void GrabWindowSnapshotAndScaleAsync( 43 void GrabWindowSnapshotAndScaleAsync(
44 gfx::NativeWindow window, 44 gfx::NativeWindow window,
45 const gfx::Rect& source_rect, 45 const gfx::Rect& source_rect,
46 const gfx::Size& target_size, 46 const gfx::Size& target_size,
47 scoped_refptr<base::TaskRunner> background_task_runner, 47 scoped_refptr<base::TaskRunner> background_task_runner,
48 const GrabWindowSnapshotAsyncCallback& callback) { 48 const GrabWindowSnapshotAsyncCallback& callback) {
49 MakeAsyncCopyRequest(window, 49 MakeAsyncCopyRequest(window,
(...skipping 19 matching lines...) Expand all
69 void GrabViewSnapshotAsync( 69 void GrabViewSnapshotAsync(
70 gfx::NativeView view, 70 gfx::NativeView view,
71 const gfx::Rect& source_rect, 71 const gfx::Rect& source_rect,
72 scoped_refptr<base::TaskRunner> background_task_runner, 72 scoped_refptr<base::TaskRunner> background_task_runner,
73 const GrabWindowSnapshotAsyncPNGCallback& callback) { 73 const GrabWindowSnapshotAsyncPNGCallback& callback) {
74 GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback); 74 GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback);
75 } 75 }
76 76
77 77
78 } // namespace ui 78 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698