diff options
author | sievers <sievers@chromium.org> | 2014-09-30 13:16:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-30 20:17:08 +0000 |
commit | ef40ec9021eea9fe5122c155ff5480affa41a577 (patch) | |
tree | 41b74032703f34e45cf1589e779e767d040954b3 | |
parent | 702fdfed602988a1d404ae4c862c252d40209995 (diff) | |
download | chromium_src-ef40ec9021eea9fe5122c155ff5480affa41a577.zip chromium_src-ef40ec9021eea9fe5122c155ff5480affa41a577.tar.gz chromium_src-ef40ec9021eea9fe5122c155ff5480affa41a577.tar.bz2 |
Remove TextureImageTransportSurface
There is a lot of unreached image transport code due to
- TextureImageTransportSurface actually being unused
as a transport surface now (we either use delegated rendering
or composite-to-mailbox)
- Mac using delegated rendering
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/615503004
Cr-Commit-Position: refs/heads/master@{#297490}
33 files changed, 152 insertions, 1050 deletions
diff --git a/content/browser/compositor/browser_compositor_view_mac.mm b/content/browser/compositor/browser_compositor_view_mac.mm index 9feeefa..00fe0f5 100644 --- a/content/browser/compositor/browser_compositor_view_mac.mm +++ b/content/browser/compositor/browser_compositor_view_mac.mm @@ -91,7 +91,6 @@ void BrowserCompositorViewMac::GotAcceleratedFrame( // Acknowledge the swap, now that it has been processed. AcceleratedSurfaceMsg_BufferPresented_Params ack_params; - ack_params.sync_point = 0; ack_params.renderer_id = renderer_id; GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); if (ui_shim) { diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 478b0cb..80913c4 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc @@ -329,7 +329,7 @@ base::MessageLoopProxy* GpuProcessTransportFactory::GetCompositorMessageLoop() { gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( - gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); + gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); handle.parent_client_id = BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); return handle; diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc index 24bfcfb..6e12138 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.cc +++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc @@ -195,21 +195,6 @@ void RenderWidgetHostViewChildFrame::UnlockCompositingSurface() { } #endif -void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id, - int route_id) { -} - -void RenderWidgetHostViewChildFrame::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) { - NOTREACHED(); -} - -void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) { -} - void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { @@ -302,20 +287,13 @@ bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const { return false; } -void RenderWidgetHostViewChildFrame::AcceleratedSurfaceSuspend() { - NOTREACHED(); -} - -void RenderWidgetHostViewChildFrame::AcceleratedSurfaceRelease() { -} - bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface( const gfx::Size& desired_size) { return false; } gfx::GLSurfaceHandle RenderWidgetHostViewChildFrame::GetCompositingSurface() { - return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); + return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); } #if defined(OS_WIN) diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.h b/content/browser/frame_host/render_widget_host_view_child_frame.h index 7a2f69a..88f3b57 100644 --- a/content/browser/frame_host/render_widget_host_view_child_frame.h +++ b/content/browser/frame_host/render_widget_host_view_child_frame.h @@ -95,16 +95,6 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) OVERRIDE; virtual bool CanCopyToVideoFrame() const OVERRIDE; - virtual void AcceleratedSurfaceInitialized(int host_id, - int route_id) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfaceSuspend() OVERRIDE; - virtual void AcceleratedSurfaceRelease() OVERRIDE; virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; virtual void OnSwapCompositorFrame( uint32 output_surface_id, diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc index bea8989..982958a8 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest.cc @@ -193,18 +193,6 @@ void RenderWidgetHostViewGuest::SetTooltipText( platform_view_->SetTooltipText(tooltip_text); } -void RenderWidgetHostViewGuest::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) { - NOTREACHED(); -} - -void RenderWidgetHostViewGuest::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) { - NOTREACHED(); -} - void RenderWidgetHostViewGuest::OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { diff --git a/content/browser/frame_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_guest.h index c807f9e..c1f877e2 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.h +++ b/content/browser/frame_host/render_widget_host_view_guest.h @@ -97,12 +97,6 @@ class CONTENT_EXPORT RenderWidgetHostViewGuest const gfx::Size& dst_size, CopyFromCompositingSurfaceCallback& callback, const SkColorType color_type) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) OVERRIDE; virtual void OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc index 741368f..36e3986 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.cc +++ b/content/browser/gpu/gpu_process_host_ui_shim.cc @@ -204,19 +204,12 @@ bool GpuProcessHostUIShim::OnControlMessageReceived( IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceInitialized, OnAcceleratedSurfaceInitialized) IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, OnAcceleratedSurfaceBuffersSwapped) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfacePostSubBuffer, - OnAcceleratedSurfacePostSubBuffer) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSuspend, - OnAcceleratedSurfaceSuspend) IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, OnGraphicsInfoCollected) - IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceRelease, - OnAcceleratedSurfaceRelease) IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats, OnVideoMemoryUsageStatsReceived); IPC_MESSAGE_HANDLER(GpuHostMsg_FrameDrawn, OnFrameDrawn) @@ -250,57 +243,35 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceInitialized(int32 surface_id, GetRenderWidgetHostViewFromSurfaceID(surface_id); if (!view) return; - view->AcceleratedSurfaceInitialized(host_id_, route_id); + view->AcceleratedSurfaceInitialized(route_id); } void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) { +#if defined(OS_MACOSX) TRACE_EVENT0("renderer", "GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped"); if (!ui::LatencyInfo::Verify(params.latency_info, - "GpuHostMsg_AcceleratedSurfaceBuffersSwapped")) + "GpuHostMsg_AcceleratedSurfaceBuffersSwapped")) { return; + } -#if defined(OS_MACOSX) // On Mac with delegated rendering, accelerated surfaces are not necessarily // associated with a RenderWidgetHostViewBase. - if (IsDelegatedRendererEnabled()) { - gfx::AcceleratedWidget native_widget = - content::GpuSurfaceTracker::Get()->AcquireNativeWidget( - params.surface_id); - BrowserCompositorViewMac::GotAcceleratedFrame( - native_widget, params.surface_handle, params.surface_id, - params.latency_info, params.size, params.scale_factor, - host_id_, params.route_id); - return; - } + DCHECK(IsDelegatedRendererEnabled()); + gfx::AcceleratedWidget native_widget = + content::GpuSurfaceTracker::Get()->AcquireNativeWidget(params.surface_id); + BrowserCompositorViewMac::GotAcceleratedFrame(native_widget, + params.surface_handle, + params.surface_id, + params.latency_info, + params.size, + params.scale_factor, + host_id_, + params.route_id); +#else + NOTREACHED(); #endif - - AcceleratedSurfaceMsg_BufferPresented_Params ack_params; - ack_params.mailbox = params.mailbox; - ack_params.sync_point = 0; - ScopedSendOnIOThread delayed_send( - host_id_, - new AcceleratedSurfaceMsg_BufferPresented(params.route_id, - ack_params)); - - RenderWidgetHostViewBase* view = GetRenderWidgetHostViewFromSurfaceID( - params.surface_id); - if (!view) - return; - - delayed_send.Cancel(); - - GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params view_params = params; - - RenderWidgetHostImpl* impl = - RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); - for (size_t i = 0; i < view_params.latency_info.size(); i++) - impl->AddLatencyInfoComponentIds(&view_params.latency_info[i]); - - // View must send ACK message after next composite. - view->AcceleratedSurfaceBuffersSwapped(view_params, host_id_); - view->DidReceiveRendererFrame(); } void GpuProcessHostUIShim::OnFrameDrawn( @@ -311,61 +282,6 @@ void GpuProcessHostUIShim::OnFrameDrawn( RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); } -void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) { - TRACE_EVENT0("renderer", - "GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer"); - if (!ui::LatencyInfo::Verify(params.latency_info, - "GpuHostMsg_AcceleratedSurfacePostSubBuffer")) - return; - AcceleratedSurfaceMsg_BufferPresented_Params ack_params; - ack_params.mailbox = params.mailbox; - ack_params.sync_point = 0; - ScopedSendOnIOThread delayed_send( - host_id_, - new AcceleratedSurfaceMsg_BufferPresented(params.route_id, - ack_params)); - - RenderWidgetHostViewBase* view = - GetRenderWidgetHostViewFromSurfaceID(params.surface_id); - if (!view) - return; - - delayed_send.Cancel(); - - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params view_params = params; - - RenderWidgetHostImpl* impl = - RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); - for (size_t i = 0; i < view_params.latency_info.size(); i++) - impl->AddLatencyInfoComponentIds(&view_params.latency_info[i]); - - // View must send ACK message after next composite. - view->AcceleratedSurfacePostSubBuffer(view_params, host_id_); - view->DidReceiveRendererFrame(); -} - -void GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend(int32 surface_id) { - TRACE_EVENT0("renderer", - "GpuProcessHostUIShim::OnAcceleratedSurfaceSuspend"); - - RenderWidgetHostViewBase* view = - GetRenderWidgetHostViewFromSurfaceID(surface_id); - if (!view) - return; - - view->AcceleratedSurfaceSuspend(); -} - -void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( - const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { - RenderWidgetHostViewBase* view = GetRenderWidgetHostViewFromSurfaceID( - params.surface_id); - if (!view) - return; - view->AcceleratedSurfaceRelease(); -} - void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( const GPUVideoMemoryUsageStats& video_memory_usage_stats) { GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( diff --git a/content/browser/gpu/gpu_process_host_ui_shim.h b/content/browser/gpu/gpu_process_host_ui_shim.h index a00adde..d5f55e9 100644 --- a/content/browser/gpu/gpu_process_host_ui_shim.h +++ b/content/browser/gpu/gpu_process_host_ui_shim.h @@ -25,8 +25,6 @@ #include "ipc/ipc_sender.h" struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; -struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; -struct GpuHostMsg_AcceleratedSurfaceRelease_Params; namespace ui { struct LatencyInfo; @@ -93,11 +91,6 @@ class GpuProcessHostUIShim : public IPC::Listener, void OnAcceleratedSurfaceInitialized(int32 surface_id, int32 route_id); void OnAcceleratedSurfaceBuffersSwapped( const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); - void OnAcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params); - void OnAcceleratedSurfaceSuspend(int32 surface_id); - void OnAcceleratedSurfaceRelease( - const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); void OnVideoMemoryUsageStatsReceived( const GPUVideoMemoryUsageStats& video_memory_usage_stats); void OnFrameDrawn(const std::vector<ui::LatencyInfo>& latency_info); diff --git a/content/browser/renderer_host/render_widget_helper.h b/content/browser/renderer_host/render_widget_helper.h index 4ff2982..98b3ca6 100644 --- a/content/browser/renderer_host/render_widget_helper.h +++ b/content/browser/renderer_host/render_widget_helper.h @@ -27,7 +27,6 @@ namespace base { class TimeDelta; } -struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; struct ViewHostMsg_CreateWindow_Params; struct ViewMsg_SwapOut_Params; diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 72f86db..0a7feeb 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2024,17 +2024,6 @@ bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) { } // static -void RenderWidgetHostImpl::AcknowledgeBufferPresent( - int32 route_id, int gpu_host_id, - const AcceleratedSurfaceMsg_BufferPresented_Params& params) { - GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); - if (ui_shim) { - ui_shim->Send(new AcceleratedSurfaceMsg_BufferPresented(route_id, - params)); - } -} - -// static void RenderWidgetHostImpl::SendSwapCompositorFrameAck( int32 route_id, uint32 output_surface_id, diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 8c295b0..57b84e2 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -399,13 +399,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl virtual void UpdateVSyncParameters(base::TimeTicks timebase, base::TimeDelta interval); - // Called by the view in response to AcceleratedSurfaceBuffersSwapped or - // AcceleratedSurfacePostSubBuffer. - static void AcknowledgeBufferPresent( - int32 route_id, - int gpu_host_id, - const AcceleratedSurfaceMsg_BufferPresented_Params& params); - // Called by the view in response to OnSwapCompositorFrame. static void SendSwapCompositorFrameAck( int32 route_id, diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 986df1c..9bc21a5 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -1231,17 +1231,11 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated( #endif // defined(VIDEO_HOLE) } -void RenderWidgetHostViewAndroid::AcceleratedSurfaceInitialized(int host_id, - int route_id) { +void RenderWidgetHostViewAndroid::AcceleratedSurfaceInitialized(int route_id) { + // TODO: remove need for the surface id here accelerated_surface_route_id_ = route_id; } -void RenderWidgetHostViewAndroid::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) { - NOTREACHED() << "Need --composite-to-mailbox or --enable-delegated-renderer"; -} - void RenderWidgetHostViewAndroid::AttachLayers() { if (!content_view_core_) return; @@ -1333,20 +1327,6 @@ bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { return needs_animate; } -void RenderWidgetHostViewAndroid::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) { - NOTREACHED(); -} - -void RenderWidgetHostViewAndroid::AcceleratedSurfaceSuspend() { - NOTREACHED(); -} - -void RenderWidgetHostViewAndroid::AcceleratedSurfaceRelease() { - NOTREACHED(); -} - void RenderWidgetHostViewAndroid::EvictDelegatedFrame() { if (layer_.get()) DestroyDelegatedContent(); @@ -1375,7 +1355,7 @@ gfx::Rect RenderWidgetHostViewAndroid::GetBoundsInRootWindow() { gfx::GLSurfaceHandle RenderWidgetHostViewAndroid::GetCompositingSurface() { gfx::GLSurfaceHandle handle = - gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NATIVE_TRANSPORT); + gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); if (CompositorImpl::IsInitialized()) { handle.parent_client_id = ImageTransportFactoryAndroid::GetInstance()->GetChannelID(); diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index b1750fd..554f8f2 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h @@ -34,9 +34,6 @@ struct ViewHostMsg_TextInputState_Params; -struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; -struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; - namespace cc { class CopyOutputResult; class DelegatedFrameProvider; @@ -141,16 +138,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid const gfx::Range& range) OVERRIDE; virtual void SelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; - virtual void AcceleratedSurfaceInitialized(int host_id, - int route_id) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfaceSuspend() OVERRIDE; - virtual void AcceleratedSurfaceRelease() OVERRIDE; + virtual void AcceleratedSurfaceInitialized(int route_id) OVERRIDE; virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; virtual void SetBackgroundOpaque(bool transparent) OVERRIDE; virtual void CopyFromCompositingSurface( diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 6ad6e41..3b8bb93 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -969,10 +969,6 @@ void RenderWidgetHostViewAura::EndFrameSubscription() { delegated_frame_host_->EndFrameSubscription(); } -void RenderWidgetHostViewAura::AcceleratedSurfaceInitialized(int host_id, - int route_id) { -} - #if defined(OS_WIN) bool RenderWidgetHostViewAura::UsesNativeWindowFrame() const { return (legacy_render_widget_host_HWND_ != NULL); @@ -1013,12 +1009,6 @@ void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { } #endif -void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, - int gpu_host_id) { - // Oldschool composited mode is no longer supported. -} - void RenderWidgetHostViewAura::OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { @@ -1063,18 +1053,6 @@ gfx::NativeViewId RenderWidgetHostViewAura::GetParentForWindowlessPlugin() } #endif -void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, - int gpu_host_id) { - // Oldschool composited mode is no longer supported. -} - -void RenderWidgetHostViewAura::AcceleratedSurfaceSuspend() { -} - -void RenderWidgetHostViewAura::AcceleratedSurfaceRelease() { -} - bool RenderWidgetHostViewAura::HasAcceleratedSurface( const gfx::Size& desired_size) { // Aura doesn't use GetBackingStore for accelerated pages, so it doesn't diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 86b1242..a6c1b55 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -197,16 +197,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura virtual void BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) OVERRIDE; virtual void EndFrameSubscription() OVERRIDE; - virtual void AcceleratedSurfaceInitialized(int host_id, - int route_id) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfaceSuspend() OVERRIDE; - virtual void AcceleratedSurfaceRelease() OVERRIDE; virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index abc030f..6ccacfc 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -36,8 +36,6 @@ class SkBitmap; struct AccessibilityHostMsg_EventParams; -struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; -struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; struct ViewHostMsg_SelectionBounds_Params; struct ViewHostMsg_TextInputState_Params; @@ -289,27 +287,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // IsSurfaceAvailableForCopy() and HasAcceleratedSurface(). virtual bool CanCopyToVideoFrame() const = 0; - // Called when an accelerated compositing surface is initialized. - virtual void AcceleratedSurfaceInitialized(int host_id, int route_id) = 0; - // |params.window| and |params.surface_id| indicate which accelerated - // surface's buffers swapped. |params.renderer_id| and |params.route_id| - // are used to formulate a reply to the GPU process to prevent it from getting - // too far ahead. They may all be zero, in which case no flow control is - // enforced; this case is currently used for accelerated plugins. - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, - int gpu_host_id) = 0; - // Similar to above, except |params.(x|y|width|height)| define the region - // of the surface that changed. - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, - int gpu_host_id) = 0; - - // Release the accelerated surface temporarily. It will be recreated on the - // next swap buffers or post sub buffer. - virtual void AcceleratedSurfaceSuspend() = 0; - - virtual void AcceleratedSurfaceRelease() = 0; + // DEPRECATED. Called when an accelerated compositing surface is initialized. + virtual void AcceleratedSurfaceInitialized(int route_id) {} // Return true if the view has an accelerated surface that contains the last // presented frame for the view. If |desired_size| is non-empty, true is diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 9642baa..a3f9466 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc @@ -293,8 +293,6 @@ IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, base::Unretained(this), run_loop.QuitClosure()), kN32_SkColorType); - // Delete the surface before the callback is run. - GetRenderWidgetHostView()->AcceleratedSurfaceRelease(); run_loop.Run(); EXPECT_EQ(1, callback_invoke_count()); @@ -330,8 +328,6 @@ IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, gfx::Rect(view->GetViewBounds().size()), dest, base::Bind( &RenderWidgetHostViewBrowserTest::FinishCopyFromCompositingSurface, base::Unretained(this), run_loop.QuitClosure())); - // Delete the surface before the callback is run. - view->AcceleratedSurfaceRelease(); run_loop.Run(); EXPECT_EQ(1, callback_invoke_count()); diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index fa84570..29b4a36 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -297,8 +297,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac virtual void EndFrameSubscription() OVERRIDE; virtual void OnSwapCompositorFrame( uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; - virtual void AcceleratedSurfaceInitialized(int host_id, - int route_id) OVERRIDE; virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( BrowserAccessibilityDelegate* delegate) OVERRIDE; virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) @@ -307,14 +305,6 @@ class CONTENT_EXPORT RenderWidgetHostViewMac virtual bool PostProcessEventForPluginIme( const NativeWebKeyboardEvent& event) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfaceSuspend() OVERRIDE; - virtual void AcceleratedSurfaceRelease() OVERRIDE; virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE; virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 0d4d03c..9785c55 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1365,22 +1365,6 @@ bool RenderWidgetHostViewMac::GetCachedFirstRectForCharacterRange( return true; } -void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) { -} - -void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) { -} - -void RenderWidgetHostViewMac::AcceleratedSurfaceSuspend() { -} - -void RenderWidgetHostViewMac::AcceleratedSurfaceRelease() { -} - bool RenderWidgetHostViewMac::HasAcceleratedSurface( const gfx::Size& desired_size) { if (browser_compositor_view_) @@ -1425,10 +1409,6 @@ void RenderWidgetHostViewMac::OnSwapCompositorFrame( } } -void RenderWidgetHostViewMac::AcceleratedSurfaceInitialized(int host_id, - int route_id) { -} - void RenderWidgetHostViewMac::GetScreenInfo(blink::WebScreenInfo* results) { *results = GetWebScreenInfo(GetNativeView()); } @@ -1448,7 +1428,7 @@ gfx::Rect RenderWidgetHostViewMac::GetBoundsInRootWindow() { gfx::GLSurfaceHandle RenderWidgetHostViewMac::GetCompositingSurface() { // TODO(kbr): may be able to eliminate PluginWindowHandle argument // completely on Mac OS. - return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NATIVE_TRANSPORT); + return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); } bool RenderWidgetHostViewMac::LockMouse() { @@ -1692,13 +1672,6 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged( } - (void)dealloc { - // Unbind the GL context from this view. If this is not done before super's - // dealloc is called then the GL context will crash when it reaches into - // the view in its destructor. - // http://crbug.com/255608 - if (renderWidgetHostView_) - renderWidgetHostView_->AcceleratedSurfaceRelease(); - if (responderDelegate_ && [responderDelegate_ respondsToSelector:@selector(viewGone:)]) [responderDelegate_ viewGone:self]; diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 5612927..9429c25 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -76,40 +76,13 @@ IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) IPC_STRUCT_MEMBER(int32, surface_id) IPC_STRUCT_MEMBER(uint64, surface_handle) IPC_STRUCT_MEMBER(int32, route_id) - IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) IPC_STRUCT_MEMBER(gfx::Size, size) IPC_STRUCT_MEMBER(float, scale_factor) IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) IPC_STRUCT_END() -IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) - IPC_STRUCT_MEMBER(int32, surface_id) - IPC_STRUCT_MEMBER(uint64, surface_handle) - IPC_STRUCT_MEMBER(int32, route_id) - IPC_STRUCT_MEMBER(int, x) - IPC_STRUCT_MEMBER(int, y) - IPC_STRUCT_MEMBER(int, width) - IPC_STRUCT_MEMBER(int, height) - IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) - IPC_STRUCT_MEMBER(gfx::Size, surface_size) - IPC_STRUCT_MEMBER(float, surface_scale_factor) - IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) -IPC_STRUCT_END() - -IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) - IPC_STRUCT_MEMBER(int32, surface_id) -IPC_STRUCT_END() - IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) - IPC_STRUCT_MEMBER(gpu::Mailbox, mailbox) - IPC_STRUCT_MEMBER(uint32, sync_point) -#if defined(OS_MACOSX) IPC_STRUCT_MEMBER(int32, renderer_id) -#endif -#if defined(OS_WIN) - IPC_STRUCT_MEMBER(base::TimeTicks, vsync_timebase) - IPC_STRUCT_MEMBER(base::TimeDelta, vsync_interval) -#endif IPC_STRUCT_END() IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) @@ -406,23 +379,6 @@ IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn, IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) -// This message notifies the browser process that the renderer -// swapped a portion of the buffers associated with the given "window", which -// should cause the browser to redraw the compositor's contents. -IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer, - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) - -// Tells the browser to release whatever resources are associated with -// the given surface. The browser must send an ACK once this operation -// is complete. -IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceRelease, - GpuHostMsg_AcceleratedSurfaceRelease_Params) - -// Tells the browser to release resources for the given surface until the next -// time swap buffers or post sub buffer is sent. -IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSuspend, - int32 /* surface_id */) - // Tells the browser about updated parameters for vsync alignment. IPC_MESSAGE_CONTROL3(GpuHostMsg_UpdateVSyncParameters, int32 /* surface_id */, diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc index 19b672b..21581af 100644 --- a/content/common/gpu/image_transport_surface.cc +++ b/content/common/gpu/image_transport_surface.cc @@ -12,8 +12,8 @@ #include "content/common/gpu/gpu_channel_manager.h" #include "content/common/gpu/gpu_command_buffer_stub.h" #include "content/common/gpu/gpu_messages.h" +#include "content/common/gpu/null_transport_surface.h" #include "content/common/gpu/sync_point_manager.h" -#include "content/common/gpu/texture_image_transport_surface.h" #include "gpu/command_buffer/service/gpu_scheduler.h" #include "ui/gfx/vsync_provider.h" #include "ui/gl/gl_implementation.h" @@ -34,8 +34,8 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( GpuCommandBufferStub* stub, const gfx::GLSurfaceHandle& handle) { scoped_refptr<gfx::GLSurface> surface; - if (handle.transport_type == gfx::TEXTURE_TRANSPORT) - surface = new TextureImageTransportSurface(manager, stub, handle); + if (handle.transport_type == gfx::NULL_TRANSPORT) + surface = new NullTransportSurface(manager, stub, handle); else surface = CreateNativeSurface(manager, stub, handle); @@ -83,8 +83,6 @@ bool ImageTransportHelper::Initialize() { return true; } -void ImageTransportHelper::Destroy() {} - bool ImageTransportHelper::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(ImageTransportHelper, message) @@ -108,19 +106,6 @@ void ImageTransportHelper::SendAcceleratedSurfaceBuffersSwapped( manager_->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); } -void ImageTransportHelper::SendAcceleratedSurfacePostSubBuffer( - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params) { - params.surface_id = stub_->surface_id(); - params.route_id = route_id_; - manager_->Send(new GpuHostMsg_AcceleratedSurfacePostSubBuffer(params)); -} - -void ImageTransportHelper::SendAcceleratedSurfaceRelease() { - GpuHostMsg_AcceleratedSurfaceRelease_Params params; - params.surface_id = stub_->surface_id(); - manager_->Send(new GpuHostMsg_AcceleratedSurfaceRelease(params)); -} - void ImageTransportHelper::SendUpdateVSyncParameters( base::TimeTicks timebase, base::TimeDelta interval) { manager_->Send(new GpuHostMsg_UpdateVSyncParameters(stub_->surface_id(), @@ -175,10 +160,6 @@ void ImageTransportHelper::SetSwapInterval(gfx::GLContext* context) { context->SetSwapInterval(1); } -void ImageTransportHelper::Suspend() { - manager_->Send(new GpuHostMsg_AcceleratedSurfaceSuspend(stub_->surface_id())); -} - gpu::GpuScheduler* ImageTransportHelper::Scheduler() { if (!stub_.get()) return NULL; @@ -232,7 +213,6 @@ bool PassThroughImageTransportSurface::Initialize() { } void PassThroughImageTransportSurface::Destroy() { - helper_->Destroy(); GLSurfaceAdapter::Destroy(); } diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h index 16dfa96..d23aca1 100644 --- a/content/common/gpu/image_transport_surface.h +++ b/content/common/gpu/image_transport_surface.h @@ -23,7 +23,6 @@ struct AcceleratedSurfaceMsg_BufferPresented_Params; struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; -struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; namespace gfx { class GLSurface; @@ -108,7 +107,6 @@ class ImageTransportHelper virtual ~ImageTransportHelper(); bool Initialize(); - void Destroy(); // IPC::Listener implementation: virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; @@ -117,9 +115,6 @@ class ImageTransportHelper // like size and surface id. The helper fills in the rest. void SendAcceleratedSurfaceBuffersSwapped( GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params); - void SendAcceleratedSurfacePostSubBuffer( - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params); - void SendAcceleratedSurfaceRelease(); void SendUpdateVSyncParameters( base::TimeTicks timebase, base::TimeDelta interval); @@ -139,8 +134,6 @@ class ImageTransportHelper // Set the default swap interval on the surface. static void SetSwapInterval(gfx::GLContext* context); - void Suspend(); - GpuChannelManager* manager() const { return manager_; } GpuCommandBufferStub* stub() const { return stub_.get(); } diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc index 5e0d6ff..29e1cae 100644 --- a/content/common/gpu/image_transport_surface_android.cc +++ b/content/common/gpu/image_transport_surface_android.cc @@ -10,7 +10,7 @@ #include "content/common/gpu/gpu_channel_manager.h" #include "content/common/gpu/gpu_command_buffer_stub.h" #include "content/common/gpu/gpu_surface_lookup.h" -#include "content/common/gpu/image_transport_surface.h" +#include "content/common/gpu/null_transport_surface.h" #include "content/public/common/content_switches.h" #include "ui/gl/gl_surface_egl.h" @@ -31,17 +31,14 @@ void DidAccessGpu() { } class ImageTransportSurfaceAndroid - : public PassThroughImageTransportSurface, + : public NullTransportSurface, public base::SupportsWeakPtr<ImageTransportSurfaceAndroid> { public: ImageTransportSurfaceAndroid(GpuChannelManager* manager, GpuCommandBufferStub* stub, - gfx::GLSurface* surface, - uint32 parent_client_id); + const gfx::GLSurfaceHandle& handle); // gfx::GLSurface implementation. - virtual bool Initialize() OVERRIDE; - virtual bool SwapBuffers() OVERRIDE; virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; virtual void WakeUpGpu() OVERRIDE; @@ -52,7 +49,6 @@ class ImageTransportSurfaceAndroid void ScheduleWakeUp(); void DoWakeUpGpu(); - uint32 parent_client_id_; base::TimeTicks begin_wake_up_time_; }; @@ -75,42 +71,16 @@ class DirectSurfaceAndroid : public PassThroughImageTransportSurface { ImageTransportSurfaceAndroid::ImageTransportSurfaceAndroid( GpuChannelManager* manager, GpuCommandBufferStub* stub, - gfx::GLSurface* surface, - uint32 parent_client_id) - : PassThroughImageTransportSurface(manager, stub, surface), - parent_client_id_(parent_client_id) {} + const gfx::GLSurfaceHandle& handle) + : NullTransportSurface(manager, stub, handle) {} ImageTransportSurfaceAndroid::~ImageTransportSurfaceAndroid() {} -bool ImageTransportSurfaceAndroid::Initialize() { - if (!surface()) - return false; - - if (!PassThroughImageTransportSurface::Initialize()) - return false; - - GpuChannel* parent_channel = - GetHelper()->manager()->LookupChannel(parent_client_id_); - if (parent_channel) { - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) - GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); - } - - return true; -} - bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) { DidAccessGpu(); return true; } -bool ImageTransportSurfaceAndroid::SwapBuffers() { - NOTREACHED(); - return false; -} - void ImageTransportSurfaceAndroid::WakeUpGpu() { begin_wake_up_time_ = base::TimeTicks::Now(); ScheduleWakeUp(); @@ -165,12 +135,9 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( GpuChannelManager* manager, GpuCommandBufferStub* stub, const gfx::GLSurfaceHandle& handle) { - if (handle.transport_type == gfx::NATIVE_TRANSPORT) { + if (handle.transport_type == gfx::NULL_TRANSPORT) { return scoped_refptr<gfx::GLSurface>( - new ImageTransportSurfaceAndroid(manager, - stub, - manager->GetDefaultOffscreenSurface(), - handle.parent_client_id)); + new ImageTransportSurfaceAndroid(manager, stub, handle)); } DCHECK(GpuSurfaceLookup::GetInstance()); diff --git a/content/common/gpu/image_transport_surface_fbo_mac.mm b/content/common/gpu/image_transport_surface_fbo_mac.mm index 343ee83..4fea7bc 100644 --- a/content/common/gpu/image_transport_surface_fbo_mac.mm +++ b/content/common/gpu/image_transport_surface_fbo_mac.mm @@ -56,8 +56,6 @@ bool ImageTransportSurfaceFBO::Initialize() { void ImageTransportSurfaceFBO::Destroy() { DestroyFramebuffer(); - - helper_->Destroy(); } bool ImageTransportSurfaceFBO::DeferDraws() { @@ -111,7 +109,6 @@ void ImageTransportSurfaceFBO::AdjustBufferAllocation() { !frontbuffer_suggested_allocation_ && has_complete_framebuffer_) { DestroyFramebuffer(); - helper_->Suspend(); } else if (backbuffer_suggested_allocation_ && !has_complete_framebuffer_) { CreateFramebuffer(); } diff --git a/content/common/gpu/image_transport_surface_mac.mm b/content/common/gpu/image_transport_surface_mac.mm index 3a48063..0b80799 100644 --- a/content/common/gpu/image_transport_surface_mac.mm +++ b/content/common/gpu/image_transport_surface_mac.mm @@ -43,7 +43,7 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface( GpuCommandBufferStub* stub, const gfx::GLSurfaceHandle& surface_handle) { DCHECK(surface_handle.transport_type == gfx::NATIVE_DIRECT || - surface_handle.transport_type == gfx::NATIVE_TRANSPORT); + surface_handle.transport_type == gfx::NULL_TRANSPORT); switch (gfx::GetGLImplementation()) { case gfx::kGLImplementationDesktopGL: diff --git a/content/common/gpu/null_transport_surface.cc b/content/common/gpu/null_transport_surface.cc new file mode 100644 index 0000000..d544d4d --- /dev/null +++ b/content/common/gpu/null_transport_surface.cc @@ -0,0 +1,67 @@ +// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/common/gpu/null_transport_surface.h" + +#include "base/command_line.h" +#include "content/common/gpu/gpu_channel.h" +#include "content/common/gpu/gpu_channel_manager.h" +#include "content/common/gpu/gpu_command_buffer_stub.h" +#include "content/public/common/content_switches.h" +#include "gpu/command_buffer/service/context_group.h" + +namespace content { + +NullTransportSurface::NullTransportSurface( + GpuChannelManager* manager, + GpuCommandBufferStub* stub, + const gfx::GLSurfaceHandle& handle) + : PassThroughImageTransportSurface(manager, + stub, + manager->GetDefaultOffscreenSurface()), + parent_client_id_(handle.parent_client_id) { +} + +NullTransportSurface::~NullTransportSurface() { +} + +bool NullTransportSurface::Initialize() { + if (!surface()) + return false; + + if (!PassThroughImageTransportSurface::Initialize()) + return false; + + GpuChannel* parent_channel = + GetHelper()->manager()->LookupChannel(parent_client_id_); + if (parent_channel) { + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) + GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); + } + + return true; +} + +void NullTransportSurface::Destroy() { + // Do not destroy |surface_| since we use the shared offscreen surface. +} + +bool NullTransportSurface::SwapBuffers() { + NOTIMPLEMENTED(); + return false; +} + +bool NullTransportSurface::PostSubBuffer( + int x, int y, int width, int height) { + NOTIMPLEMENTED(); + return false; +} + +void NullTransportSurface::SendVSyncUpdateIfAvailable() { + NOTREACHED(); +} + +} // namespace content diff --git a/content/common/gpu/null_transport_surface.h b/content/common/gpu/null_transport_surface.h new file mode 100644 index 0000000..158283c --- /dev/null +++ b/content/common/gpu/null_transport_surface.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_ +#define CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_ + +#include "base/basictypes.h" +#include "content/common/gpu/image_transport_surface.h" +#include "ui/gfx/native_widget_types.h" + +namespace content { + +// Used when the GPU process is not involved in frame transport, but frame +// resources are exchanged between client and target directly (such as in +// delegated rendering). +class NullTransportSurface : public PassThroughImageTransportSurface { + public: + NullTransportSurface(GpuChannelManager* manager, + GpuCommandBufferStub* stub, + const gfx::GLSurfaceHandle& handle); + + // gfx::GLSurface implementation. + virtual bool Initialize() OVERRIDE; + virtual void Destroy() OVERRIDE; + virtual bool SwapBuffers() OVERRIDE; + virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; + + protected: + virtual ~NullTransportSurface(); + + virtual void SendVSyncUpdateIfAvailable() OVERRIDE; + + private: + uint32 parent_client_id_; + + DISALLOW_COPY_AND_ASSIGN(NullTransportSurface); +}; + +} // namespace content + +#endif // CONTENT_COMMON_GPU_NULL_TRANSPORT_SURFACE_H_ diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc deleted file mode 100644 index f51f545..0000000 --- a/content/common/gpu/texture_image_transport_surface.cc +++ /dev/null @@ -1,460 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/common/gpu/texture_image_transport_surface.h" - -#include <string> -#include <vector> - -#include "base/command_line.h" -#include "content/common/gpu/gpu_channel.h" -#include "content/common/gpu/gpu_channel_manager.h" -#include "content/common/gpu/gpu_messages.h" -#include "content/common/gpu/sync_point_manager.h" -#include "content/public/common/content_switches.h" -#include "gpu/command_buffer/service/context_group.h" -#include "gpu/command_buffer/service/gpu_scheduler.h" -#include "gpu/command_buffer/service/mailbox_manager.h" -#include "ui/gl/scoped_binders.h" - -using gpu::gles2::ContextGroup; -using gpu::gles2::GLES2Decoder; -using gpu::gles2::MailboxManager; -using gpu::gles2::Texture; -using gpu::gles2::TextureManager; -using gpu::gles2::TextureRef; -using gpu::Mailbox; - -namespace content { -namespace { - -bool IsContextValid(ImageTransportHelper* helper) { - return helper->stub()->decoder()->GetGLContext()->IsCurrent(NULL); -} - -} // namespace - -TextureImageTransportSurface::TextureImageTransportSurface( - GpuChannelManager* manager, - GpuCommandBufferStub* stub, - const gfx::GLSurfaceHandle& handle) - : fbo_id_(0), - current_size_(1, 1), - scale_factor_(1.f), - stub_destroyed_(false), - backbuffer_suggested_allocation_(true), - frontbuffer_suggested_allocation_(true), - handle_(handle), - is_swap_buffers_pending_(false), - did_unschedule_(false) { - helper_.reset(new ImageTransportHelper(this, - manager, - stub, - gfx::kNullPluginWindow)); -} - -TextureImageTransportSurface::~TextureImageTransportSurface() { - DCHECK(stub_destroyed_); - Destroy(); -} - -bool TextureImageTransportSurface::Initialize() { - mailbox_manager_ = - helper_->stub()->decoder()->GetContextGroup()->mailbox_manager(); - - GpuChannelManager* manager = helper_->manager(); - surface_ = manager->GetDefaultOffscreenSurface(); - if (!surface_.get()) - return false; - - if (!helper_->Initialize()) - return false; - - GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); - if (parent_channel) { - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) - helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); - } - - return true; -} - -void TextureImageTransportSurface::Destroy() { - if (surface_.get()) - surface_ = NULL; - - helper_->Destroy(); -} - -bool TextureImageTransportSurface::DeferDraws() { - // The command buffer hit a draw/clear command that could clobber the - // texture in use by the UI compositor. If a Swap is pending, abort - // processing of the command by returning true and unschedule until the Swap - // Ack arrives. - DCHECK(!did_unschedule_); - if (is_swap_buffers_pending_) { - did_unschedule_ = true; - helper_->SetScheduled(false); - return true; - } - return false; -} - -bool TextureImageTransportSurface::IsOffscreen() { - return true; -} - -unsigned int TextureImageTransportSurface::GetBackingFrameBufferObject() { - DCHECK(IsContextValid(helper_.get())); - if (!fbo_id_) { - glGenFramebuffersEXT(1, &fbo_id_); - glBindFramebufferEXT(GL_FRAMEBUFFER, fbo_id_); - helper_->stub()->AddDestructionObserver(this); - CreateBackTexture(); - } - - return fbo_id_; -} - -bool TextureImageTransportSurface::SetBackbufferAllocation(bool allocation) { - DCHECK(!is_swap_buffers_pending_); - if (backbuffer_suggested_allocation_ == allocation) - return true; - backbuffer_suggested_allocation_ = allocation; - - if (backbuffer_suggested_allocation_) { - DCHECK(!backbuffer_.get()); - CreateBackTexture(); - } else { - ReleaseBackTexture(); - } - - return true; -} - -void TextureImageTransportSurface::SetFrontbufferAllocation(bool allocation) { - if (frontbuffer_suggested_allocation_ == allocation) - return; - frontbuffer_suggested_allocation_ = allocation; - - // If a swapbuffers is in flight, wait for the ack before releasing the front - // buffer: - // - we don't know yet which texture the browser will want to keep - // - we want to ensure we don't destroy a texture that is in flight before the - // browser got a reference on it. - if (!frontbuffer_suggested_allocation_ && - !is_swap_buffers_pending_ && - helper_->MakeCurrent()) { - ReleaseFrontTexture(); - } -} - -void* TextureImageTransportSurface::GetShareHandle() { - return GetHandle(); -} - -void* TextureImageTransportSurface::GetDisplay() { - return surface_.get() ? surface_->GetDisplay() : NULL; -} - -void* TextureImageTransportSurface::GetConfig() { - return surface_.get() ? surface_->GetConfig() : NULL; -} - -void TextureImageTransportSurface::OnResize(gfx::Size size, - float scale_factor) { - DCHECK_GE(size.width(), 1); - DCHECK_GE(size.height(), 1); - current_size_ = size; - scale_factor_ = scale_factor; - if (backbuffer_suggested_allocation_) - CreateBackTexture(); -} - -void TextureImageTransportSurface::OnWillDestroyStub() { - bool have_context = IsContextValid(helper_.get()); - helper_->stub()->RemoveDestructionObserver(this); - - // We are losing the stub owning us, this is our last chance to clean up the - // resources we allocated in the stub's context. - if (have_context) { - ReleaseBackTexture(); - ReleaseFrontTexture(); - } else { - backbuffer_ = NULL; - back_mailbox_ = Mailbox(); - frontbuffer_ = NULL; - front_mailbox_ = Mailbox(); - } - - if (fbo_id_ && have_context) { - glDeleteFramebuffersEXT(1, &fbo_id_); - CHECK_GL_ERROR(); - } - fbo_id_ = 0; - - stub_destroyed_ = true; -} - -void TextureImageTransportSurface::SetLatencyInfo( - const std::vector<ui::LatencyInfo>& latency_info) { - for (size_t i = 0; i < latency_info.size(); i++) - latency_info_.push_back(latency_info[i]); -} - -void TextureImageTransportSurface::WakeUpGpu() { - NOTIMPLEMENTED(); -} - -bool TextureImageTransportSurface::SwapBuffers() { - DCHECK(IsContextValid(helper_.get())); - DCHECK(backbuffer_suggested_allocation_); - - if (!frontbuffer_suggested_allocation_) - return true; - - if (!backbuffer_.get()) { - LOG(ERROR) << "Swap without valid backing."; - return true; - } - - DCHECK(backbuffer_size() == current_size_); - GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; - params.size = backbuffer_size(); - params.scale_factor = scale_factor_; - params.mailbox = back_mailbox_; - - glFlush(); - - params.latency_info.swap(latency_info_); - helper_->SendAcceleratedSurfaceBuffersSwapped(params); - - DCHECK(!is_swap_buffers_pending_); - is_swap_buffers_pending_ = true; - return true; -} - -bool TextureImageTransportSurface::PostSubBuffer( - int x, int y, int width, int height) { - DCHECK(IsContextValid(helper_.get())); - DCHECK(backbuffer_suggested_allocation_); - if (!frontbuffer_suggested_allocation_) - return true; - const gfx::Rect new_damage_rect(x, y, width, height); - DCHECK(gfx::Rect(gfx::Point(), current_size_).Contains(new_damage_rect)); - - // An empty damage rect is a successful no-op. - if (new_damage_rect.IsEmpty()) - return true; - - if (!backbuffer_.get()) { - LOG(ERROR) << "Swap without valid backing."; - return true; - } - - DCHECK(current_size_ == backbuffer_size()); - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params; - params.surface_size = backbuffer_size(); - params.surface_scale_factor = scale_factor_; - params.x = x; - params.y = y; - params.width = width; - params.height = height; - params.mailbox = back_mailbox_; - - glFlush(); - - params.latency_info.swap(latency_info_); - helper_->SendAcceleratedSurfacePostSubBuffer(params); - - DCHECK(!is_swap_buffers_pending_); - is_swap_buffers_pending_ = true; - return true; -} - -bool TextureImageTransportSurface::SupportsPostSubBuffer() { - return true; -} - -gfx::Size TextureImageTransportSurface::GetSize() { - return current_size_; -} - -void* TextureImageTransportSurface::GetHandle() { - return surface_.get() ? surface_->GetHandle() : NULL; -} - -unsigned TextureImageTransportSurface::GetFormat() { - return surface_.get() ? surface_->GetFormat() : 0; -} - -void TextureImageTransportSurface::OnBufferPresented( - const AcceleratedSurfaceMsg_BufferPresented_Params& params) { - if (params.sync_point == 0) { - BufferPresentedImpl(params.mailbox); - } else { - helper_->manager()->sync_point_manager()->AddSyncPointCallback( - params.sync_point, - base::Bind(&TextureImageTransportSurface::BufferPresentedImpl, - this, - params.mailbox)); - } -} - -void TextureImageTransportSurface::BufferPresentedImpl(const Mailbox& mailbox) { - DCHECK(is_swap_buffers_pending_); - is_swap_buffers_pending_ = false; - - // When we wait for a sync point, we may get called back after the stub is - // destroyed. In that case there's no need to do anything with the returned - // mailbox. - if (stub_destroyed_) - return; - - // We should not have allowed the backbuffer to be discarded while the ack - // was pending. - DCHECK(backbuffer_suggested_allocation_); - DCHECK(backbuffer_.get()); - - bool swap = true; - if (!mailbox.IsZero()) { - if (mailbox == back_mailbox_) { - // The browser has skipped the frame to unblock the GPU process, waiting - // for one of the right size, and returned the back buffer, so don't swap. - swap = false; - } - } - if (swap) { - std::swap(backbuffer_, frontbuffer_); - std::swap(back_mailbox_, front_mailbox_); - } - - // We're relying on the fact that the parent context is - // finished with its context when it inserts the sync point that - // triggers this callback. - if (helper_->MakeCurrent()) { - if (frontbuffer_.get() && !frontbuffer_suggested_allocation_) - ReleaseFrontTexture(); - if (!backbuffer_.get() || backbuffer_size() != current_size_) - CreateBackTexture(); - else - AttachBackTextureToFBO(); - } - - // Even if MakeCurrent fails, schedule anyway, to trigger the lost context - // logic. - if (did_unschedule_) { - did_unschedule_ = false; - helper_->SetScheduled(true); - } -} - -void TextureImageTransportSurface::ReleaseBackTexture() { - DCHECK(IsContextValid(helper_.get())); - backbuffer_ = NULL; - back_mailbox_ = Mailbox(); - glFlush(); - CHECK_GL_ERROR(); -} - -void TextureImageTransportSurface::ReleaseFrontTexture() { - DCHECK(IsContextValid(helper_.get())); - frontbuffer_ = NULL; - front_mailbox_ = Mailbox(); - glFlush(); - CHECK_GL_ERROR(); - helper_->SendAcceleratedSurfaceRelease(); -} - -void TextureImageTransportSurface::CreateBackTexture() { - DCHECK(IsContextValid(helper_.get())); - // If |is_swap_buffers_pending| we are waiting for our backbuffer - // in the mailbox, so we shouldn't be reallocating it now. - DCHECK(!is_swap_buffers_pending_); - - if (backbuffer_.get() && backbuffer_size() == current_size_) - return; - - VLOG(1) << "Allocating new backbuffer texture"; - - GLES2Decoder* decoder = helper_->stub()->decoder(); - TextureManager* texture_manager = - decoder->GetContextGroup()->texture_manager(); - if (!backbuffer_.get()) { - back_mailbox_ = gpu::Mailbox::Generate(); - GLuint service_id; - glGenTextures(1, &service_id); - backbuffer_ = TextureRef::Create(texture_manager, 0, service_id); - texture_manager->SetTarget(backbuffer_.get(), GL_TEXTURE_2D); - Texture* texture = texture_manager->Produce(backbuffer_.get()); - mailbox_manager_->ProduceTexture(GL_TEXTURE_2D, back_mailbox_, texture); - } - - { - gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, - backbuffer_->service_id()); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - current_size_.width(), current_size_.height(), 0, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); - gpu::gles2::ErrorState* error_state = decoder->GetErrorState(); - texture_manager->SetParameteri("Backbuffer", - error_state, - backbuffer_.get(), - GL_TEXTURE_MIN_FILTER, - GL_LINEAR); - texture_manager->SetParameteri("Backbuffer", - error_state, - backbuffer_.get(), - GL_TEXTURE_MAG_FILTER, - GL_LINEAR); - texture_manager->SetParameteri("Backbuffer", - error_state, - backbuffer_.get(), - GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - texture_manager->SetParameteri("Backbuffer", - error_state, - backbuffer_.get(), - GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); - texture_manager->SetLevelInfo(backbuffer_.get(), - GL_TEXTURE_2D, - 0, - GL_RGBA, - current_size_.width(), - current_size_.height(), - 1, - 0, - GL_RGBA, - GL_UNSIGNED_BYTE, - true); - DCHECK(texture_manager->CanRender(backbuffer_.get())); - CHECK_GL_ERROR(); - } - - AttachBackTextureToFBO(); -} - -void TextureImageTransportSurface::AttachBackTextureToFBO() { - DCHECK(IsContextValid(helper_.get())); - DCHECK(backbuffer_.get()); - gfx::ScopedFrameBufferBinder fbo_binder(fbo_id_); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - GL_TEXTURE_2D, - backbuffer_->service_id(), - 0); - CHECK_GL_ERROR(); - -#ifndef NDEBUG - GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); - if (status != GL_FRAMEBUFFER_COMPLETE) { - DLOG(FATAL) << "Framebuffer incomplete: " << status; - } -#endif -} - -} // namespace content diff --git a/content/common/gpu/texture_image_transport_surface.h b/content/common/gpu/texture_image_transport_surface.h deleted file mode 100644 index dec6b35..0000000 --- a/content/common/gpu/texture_image_transport_surface.h +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ -#define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ - -#include <string> - -#include "base/basictypes.h" -#include "base/memory/scoped_ptr.h" -#include "content/common/gpu/gpu_command_buffer_stub.h" -#include "content/common/gpu/image_transport_surface.h" -#include "gpu/command_buffer/common/mailbox.h" -#include "gpu/command_buffer/service/texture_manager.h" -#include "ui/gl/gl_context.h" -#include "ui/gl/gl_surface.h" - -namespace content { -class GpuChannelManager; - -class TextureImageTransportSurface - : public ImageTransportSurface, - public GpuCommandBufferStub::DestructionObserver, - public gfx::GLSurface { - public: - TextureImageTransportSurface(GpuChannelManager* manager, - GpuCommandBufferStub* stub, - const gfx::GLSurfaceHandle& handle); - - // gfx::GLSurface implementation. - virtual bool Initialize() OVERRIDE; - virtual void Destroy() OVERRIDE; - virtual bool DeferDraws() OVERRIDE; - virtual bool IsOffscreen() OVERRIDE; - virtual bool SwapBuffers() OVERRIDE; - virtual gfx::Size GetSize() OVERRIDE; - virtual void* GetHandle() OVERRIDE; - virtual unsigned GetFormat() OVERRIDE; - virtual bool SupportsPostSubBuffer() OVERRIDE; - virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; - virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; - virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; - virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; - virtual void* GetShareHandle() OVERRIDE; - virtual void* GetDisplay() OVERRIDE; - virtual void* GetConfig() OVERRIDE; - - protected: - // ImageTransportSurface implementation. - virtual void OnBufferPresented( - const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; - virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE; - virtual void SetLatencyInfo( - const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE; - virtual void WakeUpGpu() OVERRIDE; - - // GpuCommandBufferStub::DestructionObserver implementation. - virtual void OnWillDestroyStub() OVERRIDE; - - private: - - gfx::Size backbuffer_size() const { - DCHECK(backbuffer_.get()); - GLsizei width = 0; - GLsizei height = 0; - backbuffer_->texture()->GetLevelSize(GL_TEXTURE_2D, 0, &width, &height); - return gfx::Size(width, height); - } - - virtual ~TextureImageTransportSurface(); - void CreateBackTexture(); - void AttachBackTextureToFBO(); - void ReleaseBackTexture(); - void ReleaseFrontTexture(); - void BufferPresentedImpl(const gpu::Mailbox& mailbox_name); - - // The framebuffer that represents this surface (service id). Allocated lazily - // in OnMakeCurrent. - uint32 fbo_id_; - - // The current backbuffer. - scoped_refptr<gpu::gles2::TextureRef> backbuffer_; - scoped_refptr<gpu::gles2::TextureRef> frontbuffer_; - - // The mailbox name for the current backbuffer texture. Needs to be unique per - // GL texture and is invalid while service_id is zero. - gpu::Mailbox back_mailbox_; - gpu::Mailbox front_mailbox_; - - // The current size of the GLSurface. Used to disambiguate from the current - // texture size which might be outdated (since we use two buffers). - gfx::Size current_size_; - float scale_factor_; - - // Whether or not the command buffer stub has been destroyed. - bool stub_destroyed_; - - bool backbuffer_suggested_allocation_; - bool frontbuffer_suggested_allocation_; - - scoped_ptr<ImageTransportHelper> helper_; - gfx::GLSurfaceHandle handle_; - - // The offscreen surface used to make the context current. However note that - // the actual rendering is always redirected to an FBO. - scoped_refptr<gfx::GLSurface> surface_; - - // Whether a SwapBuffers is pending. - bool is_swap_buffers_pending_; - - // Whether we unscheduled command buffer because of pending SwapBuffers. - bool did_unschedule_; - - // Holds a reference to the mailbox manager for cleanup. - scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; - - std::vector<ui::LatencyInfo> latency_info_; - DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); -}; - -} // namespace content - -#endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ diff --git a/content/content_common.gypi b/content/content_common.gypi index c902ca7..95ca603 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -314,14 +314,14 @@ 'common/gpu/media/gpu_video_decode_accelerator.h', 'common/gpu/media/gpu_video_encode_accelerator.cc', 'common/gpu/media/gpu_video_encode_accelerator.h', + 'common/gpu/null_transport_surface.cc', + 'common/gpu/null_transport_surface.h', 'common/gpu/stream_texture_android.cc', 'common/gpu/stream_texture_android.h', 'common/gpu/surface_handle_types_mac.cc', 'common/gpu/surface_handle_types_mac.h', 'common/gpu/sync_point_manager.cc', 'common/gpu/sync_point_manager.h', - 'common/gpu/texture_image_transport_surface.cc', - 'common/gpu/texture_image_transport_surface.h', 'common/handle_enumerator_win.cc', 'common/handle_enumerator_win.h', 'common/host_shared_bitmap_manager.cc', diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc index fefc269..73356d7 100644 --- a/content/test/test_render_view_host.cc +++ b/content/test/test_render_view_host.cc @@ -127,23 +127,6 @@ bool TestRenderWidgetHostView::CanCopyToVideoFrame() const { return false; } -void TestRenderWidgetHostView::AcceleratedSurfaceInitialized(int host_id, - int route_id) { -} - -void TestRenderWidgetHostView::AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) { -} - -void TestRenderWidgetHostView::AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) { -} - -void TestRenderWidgetHostView::AcceleratedSurfaceSuspend() { -} - bool TestRenderWidgetHostView::HasAcceleratedSurface( const gfx::Size& desired_size) { return false; diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h index 7f22c7f..14ec879 100644 --- a/content/test/test_render_view_host.h +++ b/content/test/test_render_view_host.h @@ -123,16 +123,6 @@ class TestRenderWidgetHostView : public RenderWidgetHostViewBase { const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) OVERRIDE; virtual bool CanCopyToVideoFrame() const OVERRIDE; - virtual void AcceleratedSurfaceInitialized(int host_id, - int route_id) OVERRIDE; - virtual void AcceleratedSurfaceBuffersSwapped( - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfacePostSubBuffer( - const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, - int gpu_host_id) OVERRIDE; - virtual void AcceleratedSurfaceSuspend() OVERRIDE; - virtual void AcceleratedSurfaceRelease() OVERRIDE {} virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; #if defined(OS_MACOSX) virtual bool PostProcessEventForPluginIme( diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h index 4a4fb33..4341b1c 100644 --- a/ui/gfx/native_widget_types.h +++ b/ui/gfx/native_widget_types.h @@ -217,9 +217,8 @@ typedef intptr_t NativeViewId; enum SurfaceType { EMPTY, NATIVE_DIRECT, - NATIVE_TRANSPORT, - TEXTURE_TRANSPORT, - SURFACE_TYPE_LAST = TEXTURE_TRANSPORT + NULL_TRANSPORT, + SURFACE_TYPE_LAST = NULL_TRANSPORT }; struct GLSurfaceHandle { @@ -233,13 +232,12 @@ struct GLSurfaceHandle { transport_type(transport_), parent_client_id(0) { DCHECK(!is_null() || handle == kNullPluginWindow); - DCHECK(transport_type != TEXTURE_TRANSPORT || + DCHECK(transport_type != NULL_TRANSPORT || handle == kNullPluginWindow); } bool is_null() const { return transport_type == EMPTY; } bool is_transport() const { - return transport_type == NATIVE_TRANSPORT || - transport_type == TEXTURE_TRANSPORT; + return transport_type == NULL_TRANSPORT; } PluginWindowHandle handle; SurfaceType transport_type; |