OLD | NEW |
---|---|
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 public: | 32 public: |
33 Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory); | 33 Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory); |
34 ~Surface(); | 34 ~Surface(); |
35 | 35 |
36 const gfx::Size& size() const { return size_; } | 36 const gfx::Size& size() const { return size_; } |
37 SurfaceId surface_id() const { return surface_id_; } | 37 SurfaceId surface_id() const { return surface_id_; } |
38 | 38 |
39 void QueueFrame(scoped_ptr<CompositorFrame> frame, | 39 void QueueFrame(scoped_ptr<CompositorFrame> frame, |
40 const base::Closure& draw_callback); | 40 const base::Closure& draw_callback); |
41 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request); | 41 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request); |
42 // Modifies copy_requests to have a ScopedPtrVector for each render pass in | |
43 // the current frame, containing all the copy requests from pass. | |
42 void TakeCopyOutputRequests( | 44 void TakeCopyOutputRequests( |
43 ScopedPtrVector<CopyOutputRequest>* copy_requests); | 45 ScopedPtrVector<ScopedPtrVector<CopyOutputRequest>>* copy_requests); |
jamesr
2014/10/15 03:21:39
why's this a pointer to a vector of pointers of ve
| |
44 // Returns the most recent frame that is eligible to be rendered. | 46 // Returns the most recent frame that is eligible to be rendered. |
45 const CompositorFrame* GetEligibleFrame(); | 47 const CompositorFrame* GetEligibleFrame(); |
46 | 48 |
47 // Returns a number that increments by 1 every time a new frame is enqueued. | 49 // Returns a number that increments by 1 every time a new frame is enqueued. |
48 int frame_index() const { return frame_index_; } | 50 int frame_index() const { return frame_index_; } |
49 | 51 |
50 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); | 52 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); |
51 void RunDrawCallbacks(); | 53 void RunDrawCallbacks(); |
52 | 54 |
53 SurfaceFactory* factory() { return factory_; } | 55 SurfaceFactory* factory() { return factory_; } |
54 | 56 |
55 private: | 57 private: |
58 void ClearCopyRequests(); | |
59 | |
56 SurfaceId surface_id_; | 60 SurfaceId surface_id_; |
57 gfx::Size size_; | 61 gfx::Size size_; |
58 SurfaceFactory* factory_; | 62 SurfaceFactory* factory_; |
59 // TODO(jamesr): Support multiple frames in flight. | 63 // TODO(jamesr): Support multiple frames in flight. |
60 scoped_ptr<CompositorFrame> current_frame_; | 64 scoped_ptr<CompositorFrame> current_frame_; |
61 int frame_index_; | 65 int frame_index_; |
62 ScopedPtrVector<CopyOutputRequest> copy_requests_; | |
63 | 66 |
64 base::Closure draw_callback_; | 67 base::Closure draw_callback_; |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(Surface); | 69 DISALLOW_COPY_AND_ASSIGN(Surface); |
67 }; | 70 }; |
68 | 71 |
69 } // namespace cc | 72 } // namespace cc |
70 | 73 |
71 #endif // CC_SURFACES_SURFACE_H_ | 74 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |