| 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 GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ | 5 #ifndef GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ |
| 6 #define GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ | 6 #define GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/gl/gl_surface_egl.h" | 8 #include "ui/gl/gl_surface_egl.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 | 11 |
| 12 namespace gpu { | 12 namespace gpu { |
| 13 | 13 |
| 14 class GpuChannelManager; | 14 class GpuChannelManager; |
| 15 struct SharedData; | |
| 16 | 15 |
| 17 class ChildWindowSurfaceWin : public gl::NativeViewGLSurfaceEGL { | 16 class ChildWindowSurfaceWin : public gl::NativeViewGLSurfaceEGL { |
| 18 public: | 17 public: |
| 19 ChildWindowSurfaceWin(GpuChannelManager* manager, HWND parent_window); | 18 ChildWindowSurfaceWin(GpuChannelManager* manager, HWND parent_window); |
| 20 | 19 |
| 21 // GLSurface implementation. | 20 // GLSurface implementation. |
| 22 EGLConfig GetConfig() override; | 21 EGLConfig GetConfig() override; |
| 23 bool Resize(const gfx::Size& size, | 22 bool Resize(const gfx::Size& size, |
| 24 float scale_factor, | 23 float scale_factor, |
| 25 bool has_alpha) override; | 24 bool has_alpha) override; |
| 26 bool InitializeNativeWindow() override; | 25 bool InitializeNativeWindow() override; |
| 27 gfx::SwapResult SwapBuffers() override; | 26 gfx::SwapResult SwapBuffers() override; |
| 28 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 27 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 29 | 28 |
| 29 void InvalidateWindowRect(const gfx::Rect& rect); |
| 30 |
| 30 protected: | 31 protected: |
| 31 ~ChildWindowSurfaceWin() override; | 32 ~ChildWindowSurfaceWin() override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 void ClearInvalidContents(); | 35 void ClearInvalidContents(); |
| 35 | 36 |
| 36 // This member contains all the data that can be accessed from the main or | |
| 37 // window owner threads. | |
| 38 std::unique_ptr<SharedData> shared_data_; | |
| 39 HWND parent_window_; | 37 HWND parent_window_; |
| 40 GpuChannelManager* manager_; | 38 GpuChannelManager* manager_; |
| 39 gfx::Rect rect_to_clear_; |
| 41 bool alpha_; | 40 bool alpha_; |
| 42 bool first_swap_; | 41 bool first_swap_; |
| 43 | 42 |
| 44 DISALLOW_COPY_AND_ASSIGN(ChildWindowSurfaceWin); | 43 DISALLOW_COPY_AND_ASSIGN(ChildWindowSurfaceWin); |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 } // namespace gpu | 46 } // namespace gpu |
| 48 | 47 |
| 49 #endif // GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ | 48 #endif // GPU_IPC_SERVICE_CHILD_WINDOW_SURFACE_WIN_H_ |
| OLD | NEW |