Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: content/browser/renderer_host/delegated_frame_host.h

Issue 2780713004: Hide compositor_frame_sink_id from RenderWidgetHostView* (Closed)
Patch Set: Added a comment in android Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // suggested color from the current page background. 64 // suggested color from the current page background.
65 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; 65 virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0;
66 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; 66 virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0;
67 67
68 virtual bool DelegatedFrameCanCreateResizeLock() const = 0; 68 virtual bool DelegatedFrameCanCreateResizeLock() const = 0;
69 virtual std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock( 69 virtual std::unique_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
70 bool defer_compositor_lock) = 0; 70 bool defer_compositor_lock) = 0;
71 virtual void DelegatedFrameHostResizeLockWasReleased() = 0; 71 virtual void DelegatedFrameHostResizeLockWasReleased() = 0;
72 72
73 virtual void DelegatedFrameHostSendReclaimCompositorResources( 73 virtual void DelegatedFrameHostSendReclaimCompositorResources(
74 int compositor_frame_sink_id,
75 bool is_swap_ack, 74 bool is_swap_ack,
76 const cc::ReturnedResourceArray& resources) = 0; 75 const cc::ReturnedResourceArray& resources) = 0;
77 76
78 virtual void OnBeginFrame(const cc::BeginFrameArgs& args) = 0; 77 virtual void OnBeginFrame(const cc::BeginFrameArgs& args) = 0;
79 virtual bool IsAutoResizeEnabled() const = 0; 78 virtual bool IsAutoResizeEnabled() const = 0;
80 }; 79 };
81 80
82 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state 81 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state
83 // and functionality that is associated with delegated frames being sent from 82 // and functionality that is associated with delegated frames being sent from
84 // the RenderWidget. The DelegatedFrameHost will push these changes through to 83 // the RenderWidget. The DelegatedFrameHost will push these changes through to
(...skipping 30 matching lines...) Expand all
115 114
116 // cc::CompositorFrameSinkSupportClient implementation. 115 // cc::CompositorFrameSinkSupportClient implementation.
117 void DidReceiveCompositorFrameAck() override; 116 void DidReceiveCompositorFrameAck() override;
118 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 117 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
119 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 118 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
120 void WillDrawSurface(const cc::LocalSurfaceId& id, 119 void WillDrawSurface(const cc::LocalSurfaceId& id,
121 const gfx::Rect& damage_rect) override; 120 const gfx::Rect& damage_rect) override;
122 121
123 // Public interface exposed to RenderWidgetHostView. 122 // Public interface exposed to RenderWidgetHostView.
124 123
125 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, 124 void DidCreateNewRendererCompositorFrameSink();
126 const cc::LocalSurfaceId& local_surface_id, 125 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
127 cc::CompositorFrame frame); 126 cc::CompositorFrame frame);
128 void ClearDelegatedFrame(); 127 void ClearDelegatedFrame();
129 void WasHidden(); 128 void WasHidden();
130 void WasShown(const ui::LatencyInfo& latency_info); 129 void WasShown(const ui::LatencyInfo& latency_info);
131 void WasResized(); 130 void WasResized();
132 bool HasSavedFrame(); 131 bool HasSavedFrame();
133 gfx::Size GetRequestedRendererSize() const; 132 gfx::Size GetRequestedRendererSize() const;
134 void SetCompositor(ui::Compositor* compositor); 133 void SetCompositor(ui::Compositor* compositor);
135 void ResetCompositor(); 134 void ResetCompositor();
136 // Note: |src_subrect| is specified in DIP dimensions while |output_size| 135 // Note: |src_subrect| is specified in DIP dimensions while |output_size|
137 // expects pixels. If |src_subrect| is empty, the entire surface area is 136 // expects pixels. If |src_subrect| is empty, the entire surface area is
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; 263 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_;
265 264
266 // The current VSync timebase and interval. These are zero until the first 265 // The current VSync timebase and interval. These are zero until the first
267 // call to SetVSyncParameters(). 266 // call to SetVSyncParameters().
268 base::TimeTicks vsync_timebase_; 267 base::TimeTicks vsync_timebase_;
269 base::TimeDelta vsync_interval_; 268 base::TimeDelta vsync_interval_;
270 269
271 // Overridable tick clock used for testing functions using current time. 270 // Overridable tick clock used for testing functions using current time.
272 std::unique_ptr<base::TickClock> tick_clock_; 271 std::unique_ptr<base::TickClock> tick_clock_;
273 272
274 // With delegated renderer, this is the last output surface, used to
275 // disambiguate resources with the same id coming from different output
276 // surfaces.
277 uint32_t last_compositor_frame_sink_id_;
278
279 // True after a delegated frame has been skipped, until a frame is not 273 // True after a delegated frame has been skipped, until a frame is not
280 // skipped. 274 // skipped.
281 bool skipped_frames_; 275 bool skipped_frames_;
282 std::vector<ui::LatencyInfo> skipped_latency_info_list_; 276 std::vector<ui::LatencyInfo> skipped_latency_info_list_;
283 277
284 std::unique_ptr<ui::Layer> right_gutter_; 278 std::unique_ptr<ui::Layer> right_gutter_;
285 std::unique_ptr<ui::Layer> bottom_gutter_; 279 std::unique_ptr<ui::Layer> bottom_gutter_;
286 280
287 // This is the last root background color from a swapped frame. 281 // This is the last root background color from a swapped frame.
288 SkColor background_color_; 282 SkColor background_color_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 cc::BeginFrameArgs::kInvalidFrameNumber; 333 cc::BeginFrameArgs::kInvalidFrameNumber;
340 334
341 bool has_frame_ = false; 335 bool has_frame_ = false;
342 336
343 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; 337 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_;
344 }; 338 };
345 339
346 } // namespace content 340 } // namespace content
347 341
348 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ 342 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/browser_compositor_view_mac.mm ('k') | content/browser/renderer_host/delegated_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698