Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "cc/base/scoped_ptr_vector.h" | 16 #include "cc/base/scoped_ptr_vector.h" |
| 17 #include "cc/output/copy_output_request.h" | 17 #include "cc/output/copy_output_request.h" |
| 18 #include "cc/quads/render_pass_id.h" | 18 #include "cc/quads/render_pass_id.h" |
| 19 #include "cc/surfaces/surface_id.h" | 19 #include "cc/surfaces/surface_id.h" |
| 20 #include "cc/surfaces/surface_sequence.h" | |
| 20 #include "cc/surfaces/surfaces_export.h" | 21 #include "cc/surfaces/surfaces_export.h" |
| 21 #include "ui/gfx/geometry/size.h" | 22 #include "ui/gfx/geometry/size.h" |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| 24 struct LatencyInfo; | 25 struct LatencyInfo; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace cc { | 28 namespace cc { |
| 28 class CompositorFrame; | 29 class CompositorFrame; |
| 29 class CopyOutputRequest; | 30 class CopyOutputRequest; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 49 // Returns the most recent frame that is eligible to be rendered. | 50 // Returns the most recent frame that is eligible to be rendered. |
| 50 const CompositorFrame* GetEligibleFrame(); | 51 const CompositorFrame* GetEligibleFrame(); |
| 51 | 52 |
| 52 // Returns a number that increments by 1 every time a new frame is enqueued. | 53 // Returns a number that increments by 1 every time a new frame is enqueued. |
| 53 int frame_index() const { return frame_index_; } | 54 int frame_index() const { return frame_index_; } |
| 54 | 55 |
| 55 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); | 56 void TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info); |
| 56 void RunDrawCallbacks(); | 57 void RunDrawCallbacks(); |
| 57 | 58 |
| 58 base::WeakPtr<SurfaceFactory> factory() { return factory_; } | 59 base::WeakPtr<SurfaceFactory> factory() { return factory_; } |
| 60 base::hash_set<SurfaceSequence>& destruction_dependencies() { | |
| 61 return destruction_dependencies_; | |
| 62 } | |
| 59 | 63 |
| 60 private: | 64 private: |
| 61 void ClearCopyRequests(); | 65 void ClearCopyRequests(); |
| 62 | 66 |
| 63 SurfaceId surface_id_; | 67 SurfaceId surface_id_; |
| 64 gfx::Size size_; | 68 gfx::Size size_; |
| 65 base::WeakPtr<SurfaceFactory> factory_; | 69 base::WeakPtr<SurfaceFactory> factory_; |
| 66 // TODO(jamesr): Support multiple frames in flight. | 70 // TODO(jamesr): Support multiple frames in flight. |
| 67 scoped_ptr<CompositorFrame> current_frame_; | 71 scoped_ptr<CompositorFrame> current_frame_; |
| 68 int frame_index_; | 72 int frame_index_; |
| 73 base::hash_set<SurfaceSequence> destruction_dependencies_; | |
|
piman
2014/11/05 00:36:15
Could this be a vector? AFAICT the only things tha
| |
| 69 | 74 |
| 70 base::Closure draw_callback_; | 75 base::Closure draw_callback_; |
| 71 | 76 |
| 72 DISALLOW_COPY_AND_ASSIGN(Surface); | 77 DISALLOW_COPY_AND_ASSIGN(Surface); |
| 73 }; | 78 }; |
| 74 | 79 |
| 75 } // namespace cc | 80 } // namespace cc |
| 76 | 81 |
| 77 #endif // CC_SURFACES_SURFACE_H_ | 82 #endif // CC_SURFACES_SURFACE_H_ |
| OLD | NEW |