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

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

Issue 10352016: Consolidate RenderWidgetHost::CopyFromBackingStore and RenderWidgetHost::AsyncCopyFromBackingStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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 <peninputpanel_i.c> 8 #include <peninputpanel_i.c>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0); 898 ::SendMessage(tooltip_hwnd_, TTM_POP, 0, 0);
899 } 899 }
900 } 900 }
901 } 901 }
902 902
903 BackingStore* RenderWidgetHostViewWin::AllocBackingStore( 903 BackingStore* RenderWidgetHostViewWin::AllocBackingStore(
904 const gfx::Size& size) { 904 const gfx::Size& size) {
905 return new BackingStoreWin(render_widget_host_, size); 905 return new BackingStoreWin(render_widget_host_, size);
906 } 906 }
907 907
908 bool RenderWidgetHostViewWin::CopyFromCompositingSurface( 908 void RenderWidgetHostViewWin::CopyFromCompositingSurface(
909 const gfx::Size& size,
910 skia::PlatformCanvas* output) {
911 if (!accelerated_surface_.get())
912 return false;
913
914 if (size.IsEmpty())
915 return false;
916
917 if (!output->initialize(size.width(), size.height(), true))
918 return false;
919
920 return accelerated_surface_->CopyTo(
921 size, output->getTopDevice()->accessBitmap(true).getPixels());
922 }
923
924 void RenderWidgetHostViewWin::AsyncCopyFromCompositingSurface(
925 const gfx::Size& size, 909 const gfx::Size& size,
926 skia::PlatformCanvas* output, 910 skia::PlatformCanvas* output,
927 base::Callback<void(bool)> callback) { 911 base::Callback<void(bool)> callback) {
928 callback.Run(CopyFromCompositingSurface(size, output)); 912 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
913 if (!accelerated_surface_.get())
914 return;
915
916 if (size.IsEmpty())
917 return;
918
919 if (!output->initialize(size.width(), size.height(), true))
920 return;
921
922 const bool result = accelerated_surface_->CopyTo(
923 size, output->getTopDevice()->accessBitmap(true).getPixels());
924 scoped_callback_runner.Release();
925 callback.Run(result);
929 } 926 }
930 927
931 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { 928 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
932 content::RenderWidgetHostViewBase::SetBackground(background); 929 content::RenderWidgetHostViewBase::SetBackground(background);
933 render_widget_host_->SetBackground(background); 930 render_widget_host_->SetBackground(background);
934 } 931 }
935 932
936 void RenderWidgetHostViewWin::ProcessTouchAck( 933 void RenderWidgetHostViewWin::ProcessTouchAck(
937 WebKit::WebInputEvent::Type type, bool processed) { 934 WebKit::WebInputEvent::Type type, bool processed) {
938 if (type == WebKit::WebInputEvent::TouchStart) 935 if (type == WebKit::WebInputEvent::TouchStart)
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2683 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2687 // If the default focus on the page is on an edit field and we did not 2684 // If the default focus on the page is on an edit field and we did not
2688 // receive a focus change in the context of a pointer down message, it means 2685 // receive a focus change in the context of a pointer down message, it means
2689 // that the pointer down message occurred on the edit field and we should 2686 // that the pointer down message occurred on the edit field and we should
2690 // display the on screen keyboard 2687 // display the on screen keyboard
2691 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2688 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2692 DisplayOnScreenKeyboardIfNeeded(); 2689 DisplayOnScreenKeyboardIfNeeded();
2693 received_focus_change_after_pointer_down_ = false; 2690 received_focus_change_after_pointer_down_ = false;
2694 pointer_down_context_ = false; 2691 pointer_down_context_ = false;
2695 } 2692 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | content/browser/renderer_host/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698