OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 #include <memory> |
| 6 |
| 7 #include "base/macros.h" |
| 8 |
| 9 namespace ui { |
| 10 class Layer; |
| 11 } |
| 12 |
| 13 namespace aura { |
| 14 |
| 15 struct SurfaceInfo; |
| 16 class Window; |
| 17 |
| 18 // Used by WindowPortMus when it is embedding a client. Responsible for setting |
| 19 // up layers containing content from the client, parenting them to the window's |
| 20 // layer, and updating them when the client submits new surfaces. |
| 21 class ClientSurfaceEmbedder { |
| 22 public: |
| 23 explicit ClientSurfaceEmbedder(Window* window); |
| 24 ~ClientSurfaceEmbedder(); |
| 25 |
| 26 // Updates the surface layer and the clip layer based on the surface info. |
| 27 void UpdateSurface(const SurfaceInfo& surface_info); |
| 28 |
| 29 private: |
| 30 // The window which embeds the client. |
| 31 Window* window_; |
| 32 |
| 33 // Contains the client's content. |
| 34 std::unique_ptr<ui::Layer> surface_layer_; |
| 35 |
| 36 // Used for clipping the surface layer to the window bounds. |
| 37 std::unique_ptr<ui::Layer> clip_layer_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ClientSurfaceEmbedder); |
| 40 }; |
| 41 |
| 42 } // namespace aura |
OLD | NEW |