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

Side by Side Diff: chrome/gpu/gpu_command_buffer_stub.cc

Issue 5275009: Defer window destruction until GPU finished drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with reference counting. Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/gpu_messages_internal.h ('k') | gfx/gtk_native_view_id_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/child_thread.h" 10 #include "chrome/common/child_thread.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 GpuCommandBufferStub::~GpuCommandBufferStub() { 153 GpuCommandBufferStub::~GpuCommandBufferStub() {
154 if (processor_.get()) { 154 if (processor_.get()) {
155 processor_->Destroy(); 155 processor_->Destroy();
156 } 156 }
157 #if defined(OS_WIN) 157 #if defined(OS_WIN)
158 if (compositor_window_) { 158 if (compositor_window_) {
159 DestroyWindow(static_cast<HWND>(compositor_window_)); 159 DestroyWindow(static_cast<HWND>(compositor_window_));
160 compositor_window_ = NULL; 160 compositor_window_ = NULL;
161 } 161 }
162 #elif defined(OS_LINUX)
163 ChildThread* gpu_thread = ChildThread::current();
164 gpu_thread->Send(
165 new GpuHostMsg_ReleaseXID(handle_));
162 #endif 166 #endif
163 } 167 }
164 168
165 void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { 169 void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
166 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message) 170 IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
167 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Initialize, OnInitialize); 171 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Initialize, OnInitialize);
168 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_GetState, OnGetState); 172 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_GetState, OnGetState);
169 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncGetState, OnAsyncGetState); 173 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncGetState, OnAsyncGetState);
170 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Flush, OnFlush); 174 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Flush, OnFlush);
171 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush); 175 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 new GpuHostMsg_ResizeXID(handle_, size, &result)); 375 new GpuHostMsg_ResizeXID(handle_, size, &result));
372 #elif defined(OS_WIN) 376 #elif defined(OS_WIN)
373 HWND hwnd = static_cast<HWND>(compositor_window_); 377 HWND hwnd = static_cast<HWND>(compositor_window_);
374 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | 378 UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
375 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; 379 SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
376 SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags); 380 SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags);
377 #endif 381 #endif
378 } 382 }
379 383
380 #endif // ENABLE_GPU 384 #endif // ENABLE_GPU
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages_internal.h ('k') | gfx/gtk_native_view_id_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698