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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2676353002: MojoCompositorFrameSinkPrivate should support copy requests (Closed)
Patch Set: c Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 5 #ifndef CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
11 #include "cc/output/copy_output_request.h"
12 #include "cc/output/copy_output_result.h"
11 #include "cc/scheduler/begin_frame_source.h" 13 #include "cc/scheduler/begin_frame_source.h"
12 #include "cc/surfaces/display.h" 14 #include "cc/surfaces/display.h"
13 #include "cc/surfaces/display_client.h" 15 #include "cc/surfaces/display_client.h"
14 #include "cc/surfaces/surface_factory.h" 16 #include "cc/surfaces/surface_factory.h"
15 #include "cc/surfaces/surface_factory_client.h" 17 #include "cc/surfaces/surface_factory_client.h"
16 #include "cc/surfaces/surfaces_export.h" 18 #include "cc/surfaces/surfaces_export.h"
17 19
18 namespace cc { 20 namespace cc {
19 21
20 class CompositorFrameSinkSupportClient; 22 class CompositorFrameSinkSupportClient;
(...skipping 18 matching lines...) Expand all
39 41
40 void EvictFrame(); 42 void EvictFrame();
41 void SetNeedsBeginFrame(bool needs_begin_frame); 43 void SetNeedsBeginFrame(bool needs_begin_frame);
42 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, 44 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id,
43 CompositorFrame frame); 45 CompositorFrame frame);
44 void Require(const LocalSurfaceId& local_surface_id, 46 void Require(const LocalSurfaceId& local_surface_id,
45 const SurfaceSequence& sequence); 47 const SurfaceSequence& sequence);
46 void Satisfy(const SurfaceSequence& sequence); 48 void Satisfy(const SurfaceSequence& sequence);
47 void AddChildFrameSink(const FrameSinkId& child_frame_sink_id); 49 void AddChildFrameSink(const FrameSinkId& child_frame_sink_id);
48 void RemoveChildFrameSink(const FrameSinkId& child_frame_sink_id); 50 void RemoveChildFrameSink(const FrameSinkId& child_frame_sink_id);
51 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request);
52 void ReleaseCopyOfSurface(const gpu::Mailbox& mailbox,
53 const gpu::SyncToken& sync_token,
54 bool is_lost);
49 55
50 Display* display() { return display_.get(); } 56 Display* display() { return display_.get(); }
51 57
52 private: 58 private:
53 void DidReceiveCompositorFrameAck(); 59 void DidReceiveCompositorFrameAck();
54 60
61 void OnTextureReceived(CopyOutputRequest::CopyOutputRequestCallback callback,
62 std::unique_ptr<CopyOutputResult> result);
63
55 // DisplayClient implementation. 64 // DisplayClient implementation.
56 void DisplayOutputSurfaceLost() override; 65 void DisplayOutputSurfaceLost() override;
57 void DisplayWillDrawAndSwap(bool will_draw_and_swap, 66 void DisplayWillDrawAndSwap(bool will_draw_and_swap,
58 const RenderPassList& render_passes) override; 67 const RenderPassList& render_passes) override;
59 void DisplayDidDrawAndSwap() override; 68 void DisplayDidDrawAndSwap() override;
60 69
61 // SurfaceFactoryClient implementation. 70 // SurfaceFactoryClient implementation.
62 void ReturnResources(const ReturnedResourceArray& resources) override; 71 void ReturnResources(const ReturnedResourceArray& resources) override;
63 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; 72 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override;
64 void WillDrawSurface(const LocalSurfaceId& local_surface_id, 73 void WillDrawSurface(const LocalSurfaceId& local_surface_id,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 106
98 // Whether a request for begin frames has been issued. 107 // Whether a request for begin frames has been issued.
99 bool needs_begin_frame_ = false; 108 bool needs_begin_frame_ = false;
100 109
101 // Whether or not a frame observer has been added. 110 // Whether or not a frame observer has been added.
102 bool added_frame_observer_ = false; 111 bool added_frame_observer_ = false;
103 112
104 // The set of BeginFrame children of this CompositorFrameSink. 113 // The set of BeginFrame children of this CompositorFrameSink.
105 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_; 114 std::unordered_set<FrameSinkId, FrameSinkIdHash> child_frame_sinks_;
106 115
116 std::map<gpu::Mailbox, std::unique_ptr<SingleReleaseCallback>>
117 release_callbacks_;
118
107 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; 119 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
108 120
109 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); 121 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);
110 }; 122 };
111 123
112 } // namespace cc 124 } // namespace cc
113 125
114 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 126 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698