OLD | NEW |
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 Loading... |
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 if (!view_) | 486 if (!view_) |
486 return; | 487 return; |
487 view_->SetIsLoading(is_loading); | 488 view_->SetIsLoading(is_loading); |
488 } | 489 } |
489 | 490 |
490 bool RenderWidgetHostImpl::CopyFromBackingStore(skia::PlatformCanvas* output) { | 491 bool RenderWidgetHostImpl::CopyFromBackingStore(skia::PlatformCanvas* output) { |
491 BackingStore* backing_store = GetBackingStore(false); | 492 BackingStore* backing_store = GetBackingStore(false); |
492 if (!backing_store) | 493 if (!backing_store) |
493 return false; | 494 return false; |
494 | 495 |
| 496 TRACE_EVENT0("browser", "RenderWidgetHostImpl::CopyFromBackingStore"); |
495 return backing_store->CopyFromBackingStore( | 497 return backing_store->CopyFromBackingStore( |
496 gfx::Rect(backing_store->size()), output); | 498 gfx::Rect(backing_store->size()), output); |
497 } | 499 } |
498 | 500 |
| 501 bool RenderWidgetHostImpl::CopyFromCompositingSurface( |
| 502 const gfx::Size& size, |
| 503 skia::PlatformCanvas* output) { |
| 504 if (!is_accelerated_compositing_active_) |
| 505 return false; |
| 506 |
| 507 if (!view_) |
| 508 return false; |
| 509 |
| 510 TRACE_EVENT0("browser", "RenderWidgetHostImpl::CopyFromCompositingSurface"); |
| 511 return view_->CopyFromCompositingSurface(size, output); |
| 512 } |
| 513 |
499 #if defined(TOOLKIT_GTK) | 514 #if defined(TOOLKIT_GTK) |
500 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( | 515 bool RenderWidgetHostImpl::CopyFromBackingStoreToGtkWindow( |
501 const gfx::Rect& dest_rect, GdkWindow* target) { | 516 const gfx::Rect& dest_rect, GdkWindow* target) { |
502 BackingStore* backing_store = GetBackingStore(false); | 517 BackingStore* backing_store = GetBackingStore(false); |
503 if (!backing_store) | 518 if (!backing_store) |
504 return false; | 519 return false; |
505 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( | 520 (static_cast<BackingStoreGtk*>(backing_store))->PaintToRect( |
506 dest_rect, target); | 521 dest_rect, target); |
507 return true; | 522 return true; |
508 } | 523 } |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 | 1678 |
1664 // static | 1679 // static |
1665 void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id, | 1680 void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id, |
1666 int gpu_host_id) { | 1681 int gpu_host_id) { |
1667 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); | 1682 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); |
1668 if (ui_shim) | 1683 if (ui_shim) |
1669 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); | 1684 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); |
1670 } | 1685 } |
1671 | 1686 |
1672 } // namespace content | 1687 } // namespace content |
OLD | NEW |