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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.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 <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 namespace cc { 28 namespace cc {
29 class CompositorFrame; 29 class CompositorFrame;
30 class CopyOutputRequest; 30 class CopyOutputRequest;
31 class SurfaceManager; 31 class SurfaceManager;
32 class SurfaceFactory; 32 class SurfaceFactory;
33 class SurfaceResourceHolder; 33 class SurfaceResourceHolder;
34 34
35 class CC_SURFACES_EXPORT Surface { 35 class CC_SURFACES_EXPORT Surface {
36 public: 36 public:
37 Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory); 37 Surface(SurfaceId id, SurfaceFactory* factory);
38 ~Surface(); 38 ~Surface();
39 39
40 const gfx::Size& size() const { return size_; }
41 SurfaceId surface_id() const { return surface_id_; } 40 SurfaceId surface_id() const { return surface_id_; }
42 41
43 void QueueFrame(scoped_ptr<CompositorFrame> frame, 42 void QueueFrame(scoped_ptr<CompositorFrame> frame,
44 const base::Closure& draw_callback); 43 const base::Closure& draw_callback);
45 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request); 44 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request);
46 // Adds each CopyOutputRequest in the current frame to copy_requests. The 45 // Adds each CopyOutputRequest in the current frame to copy_requests. The
47 // caller takes ownership of them. 46 // caller takes ownership of them.
48 void TakeCopyOutputRequests( 47 void TakeCopyOutputRequests(
49 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests); 48 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests);
50 // Returns the most recent frame that is eligible to be rendered. 49 // Returns the most recent frame that is eligible to be rendered.
(...skipping 16 matching lines...) Expand all
67 void SatisfyDestructionDependencies( 66 void SatisfyDestructionDependencies(
68 base::hash_set<SurfaceSequence>* sequences); 67 base::hash_set<SurfaceSequence>* sequences);
69 size_t GetDestructionDependencyCount() const { 68 size_t GetDestructionDependencyCount() const {
70 return destruction_dependencies_.size(); 69 return destruction_dependencies_.size();
71 } 70 }
72 71
73 private: 72 private:
74 void ClearCopyRequests(); 73 void ClearCopyRequests();
75 74
76 SurfaceId surface_id_; 75 SurfaceId surface_id_;
77 gfx::Size size_;
78 base::WeakPtr<SurfaceFactory> factory_; 76 base::WeakPtr<SurfaceFactory> factory_;
79 // TODO(jamesr): Support multiple frames in flight. 77 // TODO(jamesr): Support multiple frames in flight.
80 scoped_ptr<CompositorFrame> current_frame_; 78 scoped_ptr<CompositorFrame> current_frame_;
81 int frame_index_; 79 int frame_index_;
82 std::vector<SurfaceSequence> destruction_dependencies_; 80 std::vector<SurfaceSequence> destruction_dependencies_;
83 81
84 base::Closure draw_callback_; 82 base::Closure draw_callback_;
85 83
86 DISALLOW_COPY_AND_ASSIGN(Surface); 84 DISALLOW_COPY_AND_ASSIGN(Surface);
87 }; 85 };
88 86
89 } // namespace cc 87 } // namespace cc
90 88
91 #endif // CC_SURFACES_SURFACE_H_ 89 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/display.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698