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 "content/common/gpu/child_window_surface_win.h" | 5 #include "content/common/gpu/child_window_surface_win.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/win/scoped_hdc.h" | 8 #include "base/win/scoped_hdc.h" |
9 #include "base/win/wrapped_window_proc.h" | 9 #include "base/win/wrapped_window_proc.h" |
10 #include "content/common/gpu/gpu_channel_manager.h" | 10 #include "content/common/gpu/gpu_channel_manager.h" |
11 #include "content/common/gpu/gpu_channel_manager_delegate.h" | |
12 #include "content/common/gpu/gpu_messages.h" | 11 #include "content/common/gpu/gpu_messages.h" |
13 #include "ui/base/win/hidden_window.h" | 12 #include "ui/base/win/hidden_window.h" |
14 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
15 #include "ui/gfx/win/hwnd_util.h" | 14 #include "ui/gfx/win/hwnd_util.h" |
16 #include "ui/gl/egl_util.h" | 15 #include "ui/gl/egl_util.h" |
17 #include "ui/gl/gl_context.h" | 16 #include "ui/gl/gl_context.h" |
18 #include "ui/gl/gl_surface_egl.h" | 17 #include "ui/gl/gl_surface_egl.h" |
19 #include "ui/gl/scoped_make_current.h" | 18 #include "ui/gl/scoped_make_current.h" |
20 | 19 |
21 namespace content { | 20 namespace content { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 118 |
120 RECT windowRect; | 119 RECT windowRect; |
121 GetClientRect(parent_window_, &windowRect); | 120 GetClientRect(parent_window_, &windowRect); |
122 | 121 |
123 window_ = CreateWindowEx( | 122 window_ = CreateWindowEx( |
124 WS_EX_NOPARENTNOTIFY, reinterpret_cast<wchar_t*>(g_window_class), L"", | 123 WS_EX_NOPARENTNOTIFY, reinterpret_cast<wchar_t*>(g_window_class), L"", |
125 WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, | 124 WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, |
126 windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, | 125 windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, |
127 ui::GetHiddenWindow(), NULL, NULL, NULL); | 126 ui::GetHiddenWindow(), NULL, NULL, NULL); |
128 gfx::SetWindowUserData(window_, this); | 127 gfx::SetWindowUserData(window_, this); |
129 manager_->delegate()->SendAcceleratedSurfaceCreatedChildWindow(parent_window_, | 128 manager_->Send(new GpuHostMsg_AcceleratedSurfaceCreatedChildWindow( |
130 window_); | 129 parent_window_, window_)); |
131 return true; | 130 return true; |
132 } | 131 } |
133 | 132 |
134 bool ChildWindowSurfaceWin::Resize(const gfx::Size& size, | 133 bool ChildWindowSurfaceWin::Resize(const gfx::Size& size, |
135 float scale_factor, | 134 float scale_factor, |
136 bool has_alpha) { | 135 bool has_alpha) { |
137 if (!SupportsPostSubBuffer()) { | 136 if (!SupportsPostSubBuffer()) { |
138 if (!MoveWindow(window_, 0, 0, size.width(), size.height(), FALSE)) { | 137 if (!MoveWindow(window_, 0, 0, size.width(), size.height(), FALSE)) { |
139 return false; | 138 return false; |
140 } | 139 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 rect_to_clear_ = gfx::Rect(); | 210 rect_to_clear_ = gfx::Rect(); |
212 } | 211 } |
213 } | 212 } |
214 | 213 |
215 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() { | 214 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() { |
216 gfx::SetWindowUserData(window_, nullptr); | 215 gfx::SetWindowUserData(window_, nullptr); |
217 DestroyWindow(window_); | 216 DestroyWindow(window_); |
218 } | 217 } |
219 | 218 |
220 } // namespace content | 219 } // namespace content |
OLD | NEW |