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

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

Issue 1945533002: Add way to mark other Surface a predecessor for a Surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | cc/surfaces/surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CC_SURFACES_SURFACE_H_ 5 #ifndef CC_SURFACES_SURFACE_H_
6 #define CC_SURFACES_SURFACE_H_ 6 #define CC_SURFACES_SURFACE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 26 matching lines...) Expand all
37 class SurfaceResourceHolder; 37 class SurfaceResourceHolder;
38 38
39 class CC_SURFACES_EXPORT Surface { 39 class CC_SURFACES_EXPORT Surface {
40 public: 40 public:
41 using DrawCallback = SurfaceFactory::DrawCallback; 41 using DrawCallback = SurfaceFactory::DrawCallback;
42 42
43 Surface(SurfaceId id, SurfaceFactory* factory); 43 Surface(SurfaceId id, SurfaceFactory* factory);
44 ~Surface(); 44 ~Surface();
45 45
46 SurfaceId surface_id() const { return surface_id_; } 46 SurfaceId surface_id() const { return surface_id_; }
47 SurfaceId previous_frame_surface_id() const {
48 return previous_frame_surface_id_;
49 }
50
51 void SetPreviousFrameSurface(Surface* surface);
47 52
48 void QueueFrame(std::unique_ptr<CompositorFrame> frame, 53 void QueueFrame(std::unique_ptr<CompositorFrame> frame,
49 const DrawCallback& draw_callback); 54 const DrawCallback& draw_callback);
50 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request); 55 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request);
51 // Adds each CopyOutputRequest in the current frame to copy_requests. The 56 // Adds each CopyOutputRequest in the current frame to copy_requests. The
52 // caller takes ownership of them. 57 // caller takes ownership of them.
53 void TakeCopyOutputRequests( 58 void TakeCopyOutputRequests(
54 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>* 59 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>*
55 copy_requests); 60 copy_requests);
56 // Returns the most recent frame that is eligible to be rendered. 61 // Returns the most recent frame that is eligible to be rendered.
(...skipping 24 matching lines...) Expand all
81 return referenced_surfaces_; 86 return referenced_surfaces_;
82 } 87 }
83 88
84 bool destroyed() const { return destroyed_; } 89 bool destroyed() const { return destroyed_; }
85 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } 90 void set_destroyed(bool destroyed) { destroyed_ = destroyed; }
86 91
87 private: 92 private:
88 void ClearCopyRequests(); 93 void ClearCopyRequests();
89 94
90 SurfaceId surface_id_; 95 SurfaceId surface_id_;
96 SurfaceId previous_frame_surface_id_;
91 base::WeakPtr<SurfaceFactory> factory_; 97 base::WeakPtr<SurfaceFactory> factory_;
92 // TODO(jamesr): Support multiple frames in flight. 98 // TODO(jamesr): Support multiple frames in flight.
93 std::unique_ptr<CompositorFrame> current_frame_; 99 std::unique_ptr<CompositorFrame> current_frame_;
94 int frame_index_; 100 int frame_index_;
95 bool destroyed_; 101 bool destroyed_;
96 std::vector<SurfaceSequence> destruction_dependencies_; 102 std::vector<SurfaceSequence> destruction_dependencies_;
97 103
98 // This surface may have multiple BeginFrameSources if it is 104 // This surface may have multiple BeginFrameSources if it is
99 // on multiple Displays. 105 // on multiple Displays.
100 std::set<BeginFrameSource*> begin_frame_sources_; 106 std::set<BeginFrameSource*> begin_frame_sources_;
101 107
102 std::vector<SurfaceId> referenced_surfaces_; 108 std::vector<SurfaceId> referenced_surfaces_;
103 109
104 DrawCallback draw_callback_; 110 DrawCallback draw_callback_;
105 111
106 DISALLOW_COPY_AND_ASSIGN(Surface); 112 DISALLOW_COPY_AND_ASSIGN(Surface);
107 }; 113 };
108 114
109 } // namespace cc 115 } // namespace cc
110 116
111 #endif // CC_SURFACES_SURFACE_H_ 117 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698