OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_CHILD_WINDOW_SURFACE_WIN_H_ |
| 6 #define CONTENT_COMMON_GPU_CHILD_WINDOW_SURFACE_WIN_H_ |
| 7 |
| 8 #include "ui/gl/gl_surface_egl.h" |
| 9 |
| 10 #include <windows.h> |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class GpuChannelManager; |
| 15 |
| 16 class ChildWindowSurfaceWin : public gfx::NativeViewGLSurfaceEGL { |
| 17 public: |
| 18 ChildWindowSurfaceWin(GpuChannelManager* manager, HWND parent_window); |
| 19 |
| 20 // GLSurface implementation. |
| 21 EGLConfig GetConfig() override; |
| 22 bool Resize(const gfx::Size& size, |
| 23 float scale_factor, |
| 24 bool has_alpha) override; |
| 25 bool InitializeNativeWindow() override; |
| 26 gfx::SwapResult SwapBuffers() override; |
| 27 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 28 |
| 29 void InvalidateWindowRect(const gfx::Rect& rect); |
| 30 |
| 31 protected: |
| 32 ~ChildWindowSurfaceWin() override; |
| 33 |
| 34 private: |
| 35 void ClearInvalidContents(); |
| 36 |
| 37 HWND parent_window_; |
| 38 GpuChannelManager* manager_; |
| 39 gfx::Rect rect_to_clear_; |
| 40 bool alpha_; |
| 41 bool first_swap_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(ChildWindowSurfaceWin); |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_COMMON_GPU_CHILD_WINDOW_SURFACE_WIN_H_ |
OLD | NEW |