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

Side by Side Diff: services/ui/ws/server_window_surface.h

Issue 2400723003: Mus+Ash: Use standard cc mechanism for surface lifetime. (Closed)
Patch Set: Only AddObserver once Created 4 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 | « services/ui/ws/server_window_delegate.h ('k') | services/ui/ws/server_window_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_
6 #define SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ 6 #define SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return last_submitted_frame_size_; 43 return last_submitted_frame_size_;
44 } 44 }
45 45
46 bool may_contain_video() const { return may_contain_video_; } 46 bool may_contain_video() const { return may_contain_video_; }
47 47
48 // mojom::Surface: 48 // mojom::Surface:
49 void SubmitCompositorFrame( 49 void SubmitCompositorFrame(
50 cc::CompositorFrame frame, 50 cc::CompositorFrame frame,
51 const SubmitCompositorFrameCallback& callback) override; 51 const SubmitCompositorFrameCallback& callback) override;
52 52
53 // There is a 1-1 correspondence between FrameSinks and frame sources.
54 // The FrameSinkId uniquely identifies the FrameSink, and since there is
55 // one FrameSink per ServerWindowSurface, it allows the window server
56 // to uniquely identify the window, and the thus the client that generated the
57 // frame.
58 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
59
60 // The LocalFrameId can be thought of as an identifier to a bucket of
61 // sequentially submitted CompositorFrames in the same FrameSink all sharing
62 // the same size and device scale factor.
53 const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; } 63 const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; }
54 64
65 bool has_frame() const { return !local_frame_id_.is_null(); }
66
55 cc::SurfaceId GetSurfaceId() const; 67 cc::SurfaceId GetSurfaceId() const;
56 68
57 // Destroys old surfaces that have been outdated by a new surface. 69 ServerWindow* window();
58 void DestroySurfacesScheduledForDestruction();
59 70
60 private: 71 private:
61 ServerWindow* window();
62 72
63 // SurfaceFactoryClient implementation. 73 // SurfaceFactoryClient implementation.
64 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 74 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
65 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; 75 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
66 76
67 const cc::FrameSinkId frame_sink_id_; 77 const cc::FrameSinkId frame_sink_id_;
68 78
69 ServerWindowSurfaceManager* manager_; // Owns this. 79 ServerWindowSurfaceManager* manager_; // Owns this.
70 80
71 gfx::Size last_submitted_frame_size_; 81 gfx::Size last_submitted_frame_size_;
72 82
73 cc::LocalFrameId local_frame_id_; 83 cc::LocalFrameId local_frame_id_;
74 cc::SurfaceIdAllocator surface_id_allocator_; 84 cc::SurfaceIdAllocator surface_id_allocator_;
75 cc::SurfaceFactory surface_factory_; 85 cc::SurfaceFactory surface_factory_;
76 86
77 mojom::SurfaceClientPtr client_; 87 mojom::SurfaceClientPtr client_;
78 mojo::Binding<Surface> binding_; 88 mojo::Binding<Surface> binding_;
79 89
80 // Set of surface ids that need to be destroyed.
81 std::set<cc::LocalFrameId> surfaces_scheduled_for_destruction_;
82
83 bool may_contain_video_ = false; 90 bool may_contain_video_ = false;
84 91
85 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); 92 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface);
86 }; 93 };
87 94
88 } // namespace ws 95 } // namespace ws
89 96
90 } // namespace ui 97 } // namespace ui
91 98
92 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ 99 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_
OLDNEW
« no previous file with comments | « services/ui/ws/server_window_delegate.h ('k') | services/ui/ws/server_window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698