Chromium Code Reviews| Index: content/browser/android/synchronous_compositor_host.h |
| diff --git a/content/browser/android/synchronous_compositor_host.h b/content/browser/android/synchronous_compositor_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4c8b2de3b10bdb42ed6949b4a7a29a3f4d722ac7 |
| --- /dev/null |
| +++ b/content/browser/android/synchronous_compositor_host.h |
| @@ -0,0 +1,81 @@ |
| +// Copyright 2015 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_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| +#define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |
| + |
| +#include "cc/output/compositor_frame.h" |
| +#include "content/browser/android/synchronous_compositor_base.h" |
| +#include "ui/gfx/geometry/scroll_offset.h" |
| +#include "ui/gfx/geometry/size_f.h" |
| + |
| +namespace IPC { |
| +class Sender; |
| +} |
| + |
| +namespace content { |
| + |
| +class RenderWidgetHostViewAndroid; |
| +class SynchronousCompositorClient; |
| +struct CommonBrowserParams; |
| +struct CommonRendererParams; |
| + |
| +class SynchronousCompositorHost : public SynchronousCompositorBase { |
| + public: |
| + ~SynchronousCompositorHost() override; |
| + |
| + // SynchronousCompositor overrides. |
| + scoped_ptr<cc::CompositorFrame> DemandDrawHw( |
| + const gfx::Size& surface_size, |
| + const gfx::Transform& transform, |
| + const gfx::Rect& viewport, |
| + const gfx::Rect& clip, |
| + const gfx::Rect& viewport_rect_for_tile_priority, |
| + const gfx::Transform& transform_for_tile_priority) override; |
| + bool DemandDrawSw(SkCanvas* canvas) override; |
| + void ReturnResources(const cc::CompositorFrameAck& frame_ack) override; |
| + void SetMemoryPolicy(size_t bytes_limit) override; |
| + void DidChangeRootLayerScrollOffset( |
| + const gfx::ScrollOffset& root_offset) override; |
| + void SetIsActive(bool is_active) override; |
| + void OnComputeScroll(base::TimeTicks animation_time) override; |
| + |
| + // SynchronousCompositorBase overrides. |
| + InputEventAckState HandleInputEvent( |
| + const blink::WebInputEvent& input_event) override; |
| + void BeginFrame(const cc::BeginFrameArgs& args) override; |
| + bool OnMessageReceived(const IPC::Message& message) override; |
| + |
| + private: |
| + friend class SynchronousCompositorBase; |
| + SynchronousCompositorHost(RenderWidgetHostViewAndroid* rwhva, |
| + SynchronousCompositorClient* client); |
| + CommonBrowserParams ConstructCommonParams(); |
| + void ProcessCommonParams(const CommonRendererParams& params); |
| + void UpdateNeedsBeginFrames(); |
| + void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_metadata); |
| + |
| + RenderWidgetHostViewAndroid* const rwhva_; |
| + SynchronousCompositorClient* const client_; |
| + const int routing_id_; |
| + IPC::Sender* const sender_; |
| + |
| + bool is_active_; |
| + size_t bytes_limit_; |
| + cc::ReturnedResourceArray returned_resources_; |
| + |
| + // Updated by both renderer and browser. |
| + gfx::ScrollOffset root_scroll_offset_; |
| + |
| + // From renderer. |
| + unsigned int renderer_param_version_; |
| + bool need_animate_scroll_; |
| + bool need_invalidate_; |
| + bool need_begin_frame_; |
| + bool did_activate_pending_tree_; |
|
no sievers
2015/10/29 01:37:00
nit: DISALLOW_COPY_AND_ASSIGN();
boliu
2015/10/29 04:24:43
Done.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ |