Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 TransportDIB::Handle transport_dib) { 848 TransportDIB::Handle transport_dib) {
849 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 849 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
850 plugin_container_manager_.SetSizeAndTransportDIB(window, 850 plugin_container_manager_.SetSizeAndTransportDIB(window,
851 width, 851 width,
852 height, 852 height,
853 transport_dib); 853 transport_dib);
854 UpdatePluginGeometry(window, width, height); 854 UpdatePluginGeometry(window, width, height);
855 } 855 }
856 856
857 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( 857 void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped(
858 gfx::PluginWindowHandle window, 858 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
859 uint64 surface_id,
860 int renderer_id,
861 int32 route_id,
862 int gpu_host_id) { 859 int gpu_host_id) {
863 TRACE_EVENT0("browser", 860 TRACE_EVENT0("browser",
864 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); 861 "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped");
865 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 862 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
866 AcceleratedPluginView* view = ViewForPluginWindowHandle(window); 863 AcceleratedPluginView* view = ViewForPluginWindowHandle(params.window);
867 DCHECK(view); 864 DCHECK(view);
868 if (view) { 865 if (view) {
869 plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); 866 plugin_container_manager_.SetSurfaceWasPaintedTo(params.window,
867 params.surface_id);
870 868
871 // The surface is hidden until its first paint, to not show gargabe. 869 // The surface is hidden until its first paint, to not show gargabe.
872 if (plugin_container_manager_.SurfaceShouldBeVisible(window)) 870 if (plugin_container_manager_.SurfaceShouldBeVisible(params.window))
873 [view setHidden:NO]; 871 [view setHidden:NO];
874 [view drawView]; 872 [view drawView];
875 } 873 }
876 874
877 if (renderer_id != 0 || route_id != 0) { 875 if (params.renderer_id != 0 || params.route_id != 0) {
878 AcknowledgeSwapBuffers(renderer_id, 876 AcknowledgeSwapBuffers(params.renderer_id,
879 route_id, 877 params.route_id,
880 gpu_host_id); 878 gpu_host_id);
881 } 879 }
882 } 880 }
883 881
884 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility( 882 void RenderWidgetHostViewMac::UpdateRootGpuViewVisibility(
885 bool show_gpu_widget) { 883 bool show_gpu_widget) {
886 // Plugins are destroyed on page navigate. The compositor layer on the other 884 // Plugins are destroyed on page navigate. The compositor layer on the other
887 // hand is created on demand and then stays alive until its renderer process 885 // hand is created on demand and then stays alive until its renderer process
888 // dies (usually on cross-domain navigation). Instead, only a flag 886 // dies (usually on cross-domain navigation). Instead, only a flag
889 // |is_accelerated_compositing_active()| is flipped when the compositor output 887 // |is_accelerated_compositing_active()| is flipped when the compositor output
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 if (!string) return NO; 2745 if (!string) return NO;
2748 2746
2749 // If the user is currently using an IME, confirm the IME input, 2747 // If the user is currently using an IME, confirm the IME input,
2750 // and then insert the text from the service, the same as TextEdit and Safari. 2748 // and then insert the text from the service, the same as TextEdit and Safari.
2751 [self confirmComposition]; 2749 [self confirmComposition];
2752 [self insertText:string]; 2750 [self insertText:string];
2753 return YES; 2751 return YES;
2754 } 2752 }
2755 2753
2756 @end 2754 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698