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