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

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

Issue 1989453003: cc: Add ScopedReadLockGpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix aura typo 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 | « cc/resources/resource_provider_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 { 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);
53 int gpu_memory_buffer_client_id() const {
54 return gpu_memory_buffer_client_id_;
55 }
52 56
53 void QueueFrame(std::unique_ptr<CompositorFrame> frame, 57 void QueueFrame(std::unique_ptr<CompositorFrame> frame,
54 const DrawCallback& draw_callback); 58 const DrawCallback& draw_callback);
55 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request); 59 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request);
56 // Adds each CopyOutputRequest in the current frame to copy_requests. The 60 // Adds each CopyOutputRequest in the current frame to copy_requests. The
57 // caller takes ownership of them. 61 // caller takes ownership of them.
58 void TakeCopyOutputRequests( 62 void TakeCopyOutputRequests(
59 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>* 63 std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>*
60 copy_requests); 64 copy_requests);
61 // Returns the most recent frame that is eligible to be rendered. 65 // Returns the most recent frame that is eligible to be rendered.
(...skipping 25 matching lines...) Expand all
87 } 91 }
88 92
89 bool destroyed() const { return destroyed_; } 93 bool destroyed() const { return destroyed_; }
90 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } 94 void set_destroyed(bool destroyed) { destroyed_ = destroyed; }
91 95
92 private: 96 private:
93 void ClearCopyRequests(); 97 void ClearCopyRequests();
94 98
95 SurfaceId surface_id_; 99 SurfaceId surface_id_;
96 SurfaceId previous_frame_surface_id_; 100 SurfaceId previous_frame_surface_id_;
101 int gpu_memory_buffer_client_id_ = -1;
97 base::WeakPtr<SurfaceFactory> factory_; 102 base::WeakPtr<SurfaceFactory> factory_;
98 // TODO(jamesr): Support multiple frames in flight. 103 // TODO(jamesr): Support multiple frames in flight.
99 std::unique_ptr<CompositorFrame> current_frame_; 104 std::unique_ptr<CompositorFrame> current_frame_;
100 int frame_index_; 105 int frame_index_;
101 bool destroyed_; 106 bool destroyed_;
102 std::vector<SurfaceSequence> destruction_dependencies_; 107 std::vector<SurfaceSequence> destruction_dependencies_;
103 108
104 // This surface may have multiple BeginFrameSources if it is 109 // This surface may have multiple BeginFrameSources if it is
105 // on multiple Displays. 110 // on multiple Displays.
106 std::set<BeginFrameSource*> begin_frame_sources_; 111 std::set<BeginFrameSource*> begin_frame_sources_;
107 112
108 std::vector<SurfaceId> referenced_surfaces_; 113 std::vector<SurfaceId> referenced_surfaces_;
109 114
110 DrawCallback draw_callback_; 115 DrawCallback draw_callback_;
111 116
112 DISALLOW_COPY_AND_ASSIGN(Surface); 117 DISALLOW_COPY_AND_ASSIGN(Surface);
113 }; 118 };
114 119
115 } // namespace cc 120 } // namespace cc
116 121
117 #endif // CC_SURFACES_SURFACE_H_ 122 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/resources/resource_provider_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698