Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: content/common/gpu/child_window_surface_win.cc

Issue 1711533002: Decouple browser-specific GPU IPC messages from GPU service IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored if guards on GpuChannelManager Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "content/common/gpu/gpu_messages.h" 12 #include "content/common/gpu/gpu_messages.h"
12 #include "ui/base/win/hidden_window.h" 13 #include "ui/base/win/hidden_window.h"
13 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/win/hwnd_util.h" 15 #include "ui/gfx/win/hwnd_util.h"
15 #include "ui/gl/egl_util.h" 16 #include "ui/gl/egl_util.h"
16 #include "ui/gl/gl_context.h" 17 #include "ui/gl/gl_context.h"
17 #include "ui/gl/gl_surface_egl.h" 18 #include "ui/gl/gl_surface_egl.h"
18 #include "ui/gl/scoped_make_current.h" 19 #include "ui/gl/scoped_make_current.h"
19 20
20 namespace content { 21 namespace content {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 119
119 RECT windowRect; 120 RECT windowRect;
120 GetClientRect(parent_window_, &windowRect); 121 GetClientRect(parent_window_, &windowRect);
121 122
122 window_ = CreateWindowEx( 123 window_ = CreateWindowEx(
123 WS_EX_NOPARENTNOTIFY, reinterpret_cast<wchar_t*>(g_window_class), L"", 124 WS_EX_NOPARENTNOTIFY, reinterpret_cast<wchar_t*>(g_window_class), L"",
124 WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, 125 WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0,
125 windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, 126 windowRect.right - windowRect.left, windowRect.bottom - windowRect.top,
126 ui::GetHiddenWindow(), NULL, NULL, NULL); 127 ui::GetHiddenWindow(), NULL, NULL, NULL);
127 gfx::SetWindowUserData(window_, this); 128 gfx::SetWindowUserData(window_, this);
128 manager_->Send(new GpuHostMsg_AcceleratedSurfaceCreatedChildWindow( 129 manager_->delegate()->SendAcceleratedSurfaceCreatedChildWindow(parent_window_,
129 parent_window_, window_)); 130 window_);
130 return true; 131 return true;
131 } 132 }
132 133
133 bool ChildWindowSurfaceWin::Resize(const gfx::Size& size, 134 bool ChildWindowSurfaceWin::Resize(const gfx::Size& size,
134 float scale_factor, 135 float scale_factor,
135 bool has_alpha) { 136 bool has_alpha) {
136 if (!SupportsPostSubBuffer()) { 137 if (!SupportsPostSubBuffer()) {
137 if (!MoveWindow(window_, 0, 0, size.width(), size.height(), FALSE)) { 138 if (!MoveWindow(window_, 0, 0, size.width(), size.height(), FALSE)) {
138 return false; 139 return false;
139 } 140 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 rect_to_clear_ = gfx::Rect(); 211 rect_to_clear_ = gfx::Rect();
211 } 212 }
212 } 213 }
213 214
214 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() { 215 ChildWindowSurfaceWin::~ChildWindowSurfaceWin() {
215 gfx::SetWindowUserData(window_, nullptr); 216 gfx::SetWindowUserData(window_, nullptr);
216 DestroyWindow(window_); 217 DestroyWindow(window_);
217 } 218 }
218 219
219 } // namespace content 220 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/buffer_presented_params_mac.cc ('k') | content/common/gpu/establish_channel_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698