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

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

Issue 2098953003: Make cc::CompositorFrames movable [Part 2 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed exo unittests 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
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 SurfaceId previous_frame_surface_id() const { 47 SurfaceId previous_frame_surface_id() const {
48 return previous_frame_surface_id_; 48 return previous_frame_surface_id_;
49 } 49 }
50 50
51 void SetPreviousFrameSurface(Surface* surface); 51 void SetPreviousFrameSurface(Surface* surface);
52 void SetGpuMemoryBufferClientId(int gpu_memory_buffer_client_id); 52 void SetGpuMemoryBufferClientId(int gpu_memory_buffer_client_id);
53 int gpu_memory_buffer_client_id() const { 53 int gpu_memory_buffer_client_id() const {
54 return gpu_memory_buffer_client_id_; 54 return gpu_memory_buffer_client_id_;
55 } 55 }
56 56
57 void QueueFrame(std::unique_ptr<CompositorFrame> frame, 57 void QueueFrame(CompositorFrame frame, const DrawCallback& draw_callback);
58 const DrawCallback& draw_callback);
59 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request); 58 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request);
60 // Adds each CopyOutputRequest in the current frame to copy_requests. The 59 // Adds each CopyOutputRequest in the current frame to copy_requests. The
61 // caller takes ownership of them. 60 // caller takes ownership of them.
62 void TakeCopyOutputRequests( 61 void TakeCopyOutputRequests(
63 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>* 62 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>*
64 copy_requests); 63 copy_requests);
64
65 // Returns the most recent frame that is eligible to be rendered. 65 // Returns the most recent frame that is eligible to be rendered.
66 const CompositorFrame* GetEligibleFrame(); 66 // If the CompositorFrame's DelegateFrameData is null then there is
67 // no eligible frame.
68 const CompositorFrame& GetEligibleFrame();
67 69
68 // Returns a number that increments by 1 every time a new frame is enqueued. 70 // Returns a number that increments by 1 every time a new frame is enqueued.
69 int frame_index() const { return frame_index_; } 71 int frame_index() const { return frame_index_; }
70 72
71 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); 73 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info);
72 void RunDrawCallbacks(SurfaceDrawStatus drawn); 74 void RunDrawCallbacks(SurfaceDrawStatus drawn);
73 75
74 base::WeakPtr<SurfaceFactory> factory() { return factory_; } 76 base::WeakPtr<SurfaceFactory> factory() { return factory_; }
75 77
76 // Add a SurfaceSequence that must be satisfied before the Surface is 78 // Add a SurfaceSequence that must be satisfied before the Surface is
(...skipping 18 matching lines...) Expand all
95 97
96 private: 98 private:
97 void UnrefFrameResources(DelegatedFrameData* frame_data); 99 void UnrefFrameResources(DelegatedFrameData* frame_data);
98 void ClearCopyRequests(); 100 void ClearCopyRequests();
99 101
100 SurfaceId surface_id_; 102 SurfaceId surface_id_;
101 SurfaceId previous_frame_surface_id_; 103 SurfaceId previous_frame_surface_id_;
102 int gpu_memory_buffer_client_id_ = -1; 104 int gpu_memory_buffer_client_id_ = -1;
103 base::WeakPtr<SurfaceFactory> factory_; 105 base::WeakPtr<SurfaceFactory> factory_;
104 // TODO(jamesr): Support multiple frames in flight. 106 // TODO(jamesr): Support multiple frames in flight.
105 std::unique_ptr<CompositorFrame> current_frame_; 107 CompositorFrame current_frame_;
106 int frame_index_; 108 int frame_index_;
107 bool destroyed_; 109 bool destroyed_;
108 std::vector<SurfaceSequence> destruction_dependencies_; 110 std::vector<SurfaceSequence> destruction_dependencies_;
109 111
110 // This surface may have multiple BeginFrameSources if it is 112 // This surface may have multiple BeginFrameSources if it is
111 // on multiple Displays. 113 // on multiple Displays.
112 std::set<BeginFrameSource*> begin_frame_sources_; 114 std::set<BeginFrameSource*> begin_frame_sources_;
113 115
114 std::vector<SurfaceId> referenced_surfaces_; 116 std::vector<SurfaceId> referenced_surfaces_;
115 117
116 DrawCallback draw_callback_; 118 DrawCallback draw_callback_;
117 119
118 DISALLOW_COPY_AND_ASSIGN(Surface); 120 DISALLOW_COPY_AND_ASSIGN(Surface);
119 }; 121 };
120 122
121 } // namespace cc 123 } // namespace cc
122 124
123 #endif // CC_SURFACES_SURFACE_H_ 125 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698