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 2150633002: cc: Pass SurfaceId by const ref in more places (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « 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 22 matching lines...) Expand all
33 class CompositorFrame; 33 class CompositorFrame;
34 class CopyOutputRequest; 34 class CopyOutputRequest;
35 class SurfaceManager; 35 class SurfaceManager;
36 class SurfaceFactory; 36 class SurfaceFactory;
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(const SurfaceId& id, SurfaceFactory* factory);
44 ~Surface(); 44 ~Surface();
45 45
46 SurfaceId surface_id() const { return surface_id_; } 46 const SurfaceId& surface_id() const { return surface_id_; }
47 SurfaceId previous_frame_surface_id() const { 47 const 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 52
53 void QueueFrame(CompositorFrame frame, const DrawCallback& draw_callback); 53 void QueueFrame(CompositorFrame frame, const DrawCallback& draw_callback);
54 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request); 54 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> copy_request);
55 // Adds each CopyOutputRequest in the current frame to copy_requests. The 55 // Adds each CopyOutputRequest in the current frame to copy_requests. The
56 // caller takes ownership of them. 56 // caller takes ownership of them.
57 void TakeCopyOutputRequests( 57 void TakeCopyOutputRequests(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 std::vector<SurfaceId> referenced_surfaces_; 111 std::vector<SurfaceId> referenced_surfaces_;
112 112
113 DrawCallback draw_callback_; 113 DrawCallback draw_callback_;
114 114
115 DISALLOW_COPY_AND_ASSIGN(Surface); 115 DISALLOW_COPY_AND_ASSIGN(Surface);
116 }; 116 };
117 117
118 } // namespace cc 118 } // namespace cc
119 119
120 #endif // CC_SURFACES_SURFACE_H_ 120 #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