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

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

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy Created 4 years, 5 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 public ui::LayerOwnerDelegate, 92 public ui::LayerOwnerDelegate,
93 public ui::ContextFactoryObserver, 93 public ui::ContextFactoryObserver,
94 public DelegatedFrameEvictorClient, 94 public DelegatedFrameEvictorClient,
95 public cc::SurfaceFactoryClient, 95 public cc::SurfaceFactoryClient,
96 public base::SupportsWeakPtr<DelegatedFrameHost> { 96 public base::SupportsWeakPtr<DelegatedFrameHost> {
97 public: 97 public:
98 explicit DelegatedFrameHost(DelegatedFrameHostClient* client); 98 explicit DelegatedFrameHost(DelegatedFrameHostClient* client);
99 ~DelegatedFrameHost() override; 99 ~DelegatedFrameHost() override;
100 100
101 // ui::CompositorObserver implementation. 101 // ui::CompositorObserver implementation.
102 void OnCompositingInitialized(ui::Compositor* compositor) override;
102 void OnCompositingDidCommit(ui::Compositor* compositor) override; 103 void OnCompositingDidCommit(ui::Compositor* compositor) override;
103 void OnCompositingStarted(ui::Compositor* compositor, 104 void OnCompositingStarted(ui::Compositor* compositor,
104 base::TimeTicks start_time) override; 105 base::TimeTicks start_time) override;
105 void OnCompositingEnded(ui::Compositor* compositor) override; 106 void OnCompositingEnded(ui::Compositor* compositor) override;
106 void OnCompositingAborted(ui::Compositor* compositor) override; 107 void OnCompositingAborted(ui::Compositor* compositor) override;
107 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; 108 void OnCompositingLockStateChanged(ui::Compositor* compositor) override;
108 void OnCompositingShuttingDown(ui::Compositor* compositor) override; 109 void OnCompositingShuttingDown(ui::Compositor* compositor) override;
109 110
110 // ui::CompositorVSyncManager::Observer implementation. 111 // ui::CompositorVSyncManager::Observer implementation.
111 void OnUpdateVSyncParameters(base::TimeTicks timebase, 112 void OnUpdateVSyncParameters(base::TimeTicks timebase,
(...skipping 12 matching lines...) Expand all
124 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 125 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
125 void WillDrawSurface(const cc::SurfaceId& id, 126 void WillDrawSurface(const cc::SurfaceId& id,
126 const gfx::Rect& damage_rect) override; 127 const gfx::Rect& damage_rect) override;
127 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; 128 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
128 129
129 bool CanCopyToBitmap() const; 130 bool CanCopyToBitmap() const;
130 131
131 // Public interface exposed to RenderWidgetHostView. 132 // Public interface exposed to RenderWidgetHostView.
132 133
133 void SwapDelegatedFrame(uint32_t output_surface_id, 134 void SwapDelegatedFrame(uint32_t output_surface_id,
135 const cc::SurfaceId& surface_id,
134 cc::CompositorFrame frame); 136 cc::CompositorFrame frame);
135 void ClearDelegatedFrame(); 137 void ClearDelegatedFrame();
136 void WasHidden(); 138 void WasHidden();
137 void WasShown(const ui::LatencyInfo& latency_info); 139 void WasShown(const ui::LatencyInfo& latency_info);
138 void WasResized(); 140 void WasResized();
139 bool HasSavedFrame(); 141 bool HasSavedFrame();
140 gfx::Size GetRequestedRendererSize() const; 142 gfx::Size GetRequestedRendererSize() const;
141 void SetCompositor(ui::Compositor* compositor); 143 void SetCompositor(ui::Compositor* compositor);
142 void ResetCompositor(); 144 void ResetCompositor();
143 void SetVSyncParameters(const base::TimeTicks& timebase, 145 void SetVSyncParameters(const base::TimeTicks& timebase,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool skipped_frames_; 275 bool skipped_frames_;
274 std::vector<ui::LatencyInfo> skipped_latency_info_list_; 276 std::vector<ui::LatencyInfo> skipped_latency_info_list_;
275 277
276 std::unique_ptr<ui::Layer> right_gutter_; 278 std::unique_ptr<ui::Layer> right_gutter_;
277 std::unique_ptr<ui::Layer> bottom_gutter_; 279 std::unique_ptr<ui::Layer> bottom_gutter_;
278 280
279 // This is the last root background color from a swapped frame. 281 // This is the last root background color from a swapped frame.
280 SkColor background_color_; 282 SkColor background_color_;
281 283
282 // State for rendering into a Surface. 284 // State for rendering into a Surface.
283 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; 285 uint32_t surface_client_id_;
284 std::unique_ptr<cc::SurfaceFactory> surface_factory_; 286 std::unique_ptr<cc::SurfaceFactory> surface_factory_;
285 cc::SurfaceId surface_id_; 287 cc::SurfaceId surface_id_;
286 gfx::Size current_surface_size_; 288 gfx::Size current_surface_size_;
287 float current_scale_factor_; 289 float current_scale_factor_;
288 cc::ReturnedResourceArray surface_returned_resources_; 290 cc::ReturnedResourceArray surface_returned_resources_;
289 291
290 // This lock is the one waiting for a frame of the right size to come back 292 // This lock is the one waiting for a frame of the right size to come back
291 // from the renderer/GPU process. It is set from the moment the aura window 293 // from the renderer/GPU process. It is set from the moment the aura window
292 // got resized, to the moment we committed the renderer frame of the same 294 // got resized, to the moment we committed the renderer frame of the same
293 // size. It keeps track of the size we expect from the renderer, and locks the 295 // size. It keeps track of the size we expect from the renderer, and locks the
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // YUV readback pipeline. 328 // YUV readback pipeline.
327 std::unique_ptr<display_compositor::ReadbackYUVInterface> 329 std::unique_ptr<display_compositor::ReadbackYUVInterface>
328 yuv_readback_pipeline_; 330 yuv_readback_pipeline_;
329 331
330 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; 332 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_;
331 }; 333 };
332 334
333 } // namespace content 335 } // namespace content
334 336
335 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ 337 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698