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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 TransportDIB::Handle transport_dib) { | 847 TransportDIB::Handle transport_dib) { |
848 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 848 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
849 plugin_container_manager_.SetSizeAndTransportDIB(window, | 849 plugin_container_manager_.SetSizeAndTransportDIB(window, |
850 width, | 850 width, |
851 height, | 851 height, |
852 transport_dib); | 852 transport_dib); |
853 UpdatePluginGeometry(window, width, height); | 853 UpdatePluginGeometry(window, width, height); |
854 } | 854 } |
855 | 855 |
856 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( | 856 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
857 gfx::PluginWindowHandle window, | 857 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
858 uint64 surface_id, | |
859 int renderer_id, | |
860 int32 route_id, | |
861 int gpu_host_id) { | 858 int gpu_host_id) { |
862 TRACE_EVENT0("browser", | 859 TRACE_EVENT0("browser", |
863 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 860 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
864 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 861 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
865 AcceleratedPluginView* view = ViewForPluginWindowHandle(window); | 862 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); |
866 DCHECK(view); | 863 DCHECK(view); |
867 if (view) { | 864 if (view) { |
868 plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); | 865 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, |
| 866 params.surface_id); |
869 | 867 |
870 // The surface is hidden until its first paint, to not show gargabe. | 868 // The surface is hidden until its first paint, to not show gargabe. |
871 if (plugin_container_manager_.SurfaceShouldBeVisible(window)) | 869 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) |
872 [view setHidden:NO]; | 870 [view setHidden:NO]; |
873 [view drawView]; | 871 [view drawView]; |
874 } | 872 } |
875 | 873 |
876 if (renderer_id != 0 || route_id != 0) { | 874 if (params.renderer_id != 0 || params.route_id != 0) { |
877 AcknowledgeSwapBuffers(renderer_id, | 875 AcknowledgeSwapBuffers(params.renderer_id, |
878 route_id, | 876 params.route_id, |
879 gpu_host_id); | 877 gpu_host_id); |
880 } | 878 } |
881 } | 879 } |
882 | 880 |
883 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( | 881 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( |
884 bool show_gpu_widget) { | 882 bool show_gpu_widget) { |
885 // Plugins are destroyed on page navigate. The compositor layer on the other | 883 // Plugins are destroyed on page navigate. The compositor layer on the other |
886 // hand is created on demand and then stays alive until its renderer process | 884 // hand is created on demand and then stays alive until its renderer process |
887 // dies (usually on cross-domain navigation). Instead, only a flag | 885 // dies (usually on cross-domain navigation). Instead, only a flag |
888 // |is_accelerated_compositing_active()| is flipped when the compositor output | 886 // |is_accelerated_compositing_active()| is flipped when the compositor output |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 if (!string) return NO; | 2746 if (!string) return NO; |
2749 | 2747 |
2750 // If the user is currently using an IME, confirm the IME input, | 2748 // If the user is currently using an IME, confirm the IME input, |
2751 // and then insert the text from the service, the same as TextEdit and Safari. | 2749 // and then insert the text from the service, the same as TextEdit and Safari. |
2752 [self confirmComposition]; | 2750 [self confirmComposition]; |
2753 [self insertText:string]; | 2751 [self insertText:string]; |
2754 return YES; | 2752 return YES; |
2755 } | 2753 } |
2756 | 2754 |
2757 @end | 2755 @end |
OLD | NEW |