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

Unified Diff: cc/output/compositor_frame_sink.h

Issue 2404993002: cc: Stop calling DetachFromClient if bind failed. (Closed)
Patch Set: detachinternal: . Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: cc/output/compositor_frame_sink.h
diff --git a/cc/output/compositor_frame_sink.h b/cc/output/compositor_frame_sink.h
index ff5e92163963ef1f362f0f2515f2d1baee3cc161..45dde065c618b41c73601c4ed6a8fc364e271362 100644
--- a/cc/output/compositor_frame_sink.h
+++ b/cc/output/compositor_frame_sink.h
@@ -36,13 +36,12 @@ class CompositorFrame;
struct ManagedMemoryPolicy;
class CompositorFrameSinkClient;
-// Represents the output surface for a compositor. The compositor owns
-// and manages its destruction. Its lifetime is:
-// 1. Created on the main thread by the LayerTreeHost through its client.
-// 2. Passed to the compositor thread and bound to a client via BindToClient.
-// From here on, it will only be used on the compositor thread.
-// 3. If the 3D context is lost, then the compositor will delete the output
-// surface (on the compositor thread) and go back to step 1.
+// An interface for submitting CompositorFrames to a display compositor
+// which will compose frames from multiple CompositorFrameSinks to show
+// on screen to the user.
+// If a context_provider() is present, frames should be submitted with
+// OpenGL resources (created with the context_provider()). If not, then
+// SharedBitmap resources should be used.
class CC_EXPORT CompositorFrameSink {
public:
struct Capabilities {
@@ -56,11 +55,11 @@ class CC_EXPORT CompositorFrameSink {
bool delegated_sync_points_required = true;
};
- // Constructor for GL-based and/or software compositing.
+ // Constructor for GL-based and/or software resources.
CompositorFrameSink(scoped_refptr<ContextProvider> context_provider,
scoped_refptr<ContextProvider> worker_context_provider);
- // Constructor for Vulkan-based compositing.
+ // Constructor for Vulkan-based resources.
explicit CompositorFrameSink(
scoped_refptr<VulkanContextProvider> vulkan_context_provider);
@@ -75,8 +74,10 @@ class CC_EXPORT CompositorFrameSink {
// should not be called twice for a given CompositorFrameSink.
virtual bool BindToClient(CompositorFrameSinkClient* client);
- // Called by the compositor on the compositor thread. This is a place where
- // thread-specific data for the output surface can be uninitialized.
+ // Must be called from the thread where BindToClient was called if
+ // BindToClient succeeded, after which the CompositorFrameSink may be
+ // destroyed from any thread. This is a place where thread-specific data for
+ // the object can be uninitialized.
virtual void DetachFromClient();
bool HasClient() { return !!client_; }
@@ -124,8 +125,6 @@ class CC_EXPORT CompositorFrameSink {
base::ThreadChecker client_thread_checker_;
private:
- void DetachFromClientInternal();
-
DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink);
};

Powered by Google App Engine
This is Rietveld 408576698