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 #ifndef GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ |
| 6 #define GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "gpu/ipc/service/image_transport_surface_delegate.h" |
| 10 |
| 11 #include <windows.h> |
| 12 |
| 13 namespace gpu { |
| 14 |
| 15 struct SharedData; |
| 16 |
| 17 // The window DirectComposition renders into needs to be owned by the process |
| 18 // that's currently doing the rendering. The class creates and owns a window |
| 19 // which is reparented by the browser to be a child of its window. |
| 20 class ChildWindowWin { |
| 21 public: |
| 22 ChildWindowWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate, |
| 23 HWND parent_window); |
| 24 ~ChildWindowWin(); |
| 25 |
| 26 bool Initialize(); |
| 27 void ClearInvalidContents(); |
| 28 HWND window() const { return window_; } |
| 29 |
| 30 private: |
| 31 // This member contains all the data that can be accessed from the main or |
| 32 // window owner threads. |
| 33 std::unique_ptr<SharedData> shared_data_; |
| 34 // The eventual parent of the window living in the browser process. |
| 35 HWND parent_window_; |
| 36 HWND window_; |
| 37 // The window is initially created with this parent window. We need to keep it |
| 38 // around so that we can destroy it at the end. |
| 39 HWND initial_parent_window_; |
| 40 base::WeakPtr<ImageTransportSurfaceDelegate> delegate_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(ChildWindowWin); |
| 43 }; |
| 44 |
| 45 } // namespace gpu |
| 46 |
| 47 #endif // GPU_IPC_SERVICE_CHILD_WINDOW_WIN_H_ |
OLD | NEW |