| OLD | NEW |
| 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 COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_ | 5 #ifndef COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_ |
| 6 #define COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_ | 6 #define COMPONENTS_MUS_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/surfaces/surface_factory.h" | 12 #include "cc/surfaces/surface_factory.h" |
| 12 #include "cc/surfaces/surface_factory_client.h" | 13 #include "cc/surfaces/surface_factory_client.h" |
| 13 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
| 14 #include "cc/surfaces/surface_id_allocator.h" | 15 #include "cc/surfaces/surface_id_allocator.h" |
| 15 #include "components/mus/public/interfaces/compositor_frame.mojom.h" | 16 #include "components/mus/public/interfaces/surface.mojom.h" |
| 16 #include "components/mus/public/interfaces/window_tree.mojom.h" | 17 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 17 #include "components/mus/ws/ids.h" | 18 #include "components/mus/ws/ids.h" |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
| 19 | 20 |
| 20 namespace mus { | 21 namespace mus { |
| 21 | 22 |
| 22 class SurfacesState; | 23 class SurfacesState; |
| 23 | 24 |
| 24 namespace ws { | 25 namespace ws { |
| 25 | 26 |
| 26 class ServerWindow; | 27 class ServerWindow; |
| 27 class ServerWindowSurfaceManager; | 28 class ServerWindowSurfaceManager; |
| 28 | 29 |
| 29 // Server side representation of a WindowSurface. | 30 // Server side representation of a WindowSurface. |
| 30 class ServerWindowSurface : public mojom::Surface, | 31 class ServerWindowSurface : public mojom::Surface, |
| 31 public cc::SurfaceFactoryClient { | 32 public cc::SurfaceFactoryClient { |
| 32 public: | 33 public: |
| 33 ServerWindowSurface(ServerWindowSurfaceManager* manager, | 34 ServerWindowSurface(ServerWindowSurfaceManager* manager, |
| 34 mojo::InterfaceRequest<mojom::Surface> request, | 35 mojo::InterfaceRequest<mojom::Surface> request, |
| 35 mojom::SurfaceClientPtr client); | 36 mojom::SurfaceClientPtr client); |
| 36 | 37 |
| 37 ~ServerWindowSurface() override; | 38 ~ServerWindowSurface() override; |
| 38 | 39 |
| 39 const gfx::Size& last_submitted_frame_size() const { | 40 const gfx::Size& last_submitted_frame_size() const { |
| 40 return last_submitted_frame_size_; | 41 return last_submitted_frame_size_; |
| 41 } | 42 } |
| 42 | 43 |
| 43 // mojom::Surface: | 44 // mojom::Surface: |
| 44 void SubmitCompositorFrame( | 45 void SubmitCompositorFrame( |
| 45 mojom::CompositorFramePtr frame, | 46 cc::mojom::CompositorFramePtr frame, |
| 46 const SubmitCompositorFrameCallback& callback) override; | 47 const SubmitCompositorFrameCallback& callback) override; |
| 47 | 48 |
| 48 const cc::SurfaceId& id() const { return surface_id_; } | 49 const cc::SurfaceId& id() const { return surface_id_; } |
| 49 | 50 |
| 50 // Destroys old surfaces that have been outdated by a new surface. | 51 // Destroys old surfaces that have been outdated by a new surface. |
| 51 void DestroySurfacesScheduledForDestruction(); | 52 void DestroySurfacesScheduledForDestruction(); |
| 52 | 53 |
| 53 // Registers this with the SurfaceManager | 54 // Registers this with the SurfaceManager |
| 54 void RegisterForBeginFrames(); | 55 void RegisterForBeginFrames(); |
| 55 | 56 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 bool registered_surface_factory_client_; | 77 bool registered_surface_factory_client_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); | 79 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace ws | 82 } // namespace ws |
| 82 | 83 |
| 83 } // namespace mus | 84 } // namespace mus |
| 84 | 85 |
| 85 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_ | 86 #endif // COMPONENTS_MUS_WS_SERVER_WINDOW_SURFACE_H_ |
| OLD | NEW |