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 #include "gpu/ipc/service/child_window_surface_win.h" | 5 #include "gpu/ipc/service/child_window_surface_win.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "gpu/ipc/common/gpu_messages.h" | 11 #include "gpu/ipc/common/gpu_messages.h" |
12 #include "gpu/ipc/service/gpu_channel_manager.h" | 12 #include "gpu/ipc/service/gpu_channel_manager.h" |
13 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" | 13 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" |
14 #include "ui/display/display_switches.h" | 14 #include "ui/display/display_switches.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 #include "ui/gl/egl_util.h" | 16 #include "ui/gl/egl_util.h" |
17 #include "ui/gl/gl_context.h" | 17 #include "ui/gl/gl_context.h" |
18 #include "ui/gl/gl_surface_egl.h" | 18 #include "ui/gl/gl_surface_egl.h" |
19 #include "ui/gl/scoped_make_current.h" | 19 #include "ui/gl/scoped_make_current.h" |
20 | 20 |
21 namespace gpu { | 21 namespace gpu { |
22 | 22 |
23 ChildWindowSurfaceWin::ChildWindowSurfaceWin( | 23 ChildWindowSurfaceWin::ChildWindowSurfaceWin( |
| 24 std::unique_ptr<gfx::VSyncProvider> vsync_provider, |
24 base::WeakPtr<ImageTransportSurfaceDelegate> delegate, | 25 base::WeakPtr<ImageTransportSurfaceDelegate> delegate, |
25 HWND parent_window) | 26 HWND parent_window) |
26 : gl::NativeViewGLSurfaceEGL(0), | 27 : gl::NativeViewGLSurfaceEGL(0, std::move(vsync_provider)), |
27 child_window_(delegate, parent_window), | 28 child_window_(delegate, parent_window), |
28 alpha_(true), | 29 alpha_(true), |
29 first_swap_(true) { | 30 first_swap_(true) { |
30 // Don't use EGL_ANGLE_window_fixed_size so that we can avoid recreating the | 31 // Don't use EGL_ANGLE_window_fixed_size so that we can avoid recreating the |
31 // window surface, which can cause flicker on DirectComposition. | 32 // window surface, which can cause flicker on DirectComposition. |
32 enable_fixed_size_angle_ = false; | 33 enable_fixed_size_angle_ = false; |
33 } | 34 } |
34 | 35 |
35 EGLConfig ChildWindowSurfaceWin::GetConfig() { | 36 EGLConfig ChildWindowSurfaceWin::GetConfig() { |
36 if (!config_) { | 37 if (!config_) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 gfx::SwapResult result = | 144 gfx::SwapResult result = |
144 NativeViewGLSurfaceEGL::PostSubBuffer(x, y, width, height); | 145 NativeViewGLSurfaceEGL::PostSubBuffer(x, y, width, height); |
145 child_window_.ClearInvalidContents(); | 146 child_window_.ClearInvalidContents(); |
146 return result; | 147 return result; |
147 } | 148 } |
148 | 149 |
149 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() { | 150 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() { |
150 } | 151 } |
151 | 152 |
152 } // namespace gpu | 153 } // namespace gpu |
OLD | NEW |