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

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

Issue 1304063014: cc: Plumbing for BeginFrameSource based on Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix webview Created 5 years, 2 months 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/onscreen_display_client.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 <set>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/callback.h" 12 #include "base/callback.h"
12 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "cc/base/scoped_ptr_vector.h" 17 #include "cc/base/scoped_ptr_vector.h"
17 #include "cc/output/copy_output_request.h" 18 #include "cc/output/copy_output_request.h"
18 #include "cc/quads/render_pass_id.h" 19 #include "cc/quads/render_pass_id.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return destruction_dependencies_.size(); 74 return destruction_dependencies_.size();
74 } 75 }
75 76
76 const std::vector<SurfaceId>& referenced_surfaces() const { 77 const std::vector<SurfaceId>& referenced_surfaces() const {
77 return referenced_surfaces_; 78 return referenced_surfaces_;
78 } 79 }
79 80
80 bool destroyed() const { return destroyed_; } 81 bool destroyed() const { return destroyed_; }
81 void set_destroyed(bool destroyed) { destroyed_ = destroyed; } 82 void set_destroyed(bool destroyed) { destroyed_ = destroyed; }
82 83
84 void AddBeginFrameSource(BeginFrameSource* begin_frame_source);
85 void RemoveBeginFrameSource(BeginFrameSource* begin_frame_source);
86
83 private: 87 private:
84 void ClearCopyRequests(); 88 void ClearCopyRequests();
89 void UpdatePrimaryBeginFrameSource();
85 90
86 SurfaceId surface_id_; 91 SurfaceId surface_id_;
87 base::WeakPtr<SurfaceFactory> factory_; 92 base::WeakPtr<SurfaceFactory> factory_;
88 // TODO(jamesr): Support multiple frames in flight. 93 // TODO(jamesr): Support multiple frames in flight.
89 scoped_ptr<CompositorFrame> current_frame_; 94 scoped_ptr<CompositorFrame> current_frame_;
90 int frame_index_; 95 int frame_index_;
91 bool destroyed_; 96 bool destroyed_;
92 std::vector<SurfaceSequence> destruction_dependencies_; 97 std::vector<SurfaceSequence> destruction_dependencies_;
93 98
99 // This surface may have multiple BeginFrameSources if it is
100 // on multiple Displays.
101 std::set<BeginFrameSource*> begin_frame_sources_;
102
94 std::vector<SurfaceId> referenced_surfaces_; 103 std::vector<SurfaceId> referenced_surfaces_;
95 104
96 DrawCallback draw_callback_; 105 DrawCallback draw_callback_;
97 106
98 DISALLOW_COPY_AND_ASSIGN(Surface); 107 DISALLOW_COPY_AND_ASSIGN(Surface);
99 }; 108 };
100 109
101 } // namespace cc 110 } // namespace cc
102 111
103 #endif // CC_SURFACES_SURFACE_H_ 112 #endif // CC_SURFACES_SURFACE_H_
OLDNEW
« no previous file with comments | « cc/surfaces/onscreen_display_client.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698