OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ui/compositor/layer.h" | 26 #include "ui/compositor/layer.h" |
27 #include "ui/events/event.h" | 27 #include "ui/events/event.h" |
28 #include "ui/gfx/geometry/rect_conversions.h" | 28 #include "ui/gfx/geometry/rect_conversions.h" |
29 | 29 |
30 namespace base { | 30 namespace base { |
31 class TickClock; | 31 class TickClock; |
32 } | 32 } |
33 | 33 |
34 namespace cc { | 34 namespace cc { |
35 class CompositorFrameSinkSupport; | 35 class CompositorFrameSinkSupport; |
36 class LocalSurfaceIdAllocator; | |
37 } | 36 } |
38 | 37 |
39 namespace media { | 38 namespace media { |
40 class VideoFrame; | 39 class VideoFrame; |
41 } | 40 } |
42 | 41 |
43 namespace display_compositor { | 42 namespace display_compositor { |
44 class ReadbackYUVInterface; | 43 class ReadbackYUVInterface; |
45 } | 44 } |
46 | 45 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // cc::CompositorFrameSinkSupportClient implementation. | 116 // cc::CompositorFrameSinkSupportClient implementation. |
118 void DidReceiveCompositorFrameAck() override; | 117 void DidReceiveCompositorFrameAck() override; |
119 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | 118 void OnBeginFrame(const cc::BeginFrameArgs& args) override; |
120 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | 119 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; |
121 void WillDrawSurface(const cc::LocalSurfaceId& id, | 120 void WillDrawSurface(const cc::LocalSurfaceId& id, |
122 const gfx::Rect& damage_rect) override; | 121 const gfx::Rect& damage_rect) override; |
123 | 122 |
124 // Public interface exposed to RenderWidgetHostView. | 123 // Public interface exposed to RenderWidgetHostView. |
125 | 124 |
126 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, | 125 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, |
| 126 const cc::LocalSurfaceId& local_surface_id, |
127 cc::CompositorFrame frame); | 127 cc::CompositorFrame frame); |
128 void ClearDelegatedFrame(); | 128 void ClearDelegatedFrame(); |
129 void WasHidden(); | 129 void WasHidden(); |
130 void WasShown(const ui::LatencyInfo& latency_info); | 130 void WasShown(const ui::LatencyInfo& latency_info); |
131 void WasResized(); | 131 void WasResized(); |
132 bool HasSavedFrame(); | 132 bool HasSavedFrame(); |
133 gfx::Size GetRequestedRendererSize() const; | 133 gfx::Size GetRequestedRendererSize() const; |
134 void SetCompositor(ui::Compositor* compositor); | 134 void SetCompositor(ui::Compositor* compositor); |
135 void ResetCompositor(); | 135 void ResetCompositor(); |
136 // Note: |src_subrect| is specified in DIP dimensions while |output_size| | 136 // Note: |src_subrect| is specified in DIP dimensions while |output_size| |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 bool skipped_frames_; | 280 bool skipped_frames_; |
281 std::vector<ui::LatencyInfo> skipped_latency_info_list_; | 281 std::vector<ui::LatencyInfo> skipped_latency_info_list_; |
282 | 282 |
283 std::unique_ptr<ui::Layer> right_gutter_; | 283 std::unique_ptr<ui::Layer> right_gutter_; |
284 std::unique_ptr<ui::Layer> bottom_gutter_; | 284 std::unique_ptr<ui::Layer> bottom_gutter_; |
285 | 285 |
286 // This is the last root background color from a swapped frame. | 286 // This is the last root background color from a swapped frame. |
287 SkColor background_color_; | 287 SkColor background_color_; |
288 | 288 |
289 // State for rendering into a Surface. | 289 // State for rendering into a Surface. |
290 std::unique_ptr<cc::LocalSurfaceIdAllocator> id_allocator_; | |
291 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; | 290 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; |
292 gfx::Size current_surface_size_; | 291 gfx::Size current_surface_size_; |
293 float current_scale_factor_; | 292 float current_scale_factor_; |
294 cc::ReturnedResourceArray surface_returned_resources_; | 293 cc::ReturnedResourceArray surface_returned_resources_; |
295 | 294 |
296 // This lock is the one waiting for a frame of the right size to come back | 295 // This lock is the one waiting for a frame of the right size to come back |
297 // from the renderer/GPU process. It is set from the moment the aura window | 296 // from the renderer/GPU process. It is set from the moment the aura window |
298 // got resized, to the moment we committed the renderer frame of the same | 297 // got resized, to the moment we committed the renderer frame of the same |
299 // size. It keeps track of the size we expect from the renderer, and locks the | 298 // size. It keeps track of the size we expect from the renderer, and locks the |
300 // compositor, as well as the UI for a short time to give a chance to the | 299 // compositor, as well as the UI for a short time to give a chance to the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 bool needs_begin_frame_ = false; | 337 bool needs_begin_frame_ = false; |
339 | 338 |
340 bool has_frame_ = false; | 339 bool has_frame_ = false; |
341 | 340 |
342 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 341 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
343 }; | 342 }; |
344 | 343 |
345 } // namespace content | 344 } // namespace content |
346 | 345 |
347 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 346 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
OLD | NEW |