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

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

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/resources/zero_copy_raster_worker_pool.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
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 20 matching lines...) Expand all
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_; }
59 60
61 // Add a SurfaceSequence that must be satisfied before the Surface is
62 // destroyed.
63 void AddDestructionDependency(SurfaceSequence sequence);
64
65 // Satisfy all destruction dependencies that are contained in sequences, and
66 // remove them from sequences.
67 void SatisfyDestructionDependencies(
68 base::hash_set<SurfaceSequence>* sequences);
69 size_t GetDestructionDependencyCount() const {
70 return destruction_dependencies_.size();
71 }
72
60 private: 73 private:
61 void ClearCopyRequests(); 74 void ClearCopyRequests();
62 75
63 SurfaceId surface_id_; 76 SurfaceId surface_id_;
64 gfx::Size size_; 77 gfx::Size size_;
65 base::WeakPtr<SurfaceFactory> factory_; 78 base::WeakPtr<SurfaceFactory> factory_;
66 // TODO(jamesr): Support multiple frames in flight. 79 // TODO(jamesr): Support multiple frames in flight.
67 scoped_ptr<CompositorFrame> current_frame_; 80 scoped_ptr<CompositorFrame> current_frame_;
68 int frame_index_; 81 int frame_index_;
82 std::vector<SurfaceSequence> destruction_dependencies_;
69 83
70 base::Closure draw_callback_; 84 base::Closure draw_callback_;
71 85
72 DISALLOW_COPY_AND_ASSIGN(Surface); 86 DISALLOW_COPY_AND_ASSIGN(Surface);
73 }; 87 };
74 88
75 } // namespace cc 89 } // namespace cc
76 90
77 #endif // CC_SURFACES_SURFACE_H_ 91 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/resources/zero_copy_raster_worker_pool.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698