| 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_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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 int gpu_host_id) { | 877 int gpu_host_id) { |
| 878 TRACE_EVENT0("browser", | 878 TRACE_EVENT0("browser", |
| 879 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); | 879 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
| 880 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 880 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 881 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); | 881 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); |
| 882 DCHECK(view); | 882 DCHECK(view); |
| 883 if (view) { | 883 if (view) { |
| 884 last_frame_was_accelerated_ = (params.window == | 884 last_frame_was_accelerated_ = (params.window == |
| 885 plugin_container_manager_.root_container_handle()); | 885 plugin_container_manager_.root_container_handle()); |
| 886 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, | 886 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window, |
| 887 params.surface_id); | 887 params.surface_handle); |
| 888 | 888 |
| 889 // The surface is hidden until its first paint, to not show garbage. | 889 // The surface is hidden until its first paint, to not show garbage. |
| 890 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) | 890 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) |
| 891 [view setHidden:NO]; | 891 [view setHidden:NO]; |
| 892 [view drawView]; | 892 [view drawView]; |
| 893 } | 893 } |
| 894 | 894 |
| 895 if (params.route_id != 0) { | 895 if (params.route_id != 0) { |
| 896 RenderWidgetHost::AcknowledgeSwapBuffers(params.route_id, gpu_host_id); | 896 RenderWidgetHost::AcknowledgeSwapBuffers(params.route_id, gpu_host_id); |
| 897 } | 897 } |
| 898 } | 898 } |
| 899 | 899 |
| 900 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( | 900 void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( |
| 901 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 901 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| 902 int gpu_host_id) { | 902 int gpu_host_id) { |
| 903 TRACE_EVENT0("browser", | 903 TRACE_EVENT0("browser", |
| 904 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); | 904 "RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer"); |
| 905 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 905 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 906 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); | 906 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window); |
| 907 DCHECK(view); | 907 DCHECK(view); |
| 908 if (view) { | 908 if (view) { |
| 909 last_frame_was_accelerated_ = (params.window == | 909 last_frame_was_accelerated_ = (params.window == |
| 910 plugin_container_manager_.root_container_handle()); | 910 plugin_container_manager_.root_container_handle()); |
| 911 plugin_container_manager_.SetSurfaceWasPaintedTo( | 911 plugin_container_manager_.SetSurfaceWasPaintedTo( |
| 912 params.window, | 912 params.window, |
| 913 params.surface_id, | 913 params.surface_handle, |
| 914 gfx::Rect(params.x, params.y, params.width, params.height)); | 914 gfx::Rect(params.x, params.y, params.width, params.height)); |
| 915 | 915 |
| 916 // The surface is hidden until its first paint, to not show garbage. | 916 // The surface is hidden until its first paint, to not show garbage. |
| 917 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) | 917 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window)) |
| 918 [view setHidden:NO]; | 918 [view setHidden:NO]; |
| 919 [view drawView]; | 919 [view drawView]; |
| 920 } | 920 } |
| 921 | 921 |
| 922 if (params.route_id != 0) { | 922 if (params.route_id != 0) { |
| 923 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id); | 923 RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id); |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2754 if (!string) return NO; | 2754 if (!string) return NO; |
| 2755 | 2755 |
| 2756 // If the user is currently using an IME, confirm the IME input, | 2756 // If the user is currently using an IME, confirm the IME input, |
| 2757 // and then insert the text from the service, the same as TextEdit and Safari. | 2757 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2758 [self confirmComposition]; | 2758 [self confirmComposition]; |
| 2759 [self insertText:string]; | 2759 [self insertText:string]; |
| 2760 return YES; | 2760 return YES; |
| 2761 } | 2761 } |
| 2762 | 2762 |
| 2763 @end | 2763 @end |
| OLD | NEW |