diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 23:50:12 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-17 23:50:12 +0000 |
commit | 7a46143ee4f3dcc09618bbb9e836c7f54d1819d2 (patch) | |
tree | 143126afe8a92538259bfab69c498d9ec79251e2 /content/browser/android/in_process | |
parent | fe03d587b3669de9d9437ad22156ccf698cb9d1c (diff) | |
download | chromium_src-7a46143ee4f3dcc09618bbb9e836c7f54d1819d2.zip chromium_src-7a46143ee4f3dcc09618bbb9e836c7f54d1819d2.tar.gz chromium_src-7a46143ee4f3dcc09618bbb9e836c7f54d1819d2.tar.bz2 |
aw: Remove legacy rendering path
Remove locks, post tasks, and complexity used to support legacy
rendering path.
BUG=344087
Review URL: https://codereview.chromium.org/331103002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android/in_process')
6 files changed, 19 insertions, 57 deletions
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc index c4fdb62..7c5646e 100644 --- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc +++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc @@ -55,7 +55,6 @@ scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext( } scoped_ptr<gpu::GLInProcessContext> CreateContext( - scoped_refptr<gfx::GLSurface> surface, scoped_refptr<gpu::InProcessCommandBuffer::Service> service, gpu::GLInProcessContext* share_context) { const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; @@ -64,20 +63,12 @@ scoped_ptr<gpu::GLInProcessContext> CreateContext( GetDefaultAttribs(), &in_process_attribs); in_process_attribs.lose_context_when_out_of_memory = 1; - - bool is_offscreen = false; - gfx::Size size(1, 1); - if (surface) { - is_offscreen = surface->IsOffscreen(); - size = surface->GetSize(); - } - scoped_ptr<gpu::GLInProcessContext> context( gpu::GLInProcessContext::Create(service, - surface, - is_offscreen, + NULL /* surface */, + false /* is_offscreen */, gfx::kNullAcceleratedWidget, - size, + gfx::Size(1, 1), share_context, false /* share_resources */, in_process_attribs, @@ -177,14 +168,13 @@ scoped_refptr<ContextProviderWebContext> SynchronousCompositorFactoryImpl:: } scoped_refptr<cc::ContextProvider> SynchronousCompositorFactoryImpl:: - CreateOnscreenContextProviderForCompositorThread( - scoped_refptr<gfx::GLSurface> surface) { + CreateOnscreenContextProviderForCompositorThread() { DCHECK(service_); if (!share_context_.get()) - share_context_ = CreateContext(NULL, service_, NULL); + share_context_ = CreateContext(service_, NULL); return webkit::gpu::ContextProviderInProcess::Create( - WrapContext(CreateContext(surface, service_, share_context_.get())), + WrapContext(CreateContext(service_, share_context_.get())), "Child-Compositor"); } @@ -239,7 +229,7 @@ SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() { DCHECK(share_context_.get()); video_context_provider_ = new VideoContextProvider( - CreateContext(NULL, service_, share_context_.get())); + CreateContext(service_, share_context_.get())); } return video_context_provider_; } diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.h b/content/browser/android/in_process/synchronous_compositor_factory_impl.h index c7f1a3b..7fdc910 100644 --- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h +++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h @@ -12,10 +12,6 @@ #include "gpu/command_buffer/service/in_process_command_buffer.h" #include "webkit/common/gpu/context_provider_web_context.h" -namespace gfx { -class GLSurface; -} - namespace gpu { class GLInProcessContext; } @@ -57,8 +53,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { void CompositorReleasedHardwareDraw(); scoped_refptr<cc::ContextProvider> - CreateOnscreenContextProviderForCompositorThread( - scoped_refptr<gfx::GLSurface> surface); + CreateOnscreenContextProviderForCompositorThread(); gpu::GLInProcessContext* GetShareContext(); private: diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc index 0a0be1c..d7b3eb7 100644 --- a/content/browser/android/in_process/synchronous_compositor_impl.cc +++ b/content/browser/android/in_process/synchronous_compositor_impl.cc @@ -89,13 +89,12 @@ void SynchronousCompositor::SetGpuService( g_factory.Get().SetDeferredGpuService(service); } -bool SynchronousCompositorImpl::InitializeHwDraw( - scoped_refptr<gfx::GLSurface> surface) { +bool SynchronousCompositorImpl::InitializeHwDraw() { DCHECK(CalledOnValidThread()); DCHECK(output_surface_); scoped_refptr<cc::ContextProvider> onscreen_context = - g_factory.Get().CreateOnscreenContextProviderForCompositorThread(surface); + g_factory.Get().CreateOnscreenContextProviderForCompositorThread(); bool success = output_surface_->InitializeHwDraw(onscreen_context); @@ -120,13 +119,12 @@ scoped_ptr<cc::CompositorFrame> SynchronousCompositorImpl::DemandDrawHw( gfx::Size surface_size, const gfx::Transform& transform, gfx::Rect viewport, - gfx::Rect clip, - bool stencil_enabled) { + gfx::Rect clip) { DCHECK(CalledOnValidThread()); DCHECK(output_surface_); - scoped_ptr<cc::CompositorFrame> frame = output_surface_->DemandDrawHw( - surface_size, transform, viewport, clip, stencil_enabled); + scoped_ptr<cc::CompositorFrame> frame = + output_surface_->DemandDrawHw(surface_size, transform, viewport, clip); if (frame.get()) UpdateFrameMetaData(frame->metadata); return frame.Pass(); @@ -150,15 +148,6 @@ bool SynchronousCompositorImpl::DemandDrawSw(SkCanvas* canvas) { void SynchronousCompositorImpl::UpdateFrameMetaData( const cc::CompositorFrameMetadata& frame_metadata) { - if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask( - BrowserThread::UI, - FROM_HERE, - base::Bind(&SynchronousCompositorImpl::UpdateFrameMetaData, - weak_ptr_factory_.GetWeakPtr(), - frame_metadata)); - return; - } RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( contents_->GetRenderWidgetHostView()); if (rwhv) diff --git a/content/browser/android/in_process/synchronous_compositor_impl.h b/content/browser/android/in_process/synchronous_compositor_impl.h index 544a533..6ac80cb 100644 --- a/content/browser/android/in_process/synchronous_compositor_impl.h +++ b/content/browser/android/in_process/synchronous_compositor_impl.h @@ -48,16 +48,14 @@ class SynchronousCompositorImpl // SynchronousCompositor virtual void SetClient(SynchronousCompositorClient* compositor_client) OVERRIDE; - virtual bool InitializeHwDraw( - scoped_refptr<gfx::GLSurface> surface) OVERRIDE; + virtual bool InitializeHwDraw() OVERRIDE; virtual void ReleaseHwDraw() OVERRIDE; virtual gpu::GLInProcessContext* GetShareContext() OVERRIDE; virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( gfx::Size surface_size, const gfx::Transform& transform, gfx::Rect viewport, - gfx::Rect clip, - bool stencil_enabled) OVERRIDE; + gfx::Rect clip) OVERRIDE; virtual bool DemandDrawSw(SkCanvas* canvas) OVERRIDE; virtual void ReturnResources( const cc::CompositorFrameAck& frame_ack) OVERRIDE; diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc index 4590ed3..041de4d 100644 --- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc @@ -79,10 +79,8 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( capabilities_.deferred_gl_initialization = true; capabilities_.draw_and_swap_full_viewport_every_frame = true; capabilities_.adjust_deadline_for_parent = false; - if (IsDelegatedRendererEnabled()) { - capabilities_.delegated_rendering = true; - capabilities_.max_frames_pending = 1; - } + capabilities_.delegated_rendering = true; + capabilities_.max_frames_pending = 1; // Cannot call out to GetDelegate() here as the output surface is not // constructed on the correct thread. @@ -139,10 +137,6 @@ void SynchronousCompositorOutputSurface::SetNeedsBeginFrame(bool enable) { void SynchronousCompositorOutputSurface::SwapBuffers( cc::CompositorFrame* frame) { DCHECK(CalledOnValidThread()); - if (!ForcedDrawToSoftwareDevice() && !IsDelegatedRendererEnabled()) { - DCHECK(context_provider_); - context_provider_->ContextGL()->ShallowFlushCHROMIUM(); - } frame_holder_.reset(new cc::CompositorFrame); frame->AssignTo(frame_holder_.get()); @@ -176,14 +170,12 @@ SynchronousCompositorOutputSurface::DemandDrawHw( gfx::Size surface_size, const gfx::Transform& transform, gfx::Rect viewport, - gfx::Rect clip, - bool stencil_enabled) { + gfx::Rect clip) { DCHECK(CalledOnValidThread()); DCHECK(HasClient()); DCHECK(context_provider_); surface_size_ = surface_size; - SetExternalStencilTest(stencil_enabled); InvokeComposite(transform, viewport, clip, true); return frame_holder_.Pass(); @@ -205,7 +197,6 @@ SynchronousCompositorOutputSurface::DemandDrawSw(SkCanvas* canvas) { surface_size_ = gfx::Size(canvas->getDeviceSize().width(), canvas->getDeviceSize().height()); - SetExternalStencilTest(false); InvokeComposite(transform, clip, clip, false); diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.h b/content/browser/android/in_process/synchronous_compositor_output_surface.h index cc1f3be..3a456a4 100644 --- a/content/browser/android/in_process/synchronous_compositor_output_surface.h +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.h @@ -68,8 +68,7 @@ class SynchronousCompositorOutputSurface scoped_ptr<cc::CompositorFrame> DemandDrawHw(gfx::Size surface_size, const gfx::Transform& transform, gfx::Rect viewport, - gfx::Rect clip, - bool stencil_enabled); + gfx::Rect clip); void ReturnResources(const cc::CompositorFrameAck& frame_ack); scoped_ptr<cc::CompositorFrame> DemandDrawSw(SkCanvas* canvas); void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy); |