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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 TransportDIB::Handle transport_dib) { | 856 TransportDIB::Handle transport_dib) { |
857 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 857 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
858 plugin_container_manager_.SetSizeAndTransportDIB(window, | 858 plugin_container_manager_.SetSizeAndTransportDIB(window, |
859 width, | 859 width, |
860 height, | 860 height, |
861 transport_dib); | 861 transport_dib); |
862 UpdatePluginGeometry(window, width, height); | 862 UpdatePluginGeometry(window, width, height); |
863 } | 863 } |
864 | 864 |
865 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( | 865 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
866 gfx::PluginWindowHandle window, | 866 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
867 uint64 surface_id, | |
868 int renderer_id, | |
869 int32 route_id, | |
870 int gpu_host_id) { | 867 int gpu_host_id) { |
871 TRACE_EVENT0("browser", | 868 TRACE_EVENT0("browser", |
872 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 869 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
873 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 870 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
874 AcceleratedPluginView* view = ViewForPluginWindowHandle(window); | 871 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); |
875 DCHECK(view); | 872 DCHECK(view); |
876 if (view) { | 873 if (view) { |
877 plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); | 874 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, |
| 875 params.surface_id); |
878 | 876 |
879 // The surface is hidden until its first paint, to not show gargabe. | 877 // The surface is hidden until its first paint, to not show gargabe. |
880 if (plugin_container_manager_.SurfaceShouldBeVisible(window)) | 878 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) |
881 [view setHidden:NO]; | 879 [view setHidden:NO]; |
882 [view drawView]; | 880 [view drawView]; |
883 } | 881 } |
884 | 882 |
885 if (renderer_id != 0 || route_id != 0) { | 883 if (params.renderer_id != 0 || params.route_id != 0) { |
886 AcknowledgeSwapBuffers(renderer_id, | 884 AcknowledgeSwapBuffers(params.renderer_id, |
887 route_id, | 885 params.route_id, |
888 gpu_host_id); | 886 gpu_host_id); |
889 } | 887 } |
890 } | 888 } |
891 | 889 |
892 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( | 890 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( |
893 bool show_gpu_widget) { | 891 bool show_gpu_widget) { |
894 // Plugins are destroyed on page navigate. The compositor layer on the other | 892 // Plugins are destroyed on page navigate. The compositor layer on the other |
895 // hand is created on demand and then stays alive until its renderer process | 893 // hand is created on demand and then stays alive until its renderer process |
896 // dies (usually on cross-domain navigation). Instead, only a flag | 894 // dies (usually on cross-domain navigation). Instead, only a flag |
897 // |is_accelerated_compositing_active()| is flipped when the compositor output | 895 // |is_accelerated_compositing_active()| is flipped when the compositor output |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 if (!string) return NO; | 2725 if (!string) return NO; |
2728 | 2726 |
2729 // If the user is currently using an IME, confirm the IME input, | 2727 // If the user is currently using an IME, confirm the IME input, |
2730 // and then insert the text from the service, the same as TextEdit and Safari. | 2728 // and then insert the text from the service, the same as TextEdit and Safari. |
2731 [self confirmComposition]; | 2729 [self confirmComposition]; |
2732 [self insertText:string]; | 2730 [self insertText:string]; |
2733 return YES; | 2731 return YES; |
2734 } | 2732 } |
2735 | 2733 |
2736 @end | 2734 @end |
OLD | NEW |