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 "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class CC_SURFACES_EXPORT Surface { | 21 class CC_SURFACES_EXPORT Surface { |
22 public: | 22 public: |
23 Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory); | 23 Surface(SurfaceId id, const gfx::Size& size, SurfaceFactory* factory); |
24 ~Surface(); | 24 ~Surface(); |
25 | 25 |
26 const gfx::Size& size() const { return size_; } | 26 const gfx::Size& size() const { return size_; } |
27 SurfaceId surface_id() const { return surface_id_; } | 27 SurfaceId surface_id() const { return surface_id_; } |
28 | 28 |
29 void QueueFrame(scoped_ptr<CompositorFrame> frame); | 29 void QueueFrame(scoped_ptr<CompositorFrame> frame); |
30 // Returns the most recent frame that is eligible to be rendered. | 30 // Returns the most recent frame that is eligible to be rendered. |
31 CompositorFrame* GetEligibleFrame(); | 31 const CompositorFrame* GetEligibleFrame(); |
32 | 32 |
33 SurfaceFactory* factory() { return factory_; } | 33 SurfaceFactory* factory() { return factory_; } |
34 | 34 |
35 private: | 35 private: |
36 SurfaceId surface_id_; | 36 SurfaceId surface_id_; |
37 gfx::Size size_; | 37 gfx::Size size_; |
38 SurfaceFactory* factory_; | 38 SurfaceFactory* factory_; |
39 // TODO(jamesr): Support multiple frames in flight. | 39 // TODO(jamesr): Support multiple frames in flight. |
40 scoped_ptr<CompositorFrame> current_frame_; | 40 scoped_ptr<CompositorFrame> current_frame_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(Surface); | 42 DISALLOW_COPY_AND_ASSIGN(Surface); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace cc | 45 } // namespace cc |
46 | 46 |
47 #endif // CC_SURFACES_SURFACE_H_ | 47 #endif // CC_SURFACES_SURFACE_H_ |
OLD | NEW |