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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10815070: Support copying a partial rectangle region from the compositing surface on Aura and GTK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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 "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <peninputpanel_i.c> 9 #include <peninputpanel_i.c>
10 #include <stack> 10 #include <stack>
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); 1189 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0);
1190 } 1190 }
1191 } 1191 }
1192 } 1192 }
1193 1193
1194 BackingStore* RenderWidgetHostViewWin::AllocBackingStore( 1194 BackingStore* RenderWidgetHostViewWin::AllocBackingStore(
1195 const gfx::Size& size) { 1195 const gfx::Size& size) {
1196 return new BackingStoreWin(render_widget_host_, size); 1196 return new BackingStoreWin(render_widget_host_, size);
1197 } 1197 }
1198 1198
1199 // TODO(mazda): Support copying a partial rectangle from the compositing surface
1200 // with |src_subrect| (http://crbug.com/118571).
1199 void RenderWidgetHostViewWin::CopyFromCompositingSurface( 1201 void RenderWidgetHostViewWin::CopyFromCompositingSurface(
1200 const gfx::Size& size, 1202 const gfx::Rect& /* src_subrect */,
1203 const gfx::Size& dst_size,
1201 const base::Callback<void(bool)>& callback, 1204 const base::Callback<void(bool)>& callback,
1202 skia::PlatformCanvas* output) { 1205 skia::PlatformCanvas* output) {
1203 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); 1206 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
1204 if (!accelerated_surface_.get()) 1207 if (!accelerated_surface_.get())
1205 return; 1208 return;
1206 1209
1207 if (size.IsEmpty()) 1210 if (dst_size.IsEmpty())
1208 return; 1211 return;
1209 1212
1210 if (!output->initialize(size.width(), size.height(), true)) 1213 if (!output->initialize(dst_size.width(), dst_size.height(), true))
1211 return; 1214 return;
1212 1215
1213 const bool result = accelerated_surface_->CopyTo( 1216 const bool result = accelerated_surface_->CopyTo(
1214 size, output->getTopDevice()->accessBitmap(true).getPixels()); 1217 dst_size, output->getTopDevice()->accessBitmap(true).getPixels());
1215 scoped_callback_runner.Release(); 1218 scoped_callback_runner.Release();
1216 callback.Run(result); 1219 callback.Run(result);
1217 } 1220 }
1218 1221
1219 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { 1222 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
1220 RenderWidgetHostViewBase::SetBackground(background); 1223 RenderWidgetHostViewBase::SetBackground(background);
1221 render_widget_host_->SetBackground(background); 1224 render_widget_host_->SetBackground(background);
1222 } 1225 }
1223 1226
1224 void RenderWidgetHostViewWin::ProcessTouchAck( 1227 void RenderWidgetHostViewWin::ProcessTouchAck(
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 // receive a focus change in the context of a pointer down message, it means 3165 // receive a focus change in the context of a pointer down message, it means
3163 // that the pointer down message occurred on the edit field and we should 3166 // that the pointer down message occurred on the edit field and we should
3164 // display the on screen keyboard 3167 // display the on screen keyboard
3165 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3168 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3166 DisplayOnScreenKeyboardIfNeeded(); 3169 DisplayOnScreenKeyboardIfNeeded();
3167 received_focus_change_after_pointer_down_ = false; 3170 received_focus_change_after_pointer_down_ = false;
3168 pointer_down_context_ = false; 3171 pointer_down_context_ = false;
3169 } 3172 }
3170 3173
3171 } // namespace content 3174 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698