| 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 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/frame_sink_id.h" |
| 13 #include "cc/surfaces/surface_factory.h" | 13 #include "cc/surfaces/surface_factory.h" |
| 14 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
| 15 #include "cc/surfaces/surface_id.h" | 15 #include "cc/surfaces/surface_id.h" |
| 16 #include "cc/surfaces/surface_id_allocator.h" | 16 #include "cc/surfaces/surface_id_allocator.h" |
| 17 #include "cc/surfaces/surface_sequence_generator.h" | |
| 18 #include "mojo/public/cpp/bindings/binding.h" | 17 #include "mojo/public/cpp/bindings/binding.h" |
| 19 #include "services/ui/public/interfaces/surface.mojom.h" | 18 #include "services/ui/public/interfaces/surface.mojom.h" |
| 20 #include "services/ui/public/interfaces/window_tree.mojom.h" | 19 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 21 #include "services/ui/ws/ids.h" | 20 #include "services/ui/ws/ids.h" |
| 22 | 21 |
| 23 namespace ui { | 22 namespace ui { |
| 24 | 23 |
| 25 class DisplayCompositor; | 24 class DisplayCompositor; |
| 26 | 25 |
| 27 namespace ws { | 26 namespace ws { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 59 |
| 61 // The LocalFrameId can be thought of as an identifier to a bucket of | 60 // The LocalFrameId can be thought of as an identifier to a bucket of |
| 62 // sequentially submitted CompositorFrames in the same FrameSink all sharing | 61 // sequentially submitted CompositorFrames in the same FrameSink all sharing |
| 63 // the same size and device scale factor. | 62 // the same size and device scale factor. |
| 64 const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; } | 63 const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; } |
| 65 | 64 |
| 66 bool has_frame() const { return !local_frame_id_.is_null(); } | 65 bool has_frame() const { return !local_frame_id_.is_null(); } |
| 67 | 66 |
| 68 cc::SurfaceId GetSurfaceId() const; | 67 cc::SurfaceId GetSurfaceId() const; |
| 69 | 68 |
| 70 // Creates a surface dependency token that expires when this | |
| 71 // ServerWindowSurface goes away. | |
| 72 cc::SurfaceSequence CreateSurfaceSequence(); | |
| 73 | |
| 74 ServerWindow* window(); | 69 ServerWindow* window(); |
| 75 | 70 |
| 76 private: | 71 private: |
| 77 | 72 |
| 78 // SurfaceFactoryClient implementation. | 73 // SurfaceFactoryClient implementation. |
| 79 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 74 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 80 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 75 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 81 | 76 |
| 82 const cc::FrameSinkId frame_sink_id_; | 77 const cc::FrameSinkId frame_sink_id_; |
| 83 cc::SurfaceSequenceGenerator surface_sequence_generator_; | |
| 84 | 78 |
| 85 ServerWindowSurfaceManager* manager_; // Owns this. | 79 ServerWindowSurfaceManager* manager_; // Owns this. |
| 86 | 80 |
| 87 gfx::Size last_submitted_frame_size_; | 81 gfx::Size last_submitted_frame_size_; |
| 88 | 82 |
| 89 cc::LocalFrameId local_frame_id_; | 83 cc::LocalFrameId local_frame_id_; |
| 90 cc::SurfaceIdAllocator surface_id_allocator_; | 84 cc::SurfaceIdAllocator surface_id_allocator_; |
| 91 cc::SurfaceFactory surface_factory_; | 85 cc::SurfaceFactory surface_factory_; |
| 92 | 86 |
| 93 mojom::SurfaceClientPtr client_; | 87 mojom::SurfaceClientPtr client_; |
| 94 mojo::Binding<Surface> binding_; | 88 mojo::Binding<Surface> binding_; |
| 95 | 89 |
| 96 bool may_contain_video_ = false; | 90 bool may_contain_video_ = false; |
| 97 | 91 |
| 98 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); | 92 DISALLOW_COPY_AND_ASSIGN(ServerWindowSurface); |
| 99 }; | 93 }; |
| 100 | 94 |
| 101 } // namespace ws | 95 } // namespace ws |
| 102 | 96 |
| 103 } // namespace ui | 97 } // namespace ui |
| 104 | 98 |
| 105 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ | 99 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_H_ |
| OLD | NEW |