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

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

Issue 2383373002: Reduce SurfaceIdAllocator usage and tie SurfaceFactory to a single FrameSinkId (Closed)
Patch Set: Rebased 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/surfaces/compositor_frame_sink.cc ('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"
11 #include "cc/ipc/compositor_frame.mojom.h" 11 #include "cc/ipc/compositor_frame.mojom.h"
12 #include "cc/surfaces/frame_sink_id.h"
12 #include "cc/surfaces/surface_factory.h" 13 #include "cc/surfaces/surface_factory.h"
13 #include "cc/surfaces/surface_factory_client.h" 14 #include "cc/surfaces/surface_factory_client.h"
14 #include "cc/surfaces/surface_id.h" 15 #include "cc/surfaces/surface_id.h"
15 #include "cc/surfaces/surface_id_allocator.h" 16 #include "cc/surfaces/surface_id_allocator.h"
16 #include "mojo/public/cpp/bindings/binding.h" 17 #include "mojo/public/cpp/bindings/binding.h"
17 #include "services/ui/public/interfaces/surface.mojom.h" 18 #include "services/ui/public/interfaces/surface.mojom.h"
18 #include "services/ui/public/interfaces/window_tree.mojom.h" 19 #include "services/ui/public/interfaces/window_tree.mojom.h"
19 #include "services/ui/ws/ids.h" 20 #include "services/ui/ws/ids.h"
20 21
21 namespace ui { 22 namespace ui {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Destroys old surfaces that have been outdated by a new surface. 54 // Destroys old surfaces that have been outdated by a new surface.
54 void DestroySurfacesScheduledForDestruction(); 55 void DestroySurfacesScheduledForDestruction();
55 56
56 private: 57 private:
57 ServerWindow* window(); 58 ServerWindow* window();
58 59
59 // SurfaceFactoryClient implementation. 60 // SurfaceFactoryClient implementation.
60 void ReturnResources(const cc::ReturnedResourceArray& resources) override; 61 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
61 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; 62 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
62 63
64 const cc::FrameSinkId frame_sink_id_;
65
63 ServerWindowSurfaceManager* manager_; // Owns this. 66 ServerWindowSurfaceManager* manager_; // Owns this.
64 67
65 gfx::Size last_submitted_frame_size_; 68 gfx::Size last_submitted_frame_size_;
66 69
67 cc::SurfaceId surface_id_; 70 cc::SurfaceId surface_id_;
68 cc::SurfaceIdAllocator surface_id_allocator_; 71 cc::SurfaceIdAllocator surface_id_allocator_;
69 cc::SurfaceFactory surface_factory_; 72 cc::SurfaceFactory surface_factory_;
70 73
71 mojom::SurfaceClientPtr client_; 74 mojom::SurfaceClientPtr client_;
72 mojo::Binding<Surface> binding_; 75 mojo::Binding<Surface> binding_;
73 76
74 // Set of surface ids that need to be destroyed. 77 // Set of surface ids that need to be destroyed.
75 std::set<cc::SurfaceId> surfaces_scheduled_for_destruction_; 78 std::set<cc::SurfaceId> surfaces_scheduled_for_destruction_;
76 79
77 bool may_contain_video_ = false; 80 bool may_contain_video_ = false;
78 81
79 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); 82 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface);
80 }; 83 };
81 84
82 } // namespace ws 85 } // namespace ws
83 86
84 } // namespace ui 87 } // namespace ui
85 88
86 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ 89 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_
OLDNEW
« no previous file with comments | « services/ui/surfaces/compositor_frame_sink.cc ('k') | services/ui/ws/server_window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698