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

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

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_COMPOSITOR_DELEGATED_FRAME_HOST_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_
6 #define CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_
7 7
8 #include "cc/layers/delegated_frame_provider.h" 8 #include "cc/layers/delegated_frame_provider.h"
9 #include "cc/layers/delegated_frame_resource_collection.h" 9 #include "cc/layers/delegated_frame_resource_collection.h"
10 #include "cc/output/copy_output_result.h" 10 #include "cc/output/copy_output_result.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 bool CanSubscribeFrame() const; 110 bool CanSubscribeFrame() const;
111 void BeginFrameSubscription( 111 void BeginFrameSubscription(
112 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); 112 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber);
113 void EndFrameSubscription(); 113 void EndFrameSubscription();
114 bool HasFrameSubscriber() const { return frame_subscriber_; } 114 bool HasFrameSubscriber() const { return frame_subscriber_; }
115 115
116 // Exposed for tests. 116 // Exposed for tests.
117 cc::DelegatedFrameProvider* FrameProviderForTesting() const { 117 cc::DelegatedFrameProvider* FrameProviderForTesting() const {
118 return frame_provider_.get(); 118 return frame_provider_.get();
119 } 119 }
120 cc::SurfaceHolder* SurfaceHolderForTesting() const {
121 return surface_holder_.get();
122 }
120 cc::SurfaceId SurfaceIdForTesting() const { return surface_id_; } 123 cc::SurfaceId SurfaceIdForTesting() const { return surface_id_; }
121 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { 124 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) {
122 OnCompositingDidCommit(compositor); 125 OnCompositingDidCommit(compositor);
123 } 126 }
124 bool ShouldCreateResizeLockForTesting() { return ShouldCreateResizeLock(); } 127 bool ShouldCreateResizeLockForTesting() { return ShouldCreateResizeLock(); }
125 bool ReleasedFrontLockActiveForTesting() const { 128 bool ReleasedFrontLockActiveForTesting() const {
126 return !!released_front_lock_.get(); 129 return !!released_front_lock_.get();
127 } 130 }
128 131
129 private: 132 private:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // renderer. 263 // renderer.
261 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_; 264 scoped_refptr<cc::DelegatedFrameResourceCollection> resource_collection_;
262 265
263 // Provides delegated frame updates to the cc::DelegatedRendererLayer. 266 // Provides delegated frame updates to the cc::DelegatedRendererLayer.
264 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_; 267 scoped_refptr<cc::DelegatedFrameProvider> frame_provider_;
265 268
266 // State for rendering into a Surface. 269 // State for rendering into a Surface.
267 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; 270 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_;
268 scoped_ptr<cc::SurfaceFactory> surface_factory_; 271 scoped_ptr<cc::SurfaceFactory> surface_factory_;
269 cc::SurfaceId surface_id_; 272 cc::SurfaceId surface_id_;
273 scoped_refptr<cc::SurfaceHolder> surface_holder_;
270 gfx::Size current_surface_size_; 274 gfx::Size current_surface_size_;
271 cc::ReturnedResourceArray surface_returned_resources_; 275 cc::ReturnedResourceArray surface_returned_resources_;
272 276
273 // This lock is the one waiting for a frame of the right size to come back 277 // This lock is the one waiting for a frame of the right size to come back
274 // from the renderer/GPU process. It is set from the moment the aura window 278 // from the renderer/GPU process. It is set from the moment the aura window
275 // got resized, to the moment we committed the renderer frame of the same 279 // got resized, to the moment we committed the renderer frame of the same
276 // size. It keeps track of the size we expect from the renderer, and locks the 280 // size. It keeps track of the size we expect from the renderer, and locks the
277 // compositor, as well as the UI for a short time to give a chance to the 281 // compositor, as well as the UI for a short time to give a chance to the
278 // renderer of producing a frame of the right size. 282 // renderer of producing a frame of the right size.
279 scoped_ptr<ResizeLock> resize_lock_; 283 scoped_ptr<ResizeLock> resize_lock_;
(...skipping 24 matching lines...) Expand all
304 // YUV readback pipeline. 308 // YUV readback pipeline.
305 scoped_ptr<content::ReadbackYUVInterface> 309 scoped_ptr<content::ReadbackYUVInterface>
306 yuv_readback_pipeline_; 310 yuv_readback_pipeline_;
307 311
308 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; 312 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_;
309 }; 313 };
310 314
311 } // namespace content 315 } // namespace content
312 316
313 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ 317 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698