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 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 866 gfx::PluginWindowHandle window, |
| 867 uint64 surface_id, |
| 868 int renderer_id, |
| 869 int32 route_id, |
867 int gpu_host_id) { | 870 int gpu_host_id) { |
868 TRACE_EVENT0("browser", | 871 TRACE_EVENT0("browser", |
869 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 872 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
870 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 873 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
871 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); | 874 AcceleratedPluginView* view = ViewForPluginWindowHandle(window); |
872 DCHECK(view); | 875 DCHECK(view); |
873 if (view) { | 876 if (view) { |
874 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, | 877 plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); |
875 params.surface_id); | |
876 | 878 |
877 // 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. |
878 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) | 880 if (plugin_container_manager_.SurfaceShouldBeVisible(window)) |
879 [view setHidden:NO]; | 881 [view setHidden:NO]; |
880 [view drawView]; | 882 [view drawView]; |
881 } | 883 } |
882 | 884 |
883 if (params.renderer_id != 0 || params.route_id != 0) { | 885 if (renderer_id != 0 || route_id != 0) { |
884 AcknowledgeSwapBuffers(params.renderer_id, | 886 AcknowledgeSwapBuffers(renderer_id, |
885 params.route_id, | 887 route_id, |
886 gpu_host_id); | 888 gpu_host_id); |
887 } | 889 } |
888 } | 890 } |
889 | 891 |
890 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( | 892 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( |
891 bool show_gpu_widget) { | 893 bool show_gpu_widget) { |
892 // 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 |
893 // 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 |
894 // dies (usually on cross-domain navigation). Instead, only a flag | 896 // dies (usually on cross-domain navigation). Instead, only a flag |
895 // |is_accelerated_compositing_active()| is flipped when the compositor output | 897 // |is_accelerated_compositing_active()| is flipped when the compositor output |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2725 if (!string) return NO; | 2727 if (!string) return NO; |
2726 | 2728 |
2727 // If the user is currently using an IME, confirm the IME input, | 2729 // If the user is currently using an IME, confirm the IME input, |
2728 // and then insert the text from the service, the same as TextEdit and Safari. | 2730 // and then insert the text from the service, the same as TextEdit and Safari. |
2729 [self confirmComposition]; | 2731 [self confirmComposition]; |
2730 [self insertText:string]; | 2732 [self insertText:string]; |
2731 return YES; | 2733 return YES; |
2732 } | 2734 } |
2733 | 2735 |
2734 @end | 2736 @end |
OLD | NEW |