| 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" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // cc::RemoteProtoChannel implementation. | 185 // cc::RemoteProtoChannel implementation. |
| 186 void SetProtoReceiver(ProtoReceiver* receiver) override; | 186 void SetProtoReceiver(ProtoReceiver* receiver) override; |
| 187 void SendCompositorProto(const cc::proto::CompositorMessage& proto) override; | 187 void SendCompositorProto(const cc::proto::CompositorMessage& proto) override; |
| 188 | 188 |
| 189 enum { | 189 enum { |
| 190 OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4, | 190 OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4, |
| 191 MAX_OUTPUT_SURFACE_RETRIES = 5, | 191 MAX_OUTPUT_SURFACE_RETRIES = 5, |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 protected: | 194 protected: |
| 195 friend class RenderViewImplScaleFactorTest; |
| 196 |
| 195 RenderWidgetCompositor(RenderWidgetCompositorDelegate* delegate, | 197 RenderWidgetCompositor(RenderWidgetCompositorDelegate* delegate, |
| 196 CompositorDependencies* compositor_deps); | 198 CompositorDependencies* compositor_deps); |
| 197 | 199 |
| 198 void Initialize(float device_scale_factor); | 200 void Initialize(float device_scale_factor); |
| 199 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 201 cc::LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
| 200 | 202 |
| 201 private: | 203 private: |
| 202 void LayoutAndUpdateLayers(); | 204 void LayoutAndUpdateLayers(); |
| 203 void InvokeLayoutAndPaintCallback(); | 205 void InvokeLayoutAndPaintCallback(); |
| 204 bool CompositeIsSynchronous() const; | 206 bool CompositeIsSynchronous() const; |
| 205 void SynchronouslyComposite(); | 207 void SynchronouslyComposite(); |
| 206 | 208 |
| 207 int num_failed_recreate_attempts_; | 209 int num_failed_recreate_attempts_; |
| 208 RenderWidgetCompositorDelegate* const delegate_; | 210 RenderWidgetCompositorDelegate* const delegate_; |
| 209 CompositorDependencies* const compositor_deps_; | 211 CompositorDependencies* const compositor_deps_; |
| 210 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 212 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 211 bool never_visible_; | 213 bool never_visible_; |
| 212 | 214 |
| 213 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; | 215 blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_; |
| 214 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; | 216 scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_; |
| 215 | 217 |
| 216 cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; | 218 cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_; |
| 217 | 219 |
| 218 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; | 220 base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_; |
| 219 }; | 221 }; |
| 220 | 222 |
| 221 } // namespace content | 223 } // namespace content |
| 222 | 224 |
| 223 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ | 225 #endif // CONTENT_RENDERER_GPU_RENDER_WIDGET_COMPOSITOR_H_ |
| OLD | NEW |