diff options
Diffstat (limited to 'content')
7 files changed, 23 insertions, 65 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); diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h index 5cd659f..6aaa213 100644 --- a/content/public/browser/android/synchronous_compositor.h +++ b/content/public/browser/android/synchronous_compositor.h @@ -19,7 +19,6 @@ class CompositorFrameAck; } namespace gfx { -class GLSurface; class Transform; }; @@ -67,9 +66,8 @@ class CONTENT_EXPORT SynchronousCompositor { // Synchronously initialize compositor for hardware draw. Can only be called // while compositor is in software only mode, either after compositor is // first created or after ReleaseHwDraw is called. It is invalid to - // DemandDrawHw before this returns true. |surface| is the GLSurface that - // should be used to create the underlying hardware context. - virtual bool InitializeHwDraw(scoped_refptr<gfx::GLSurface> surface) = 0; + // DemandDrawHw before this returns true. + virtual bool InitializeHwDraw() = 0; // Reverse of InitializeHwDraw above. Can only be called while hardware draw // is already initialized. Brings compositor back to software only mode and @@ -82,14 +80,12 @@ class CONTENT_EXPORT SynchronousCompositor { virtual gpu::GLInProcessContext* GetShareContext() = 0; // "On demand" hardware draw. The content is first clipped to |damage_area|, - // then transformed through |transform|, and finally clipped to |view_size| - // and by the existing stencil buffer if any. + // then transformed through |transform|, and finally clipped to |view_size|. virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw( gfx::Size surface_size, const gfx::Transform& transform, gfx::Rect viewport, - gfx::Rect clip, - bool stencil_enabled) = 0; + gfx::Rect clip) = 0; // For delegated rendering, return resources from parent compositor to this. // Note that all resources must be returned before ReleaseHwDraw. |