| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 5 #ifndef CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 6 #define CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "cc/input/browser_controls_state.h" | 14 #include "cc/input/browser_controls_state.h" |
| 15 #include "cc/output/managed_memory_policy.h" | 15 #include "cc/output/managed_memory_policy.h" |
| 16 #include "cc/output/swap_promise.h" | 16 #include "cc/output/swap_promise.h" |
| 17 #include "cc/trees/layer_tree_host_client.h" | 17 #include "cc/trees/layer_tree_host_client.h" |
| 18 #include "cc/trees/layer_tree_host_single_thread_client.h" | 18 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 19 #include "cc/trees/layer_tree_settings.h" | 19 #include "cc/trees/layer_tree_settings.h" |
| 20 #include "cc/trees/remote_proto_channel.h" | |
| 21 #include "cc/trees/swap_promise_monitor.h" | 20 #include "cc/trees/swap_promise_monitor.h" |
| 22 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
| 22 #include "content/public/renderer/remote_proto_channel.h" |
| 23 #include "content/renderer/gpu/compositor_dependencies.h" | 23 #include "content/renderer/gpu/compositor_dependencies.h" |
| 24 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" | 24 #include "third_party/WebKit/public/platform/WebLayerTreeView.h" |
| 25 #include "ui/gfx/geometry/rect.h" | 25 #include "ui/gfx/geometry/rect.h" |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 class CommandLine; | 28 class CommandLine; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace cc { | 31 namespace cc { |
| 32 | 32 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 namespace content { | 50 namespace content { |
| 51 | 51 |
| 52 class RenderWidgetCompositorDelegate; | 52 class RenderWidgetCompositorDelegate; |
| 53 | 53 |
| 54 class CONTENT_EXPORT RenderWidgetCompositor | 54 class CONTENT_EXPORT RenderWidgetCompositor |
| 55 : NON_EXPORTED_BASE(public blink::WebLayerTreeView), | 55 : NON_EXPORTED_BASE(public blink::WebLayerTreeView), |
| 56 NON_EXPORTED_BASE(public cc::LayerTreeHostClient), | 56 NON_EXPORTED_BASE(public cc::LayerTreeHostClient), |
| 57 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient), | 57 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient), |
| 58 NON_EXPORTED_BASE(public cc::RemoteProtoChannel) { | 58 public RemoteProtoChannel { |
| 59 public: | 59 public: |
| 60 // Attempt to construct and initialize a compositor instance for the widget | 60 // Attempt to construct and initialize a compositor instance for the widget |
| 61 // with the given settings. Returns NULL if initialization fails. | 61 // with the given settings. Returns NULL if initialization fails. |
| 62 static std::unique_ptr<RenderWidgetCompositor> Create( | 62 static std::unique_ptr<RenderWidgetCompositor> Create( |
| 63 RenderWidgetCompositorDelegate* delegate, | 63 RenderWidgetCompositorDelegate* delegate, |
| 64 float device_scale_factor, | 64 float device_scale_factor, |
| 65 CompositorDependencies* compositor_deps); | 65 CompositorDependencies* compositor_deps); |
| 66 | 66 |
| 67 ~RenderWidgetCompositor() override; | 67 ~RenderWidgetCompositor() override; |
| 68 | 68 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 void DidCommit() override; | 190 void DidCommit() override; |
| 191 void DidCommitAndDrawFrame() override; | 191 void DidCommitAndDrawFrame() override; |
| 192 void DidReceiveCompositorFrameAck() override; | 192 void DidReceiveCompositorFrameAck() override; |
| 193 void DidCompletePageScaleAnimation() override; | 193 void DidCompletePageScaleAnimation() override; |
| 194 | 194 |
| 195 // cc::LayerTreeHostSingleThreadClient implementation. | 195 // cc::LayerTreeHostSingleThreadClient implementation. |
| 196 void RequestScheduleAnimation() override; | 196 void RequestScheduleAnimation() override; |
| 197 void DidSubmitCompositorFrame() override; | 197 void DidSubmitCompositorFrame() override; |
| 198 void DidLoseCompositorFrameSink() override; | 198 void DidLoseCompositorFrameSink() override; |
| 199 | 199 |
| 200 // cc::RemoteProtoChannel implementation. | 200 // RemoteProtoChannel implementation. |
| 201 void SetProtoReceiver(ProtoReceiver* receiver) override; | 201 void SetProtoReceiver(ProtoReceiver* receiver) override; |
| 202 void SendCompositorProto(const cc::proto::CompositorMessage& proto) override; | 202 void SendCompositorProto(const cc::proto::CompositorMessage& proto) override; |
| 203 | 203 |
| 204 enum { | 204 enum { |
| 205 COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK = 4, | 205 COMPOSITOR_FRAME_SINK_RETRIES_BEFORE_FALLBACK = 4, |
| 206 MAX_COMPOSITOR_FRAME_SINK_RETRIES = 5, | 206 MAX_COMPOSITOR_FRAME_SINK_RETRIES = 5, |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 protected: | 209 protected: |
| 210 friend class RenderViewImplScaleFactorTest; | 210 friend class RenderViewImplScaleFactorTest; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 224 int num_failed_recreate_attempts_; | 224 int num_failed_recreate_attempts_; |
| 225 RenderWidgetCompositorDelegate* const delegate_; | 225 RenderWidgetCompositorDelegate* const delegate_; |
| 226 CompositorDependencies* const compositor_deps_; | 226 CompositorDependencies* const compositor_deps_; |
| 227 const bool threaded_; | 227 const bool threaded_; |
| 228 std::unique_ptr<cc::AnimationHost> animation_host_; | 228 std::unique_ptr<cc::AnimationHost> animation_host_; |
| 229 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; | 229 std::unique_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 230 bool never_visible_; | 230 bool never_visible_; |
| 231 | 231 |
| 232 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; | 232 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; |
| 233 | 233 |
| 234 cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; | 234 RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; |
| 235 | 235 |
| 236 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 236 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 } // namespace content | 239 } // namespace content |
| 240 | 240 |
| 241 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 241 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |