diff options
| author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
|---|---|---|
| committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
| commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
| tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/content/browser/android/in_process | |
| parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) | |
| download | qtwebengine-chromium-3f0f86b0caed75241fa71c95a5d73bc0164348c5.tar.gz | |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/content/browser/android/in_process')
6 files changed, 85 insertions, 34 deletions
diff --git a/chromium/content/browser/android/in_process/synchronous_compositor_impl.cc b/chromium/content/browser/android/in_process/synchronous_compositor_impl.cc index b04e85456f1..230b1e92dc6 100644 --- a/chromium/content/browser/android/in_process/synchronous_compositor_impl.cc +++ b/chromium/content/browser/android/in_process/synchronous_compositor_impl.cc @@ -59,7 +59,7 @@ class VideoContextProvider return gl_in_process_context_->GetSurfaceTexture(stream_id); } - virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE { + virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE { return context_provider_->Context3d(); } @@ -109,7 +109,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; - WebKit::WebGraphicsContext3D::Attributes attributes; + blink::WebGraphicsContext3D::Attributes attributes; attributes.antialias = false; attributes.shareResources = true; attributes.noAutomaticFlushes = true; @@ -178,15 +178,13 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { virtual scoped_ptr<StreamTextureFactory> CreateStreamTextureFactory( int view_id) OVERRIDE { - scoped_refptr<VideoContextProvider> context_provider; - if (CanCreateMainThreadContext()) { - context_provider = - new VideoContextProvider(offscreen_context_for_main_thread_, - wrapped_gl_context_for_main_thread_); - } - return make_scoped_ptr(new StreamTextureFactorySynchronousImpl( - context_provider.get(), view_id)) - .PassAs<StreamTextureFactory>(); + scoped_ptr<StreamTextureFactorySynchronousImpl> factory( + new StreamTextureFactorySynchronousImpl( + base::Bind(&SynchronousCompositorFactoryImpl:: + TryCreateStreamTextureFactory, + base::Unretained(this)), + view_id)); + return factory.PassAs<StreamTextureFactory>(); } void CompositorInitializedHardwareDraw(SynchronousCompositorImpl* compositor); @@ -195,6 +193,8 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory { private: void ReleaseGlobalHardwareResources(); bool CanCreateMainThreadContext(); + scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> + TryCreateStreamTextureFactory(); SynchronousInputEventFilter synchronous_input_event_filter_; @@ -247,6 +247,21 @@ bool SynchronousCompositorFactoryImpl::CanCreateMainThreadContext() { return num_hardware_compositors_ > 0; } +scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> +SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() { + scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider> + context_provider; + if (CanCreateMainThreadContext() && + GetOffscreenContextProviderForMainThread()) { + DCHECK(offscreen_context_for_main_thread_); + DCHECK(wrapped_gl_context_for_main_thread_); + context_provider = + new VideoContextProvider(offscreen_context_for_main_thread_, + wrapped_gl_context_for_main_thread_); + } + return context_provider; +} + base::LazyInstance<SynchronousCompositorFactoryImpl>::Leaky g_factory = LAZY_INSTANCE_INITIALIZER; @@ -396,7 +411,7 @@ void SynchronousCompositorImpl::SetContinuousInvalidate(bool enable) { } InputEventAckState SynchronousCompositorImpl::HandleInputEvent( - const WebKit::WebInputEvent& input_event) { + const blink::WebInputEvent& input_event) { DCHECK(CalledOnValidThread()); return g_factory.Get().synchronous_input_event_filter()->HandleInputEvent( contents_->GetRoutingID(), input_event); @@ -415,6 +430,13 @@ void SynchronousCompositorImpl::DidActivatePendingTree() { compositor_client_->DidUpdateContent(); } +void SynchronousCompositorImpl::SetMaxScrollOffset( + gfx::Vector2dF max_scroll_offset) { + DCHECK(CalledOnValidThread()); + if (compositor_client_) + compositor_client_->SetMaxRootLayerScrollOffset(max_scroll_offset); +} + void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) { DCHECK(CalledOnValidThread()); if (compositor_client_) @@ -428,6 +450,26 @@ gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { return gfx::Vector2dF(); } +bool SynchronousCompositorImpl::IsExternalFlingActive() const { + DCHECK(CalledOnValidThread()); + if (compositor_client_) + return compositor_client_->IsExternalFlingActive(); + return false; +} + +void SynchronousCompositorImpl::SetTotalPageScaleFactor( + float page_scale_factor) { + DCHECK(CalledOnValidThread()); + if (compositor_client_) + compositor_client_->SetRootLayerPageScaleFactor(page_scale_factor); +} + +void SynchronousCompositorImpl::SetScrollableSize(gfx::SizeF scrollable_size) { + DCHECK(CalledOnValidThread()); + if (compositor_client_) + compositor_client_->SetRootLayerScrollableSize(scrollable_size); +} + // Not using base::NonThreadSafe as we want to enforce a more exacting threading // requirement: SynchronousCompositorImpl() must only be used on the UI thread. bool SynchronousCompositorImpl::CalledOnValidThread() const { diff --git a/chromium/content/browser/android/in_process/synchronous_compositor_impl.h b/chromium/content/browser/android/in_process/synchronous_compositor_impl.h index 3189dcc983a..f23d920a555 100644 --- a/chromium/content/browser/android/in_process/synchronous_compositor_impl.h +++ b/chromium/content/browser/android/in_process/synchronous_compositor_impl.h @@ -19,7 +19,7 @@ class InputHandler; struct DidOverscrollParams; } -namespace WebKit { +namespace blink { class WebInputEvent; } @@ -43,7 +43,7 @@ class SynchronousCompositorImpl // is implicitly that of the in-process renderer. static SynchronousCompositorImpl* FromRoutingID(int routing_id); - InputEventAckState HandleInputEvent(const WebKit::WebInputEvent& input_event); + InputEventAckState HandleInputEvent(const blink::WebInputEvent& input_event); // SynchronousCompositor virtual void SetClient(SynchronousCompositorClient* compositor_client) @@ -73,8 +73,12 @@ class SynchronousCompositorImpl virtual void DidActivatePendingTree() OVERRIDE; // LayerScrollOffsetDelegate + virtual void SetMaxScrollOffset(gfx::Vector2dF max_scroll_offset) OVERRIDE; virtual void SetTotalScrollOffset(gfx::Vector2dF new_value) OVERRIDE; virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE; + virtual bool IsExternalFlingActive() const OVERRIDE; + virtual void SetTotalPageScaleFactor(float page_scale_factor) OVERRIDE; + virtual void SetScrollableSize(gfx::SizeF scrollable_size) OVERRIDE; void SetInputHandler(cc::InputHandler* input_handler); void DidOverscroll(const cc::DidOverscrollParams& params); diff --git a/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.cc index 28119a20329..2d37659723c 100644 --- a/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.cc +++ b/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.cc @@ -14,6 +14,7 @@ #include "content/browser/android/in_process/synchronous_compositor_impl.h" #include "content/public/browser/browser_thread.h" #include "gpu/command_buffer/client/gl_in_process_context.h" +#include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "third_party/skia/include/core/SkBitmapDevice.h" #include "third_party/skia/include/core/SkCanvas.h" #include "ui/gfx/rect_conversions.h" @@ -35,7 +36,7 @@ CreateWebGraphicsContext3D(scoped_refptr<gfx::GLSurface> surface) { const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; - WebKit::WebGraphicsContext3D::Attributes attributes; + blink::WebGraphicsContext3D::Attributes attributes; attributes.antialias = false; attributes.shareResources = true; attributes.noAutomaticFlushes = true; @@ -104,7 +105,7 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( : cc::OutputSurface( scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))), routing_id_(routing_id), - needs_begin_frame_(false), + needs_begin_impl_frame_(false), invoking_composite_(false), did_swap_buffer_(false), current_sw_canvas_(NULL), @@ -115,6 +116,9 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( capabilities_.adjust_deadline_for_parent = false; // Cannot call out to GetDelegate() here as the output surface is not // constructed on the correct thread. + + memory_policy_.priority_cutoff_when_visible = + gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; } SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() { @@ -155,14 +159,14 @@ void SynchronousCompositorOutputSurface::Reshape( // Intentional no-op: surface size is controlled by the embedder. } -void SynchronousCompositorOutputSurface::SetNeedsBeginFrame( +void SynchronousCompositorOutputSurface::SetNeedsBeginImplFrame( bool enable) { DCHECK(CalledOnValidThread()); - cc::OutputSurface::SetNeedsBeginFrame(enable); - needs_begin_frame_ = enable; + cc::OutputSurface::SetNeedsBeginImplFrame(enable); + needs_begin_impl_frame_ = enable; SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); if (delegate) - delegate->SetContinuousInvalidate(needs_begin_frame_); + delegate->SetContinuousInvalidate(needs_begin_impl_frame_); } void SynchronousCompositorOutputSurface::SwapBuffers( @@ -261,8 +265,8 @@ void SynchronousCompositorOutputSurface::InvokeComposite( adjusted_transform, viewport, clip, valid_for_tile_management); SetNeedsRedrawRect(gfx::Rect(viewport.size())); - if (needs_begin_frame_) - BeginFrame(cc::BeginFrameArgs::CreateForSynchronousCompositor()); + if (needs_begin_impl_frame_) + BeginImplFrame(cc::BeginFrameArgs::CreateForSynchronousCompositor()); // After software draws (which might move the viewport arbitrarily), restore // the previous hardware viewport to allow CC's tile manager to prioritize @@ -280,8 +284,9 @@ void SynchronousCompositorOutputSurface::InvokeComposite( OnSwapBuffersComplete(); } -void SynchronousCompositorOutputSurface::PostCheckForRetroactiveBeginFrame() { - // Synchronous compositor cannot perform retroactive begin frames, so +void +SynchronousCompositorOutputSurface::PostCheckForRetroactiveBeginImplFrame() { + // Synchronous compositor cannot perform retroactive BeginImplFrames, so // intentionally no-op here. } diff --git a/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.h b/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.h index b9b4d678c09..2879de00c04 100644 --- a/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.h +++ b/chromium/content/browser/android/in_process/synchronous_compositor_output_surface.h @@ -59,7 +59,7 @@ class SynchronousCompositorOutputSurface virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE; virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE; - virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; + virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE; virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; // Partial SynchronousCompositor API implementation. @@ -80,7 +80,7 @@ class SynchronousCompositorOutputSurface friend class SoftwareDevice; // Private OutputSurface overrides. - virtual void PostCheckForRetroactiveBeginFrame() OVERRIDE; + virtual void PostCheckForRetroactiveBeginImplFrame() OVERRIDE; void InvokeComposite(const gfx::Transform& transform, gfx::Rect viewport, @@ -90,7 +90,7 @@ class SynchronousCompositorOutputSurface SynchronousCompositorOutputSurfaceDelegate* GetDelegate(); int routing_id_; - bool needs_begin_frame_; + bool needs_begin_impl_frame_; bool invoking_composite_; bool did_swap_buffer_; diff --git a/chromium/content/browser/android/in_process/synchronous_input_event_filter.cc b/chromium/content/browser/android/in_process/synchronous_input_event_filter.cc index 34144dac579..b8ba0ea3352 100644 --- a/chromium/content/browser/android/in_process/synchronous_input_event_filter.cc +++ b/chromium/content/browser/android/in_process/synchronous_input_event_filter.cc @@ -10,7 +10,7 @@ #include "content/public/browser/browser_thread.h" #include "ui/events/latency_info.h" -using WebKit::WebInputEvent; +using blink::WebInputEvent; namespace content { @@ -22,14 +22,14 @@ SynchronousInputEventFilter::~SynchronousInputEventFilter() { InputEventAckState SynchronousInputEventFilter::HandleInputEvent( int routing_id, - const WebKit::WebInputEvent& input_event) { + const blink::WebInputEvent& input_event) { // The handler will be empty both before renderer initialization and after // renderer destruction. It's possible that this will be reached in such a // state. While not good, it should also not be fatal. if (handler_.is_null()) return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; - - return handler_.Run(routing_id, &input_event, ui::LatencyInfo()); + ui::LatencyInfo latency; + return handler_.Run(routing_id, &input_event, &latency); } void SynchronousInputEventFilter::SetBoundHandler(const Handler& handler) { diff --git a/chromium/content/browser/android/in_process/synchronous_input_event_filter.h b/chromium/content/browser/android/in_process/synchronous_input_event_filter.h index 18601c222ae..a6fa68fcfda 100644 --- a/chromium/content/browser/android/in_process/synchronous_input_event_filter.h +++ b/chromium/content/browser/android/in_process/synchronous_input_event_filter.h @@ -9,10 +9,10 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "content/port/common/input_event_ack_state.h" -#include "content/renderer/gpu/input_handler_manager_client.h" +#include "content/renderer/input/input_handler_manager_client.h" #include "ui/gfx/vector2d_f.h" -namespace WebKit { +namespace blink { class WebInputEvent; } @@ -29,7 +29,7 @@ class SynchronousInputEventFilter : public InputHandlerManagerClient { virtual ~SynchronousInputEventFilter(); InputEventAckState HandleInputEvent(int routing_id, - const WebKit::WebInputEvent& input_event); + const blink::WebInputEvent& input_event); // InputHandlerManagerClient implementation. virtual void SetBoundHandler(const Handler& handler) OVERRIDE; |
