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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.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: Address comments 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_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 14 matching lines...) Expand all
25 #include "content/common/gpu/gpu_messages.h" 25 #include "content/common/gpu/gpu_messages.h"
26 #include "content/common/view_messages.h" 26 #include "content/common/view_messages.h"
27 #include "content/port/browser/render_widget_host_view_port.h" 27 #include "content/port/browser/render_widget_host_view_port.h"
28 #include "content/public/browser/browser_accessibility_state.h" 28 #include "content/public/browser/browser_accessibility_state.h"
29 #include "content/public/browser/native_web_keyboard_event.h" 29 #include "content/public/browser/native_web_keyboard_event.h"
30 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
31 #include "content/public/browser/notification_types.h" 31 #include "content/public/browser/notification_types.h"
32 #include "content/public/browser/user_metrics.h" 32 #include "content/public/browser/user_metrics.h"
33 #include "content/public/common/content_switches.h" 33 #include "content/public/common/content_switches.h"
34 #include "content/public/common/result_codes.h" 34 #include "content/public/common/result_codes.h"
35 #include "skia/ext/platform_canvas.h"
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
36 #include "ui/base/keycodes/keyboard_codes.h" 37 #include "ui/base/keycodes/keyboard_codes.h"
37 #include "webkit/glue/webcursor.h" 38 #include "webkit/glue/webcursor.h"
38 #include "webkit/glue/webpreferences.h" 39 #include "webkit/glue/webpreferences.h"
39 #include "webkit/plugins/npapi/webplugin.h" 40 #include "webkit/plugins/npapi/webplugin.h"
40 41
41 #if defined(TOOLKIT_GTK) 42 #if defined(TOOLKIT_GTK)
42 #include "content/browser/renderer_host/backing_store_gtk.h" 43 #include "content/browser/renderer_host/backing_store_gtk.h"
43 #elif defined(OS_MACOSX) 44 #elif defined(OS_MACOSX)
44 #include "content/browser/renderer_host/backing_store_mac.h" 45 #include "content/browser/renderer_host/backing_store_mac.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 if (!view_) 492 if (!view_)
492 return; 493 return;
493 view_->SetIsLoading(is_loading); 494 view_->SetIsLoading(is_loading);
494 } 495 }
495 496
496 bool RenderWidgetHostImpl::CopyFromBackingStore(skia::PlatformCanvas* output) { 497 bool RenderWidgetHostImpl::CopyFromBackingStore(skia::PlatformCanvas* output) {
497 BackingStore* backing_store = GetBackingStore(false); 498 BackingStore* backing_store = GetBackingStore(false);
498 if (!backing_store) 499 if (!backing_store)
499 return false; 500 return false;
500 501
502 TRACE_EVENT0("browser", "RenderWidgetHostImpl::CopyFromBackingStore");
501 return backing_store->CopyFromBackingStore( 503 return backing_store->CopyFromBackingStore(
502 gfx::Rect(backing_store->size()), output); 504 gfx::Rect(backing_store->size()), output);
503 } 505 }
504 506
507 bool RenderWidgetHostImpl::CopyFromCompositingSurface(
508 const gfx::Size& size,
509 skia::PlatformCanvas* output) {
510 if (!is_accelerated_compositing_active_)
511 return false;
512
513 if (!view_)
514 return false;
515
516 TRACE_EVENT0("browser", "RenderWidgetHostImpl::CopyFromCompositingSurface");
517 return view_->CopyFromCompositingSurface(size, output);
518 }
519
505 #if defined(TOOLKIT_GTK) 520 #if defined(TOOLKIT_GTK)
506 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( 521 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow(
507 const gfx::Rect& dest_rect, GdkWindow* target) { 522 const gfx::Rect& dest_rect, GdkWindow* target) {
508 BackingStore* backing_store = GetBackingStore(false); 523 BackingStore* backing_store = GetBackingStore(false);
509 if (!backing_store) 524 if (!backing_store)
510 return false; 525 return false;
511 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( 526 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect(
512 dest_rect, target); 527 dest_rect, target);
513 return true; 528 return true;
514 } 529 }
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 1684
1670 // static 1685 // static
1671 void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id, 1686 void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id,
1672 int gpu_host_id) { 1687 int gpu_host_id) {
1673 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); 1688 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id);
1674 if (ui_shim) 1689 if (ui_shim)
1675 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); 1690 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id));
1676 } 1691 }
1677 1692
1678 } // namespace content 1693 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698