| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 TransportDIB::Handle transport_dib) { | 858 TransportDIB::Handle transport_dib) { |
| 859 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 859 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 860 plugin_container_manager_.SetSizeAndTransportDIB(window, | 860 plugin_container_manager_.SetSizeAndTransportDIB(window, |
| 861 width, | 861 width, |
| 862 height, | 862 height, |
| 863 transport_dib); | 863 transport_dib); |
| 864 UpdatePluginGeometry(window, width, height); | 864 UpdatePluginGeometry(window, width, height); |
| 865 } | 865 } |
| 866 | 866 |
| 867 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( | 867 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
| 868 gfx::PluginWindowHandle window, | 868 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| 869 uint64 surface_id, | |
| 870 int renderer_id, | |
| 871 int32 route_id, | |
| 872 int gpu_host_id) { | 869 int gpu_host_id) { |
| 873 TRACE_EVENT0("browser", | 870 TRACE_EVENT0("browser", |
| 874 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 871 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
| 875 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 872 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 876 AcceleratedPluginView* view = ViewForPluginWindowHandle(window); | 873 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); |
| 877 DCHECK(view); | 874 DCHECK(view); |
| 878 if (view) { | 875 if (view) { |
| 879 plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); | 876 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, |
| 877 params.surface_id); |
| 880 | 878 |
| 881 // The surface is hidden until its first paint, to not show gargabe. | 879 // The surface is hidden until its first paint, to not show gargabe. |
| 882 if (plugin_container_manager_.SurfaceShouldBeVisible(window)) | 880 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) |
| 883 [view setHidden:NO]; | 881 [view setHidden:NO]; |
| 884 [view drawView]; | 882 [view drawView]; |
| 885 } | 883 } |
| 886 | 884 |
| 887 if (renderer_id != 0 || route_id != 0) { | 885 if (params.renderer_id != 0 || params.route_id != 0) { |
| 888 AcknowledgeSwapBuffers(renderer_id, | 886 AcknowledgeSwapBuffers(params.renderer_id, |
| 889 route_id, | 887 params.route_id, |
| 890 gpu_host_id); | 888 gpu_host_id); |
| 891 } | 889 } |
| 892 } | 890 } |
| 893 | 891 |
| 894 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( | 892 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( |
| 895 bool show_gpu_widget) { | 893 bool show_gpu_widget) { |
| 896 // Plugins are destroyed on page navigate. The compositor layer on the other | 894 // Plugins are destroyed on page navigate. The compositor layer on the other |
| 897 // hand is created on demand and then stays alive until its renderer process | 895 // hand is created on demand and then stays alive until its renderer process |
| 898 // dies (usually on cross-domain navigation). Instead, only a flag | 896 // dies (usually on cross-domain navigation). Instead, only a flag |
| 899 // |is_accelerated_compositing_active()| is flipped when the compositor output | 897 // |is_accelerated_compositing_active()| is flipped when the compositor output |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2757 if (!string) return NO; | 2755 if (!string) return NO; |
| 2758 | 2756 |
| 2759 // If the user is currently using an IME, confirm the IME input, | 2757 // If the user is currently using an IME, confirm the IME input, |
| 2760 // and then insert the text from the service, the same as TextEdit and Safari. | 2758 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2761 [self confirmComposition]; | 2759 [self confirmComposition]; |
| 2762 [self insertText:string]; | 2760 [self insertText:string]; |
| 2763 return YES; | 2761 return YES; |
| 2764 } | 2762 } |
| 2765 | 2763 |
| 2766 @end | 2764 @end |
| OLD | NEW |