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

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

Issue 9582003: Support browser side thumbnailing for GPU composited pages on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test compilation Created 8 years, 9 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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 BackingStore* RenderWidgetHostViewWin::AllocBackingStore( 901 BackingStore* RenderWidgetHostViewWin::AllocBackingStore(
902 const gfx::Size& size) { 902 const gfx::Size& size) {
903 return new BackingStoreWin(render_widget_host_, size); 903 return new BackingStoreWin(render_widget_host_, size);
904 } 904 }
905 905
906 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) { 906 void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
907 content::RenderWidgetHostViewBase::SetBackground(background); 907 content::RenderWidgetHostViewBase::SetBackground(background);
908 render_widget_host_->SetBackground(background); 908 render_widget_host_->SetBackground(background);
909 } 909 }
910 910
911 bool RenderWidgetHostViewWin::CopyFromCompositingSurface(
912 const gfx::Size& size,
913 skia::PlatformCanvas* output) {
914 if (!accelerated_surface_.get())
915 return false;
916
917 if (size.IsEmpty())
918 return false;
919
920 std::vector<unsigned char> pixels(4 * size.GetArea());
921 if(!accelerated_surface_->CopyTo(size, &pixels))
922 return false;
923
924 SkBitmap bitmap;
925 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
926 bitmap.setPixels(&pixels[0]);
927
928 if (!output->initialize(size.width(), size.height(), true))
929 return false;
930 output->writePixels(bitmap, 0, 0);
vangelis 2012/03/08 17:34:35 Is it possible to call accelerated_surface_->CopyT
mazda 2012/03/10 07:51:37 I changed AccceleratedSurface::CopyTo to take void
931 return true;
932 }
933
911 void RenderWidgetHostViewWin::UnhandledWheelEvent( 934 void RenderWidgetHostViewWin::UnhandledWheelEvent(
912 const WebKit::WebMouseWheelEvent& event) { 935 const WebKit::WebMouseWheelEvent& event) {
913 } 936 }
914 937
915 void RenderWidgetHostViewWin::ProcessTouchAck( 938 void RenderWidgetHostViewWin::ProcessTouchAck(
916 WebKit::WebInputEvent::Type type, bool processed) { 939 WebKit::WebInputEvent::Type type, bool processed) {
917 if (type == WebKit::WebInputEvent::TouchStart) 940 if (type == WebKit::WebInputEvent::TouchStart)
918 UpdateDesiredTouchMode(processed); 941 UpdateDesiredTouchMode(processed);
919 } 942 }
920 943
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2680 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2658 // If the default focus on the page is on an edit field and we did not 2681 // If the default focus on the page is on an edit field and we did not
2659 // receive a focus change in the context of a pointer down message, it means 2682 // receive a focus change in the context of a pointer down message, it means
2660 // that the pointer down message occurred on the edit field and we should 2683 // that the pointer down message occurred on the edit field and we should
2661 // display the on screen keyboard 2684 // display the on screen keyboard
2662 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2685 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2663 DisplayOnScreenKeyboardIfNeeded(); 2686 DisplayOnScreenKeyboardIfNeeded();
2664 received_focus_change_after_pointer_down_ = false; 2687 received_focus_change_after_pointer_down_ = false;
2665 pointer_down_context_ = false; 2688 pointer_down_context_ = false;
2666 } 2689 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698