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

Side by Side Diff: components/mus/ws/server_window_surface.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 | « components/mus/ws/server_window_observer.h ('k') | components/mus/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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_
6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_
7
8 #include <set>
9
10 #include "base/macros.h"
11 #include "cc/ipc/compositor_frame.mojom.h"
12 #include "cc/surfaces/surface_factory.h"
13 #include "cc/surfaces/surface_factory_client.h"
14 #include "cc/surfaces/surface_id.h"
15 #include "cc/surfaces/surface_id_allocator.h"
16 #include "components/mus/public/interfaces/surface.mojom.h"
17 #include "components/mus/public/interfaces/window_tree.mojom.h"
18 #include "components/mus/ws/ids.h"
19 #include "mojo/public/cpp/bindings/binding.h"
20
21 namespace mus {
22
23 class SurfacesState;
24
25 namespace ws {
26
27 class ServerWindow;
28 class ServerWindowSurfaceManager;
29
30 // Server side representation of a WindowSurface.
31 class ServerWindowSurface : public mojom::Surface,
32 public cc::SurfaceFactoryClient {
33 public:
34 ServerWindowSurface(ServerWindowSurfaceManager* manager,
35 mojo::InterfaceRequest<mojom::Surface> request,
36 mojom::SurfaceClientPtr client);
37
38 ~ServerWindowSurface() override;
39
40 const gfx::Size& last_submitted_frame_size() const {
41 return last_submitted_frame_size_;
42 }
43
44 // mojom::Surface:
45 void SubmitCompositorFrame(
46 cc::CompositorFrame frame,
47 const SubmitCompositorFrameCallback& callback) override;
48
49 const cc::SurfaceId& id() const { return surface_id_; }
50
51 // Destroys old surfaces that have been outdated by a new surface.
52 void DestroySurfacesScheduledForDestruction();
53
54 // Registers this with the SurfaceManager
55 void RegisterForBeginFrames();
56
57 private:
58 ServerWindow* window();
59
60 // SurfaceFactoryClient implementation.
61 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
62 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
63
64 ServerWindowSurfaceManager* manager_; // Owns this.
65
66 gfx::Size last_submitted_frame_size_;
67
68 cc::SurfaceId surface_id_;
69 cc::SurfaceFactory surface_factory_;
70
71 mojom::SurfaceClientPtr client_;
72 mojo::Binding<Surface> binding_;
73
74 // Set of surface ids that need to be destroyed.
75 std::set<cc::SurfaceId> surfaces_scheduled_for_destruction_;
76
77 bool registered_surface_factory_client_;
78
79 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface);
80 };
81
82 } // namespace ws
83
84 } // namespace mus
85
86 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_
OLDNEW
« no previous file with comments | « components/mus/ws/server_window_observer.h ('k') | components/mus/ws/server_window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698