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

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

Issue 10829054: Support copying a partial rectangle region from the compositing surface on Win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment 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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 const gfx::Size& size) { 1192 const gfx::Size& size) {
1193 return new BackingStoreWin(render_widget_host_, size); 1193 return new BackingStoreWin(render_widget_host_, size);
1194 } 1194 }
1195 1195
1196 void RenderWidgetHostViewWin::CopyFromCompositingSurface( 1196 void RenderWidgetHostViewWin::CopyFromCompositingSurface(
1197 const gfx::Rect& src_subrect, 1197 const gfx::Rect& src_subrect,
1198 const gfx::Size& dst_size, 1198 const gfx::Size& dst_size,
1199 const base::Callback<void(bool)>& callback, 1199 const base::Callback<void(bool)>& callback,
1200 skia::PlatformCanvas* output) { 1200 skia::PlatformCanvas* output) {
1201 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); 1201 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
1202 // TODO(mazda): Support copying a partial rectangle from the compositing
1203 // surface with |src_subrect| (http://crbug.com/118571).
1204 if (!src_subrect.IsEmpty()) {
1205 NOTIMPLEMENTED();
1206 return;
1207 }
1208
1209 if (!accelerated_surface_.get()) 1202 if (!accelerated_surface_.get())
1210 return; 1203 return;
1211 1204
1212 if (dst_size.IsEmpty()) 1205 if (dst_size.IsEmpty())
1213 return; 1206 return;
1214 1207
1215 if (!output->initialize(dst_size.width(), dst_size.height(), true)) 1208 if (!output->initialize(dst_size.width(), dst_size.height(), true))
1216 return; 1209 return;
1217 1210
1218 const bool result = accelerated_surface_->CopyTo( 1211 const bool result = accelerated_surface_->CopyTo(
1219 dst_size, output->getTopDevice()->accessBitmap(true).getPixels()); 1212 src_subrect,
1213 dst_size,
1214 output->getTopDevice()->accessBitmap(true).getPixels());
1220 scoped_callback_runner.Release(); 1215 scoped_callback_runner.Release();
1221 callback.Run(result); 1216 callback.Run(result);
1222 } 1217 }
1223 1218
1224 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { 1219 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
1225 RenderWidgetHostViewBase::SetBackground(background); 1220 RenderWidgetHostViewBase::SetBackground(background);
1226 render_widget_host_->SetBackground(background); 1221 render_widget_host_->SetBackground(background);
1227 } 1222 }
1228 1223
1229 void RenderWidgetHostViewWin::ProcessTouchAck( 1224 void RenderWidgetHostViewWin::ProcessTouchAck(
(...skipping 1932 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 3157 // 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 3158 // that the pointer down message occurred on the edit field and we should
3164 // display the on screen keyboard 3159 // display the on screen keyboard
3165 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3160 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3166 DisplayOnScreenKeyboardIfNeeded(); 3161 DisplayOnScreenKeyboardIfNeeded();
3167 received_focus_change_after_pointer_down_ = false; 3162 received_focus_change_after_pointer_down_ = false;
3168 pointer_down_context_ = false; 3163 pointer_down_context_ = false;
3169 } 3164 }
3170 3165
3171 } // namespace content 3166 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | ui/surface/accelerated_surface_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698