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

Side by Side Diff: content/renderer/gpu/command_buffer_proxy.cc

Issue 7634019: Allow cmdbuffer creation from compositor thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/gpu/command_buffer_proxy.h" 5 #include "content/renderer/gpu/command_buffer_proxy.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 22 matching lines...) Expand all
33 // in this process. 33 // in this process.
34 for (TransferBufferMap::iterator it = transfer_buffers_.begin(); 34 for (TransferBufferMap::iterator it = transfer_buffers_.begin();
35 it != transfer_buffers_.end(); 35 it != transfer_buffers_.end();
36 ++it) { 36 ++it) {
37 delete it->second.shared_memory; 37 delete it->second.shared_memory;
38 it->second.shared_memory = NULL; 38 it->second.shared_memory = NULL;
39 } 39 }
40 } 40 }
41 41
42 bool CommandBufferProxy::OnMessageReceived(const IPC::Message& message) { 42 bool CommandBufferProxy::OnMessageReceived(const IPC::Message& message) {
43 if (IsOrphaned())
nduca 2011/08/15 22:28:36 How about doing this in the MessageFilter side bef
44 return false;
45
43 bool handled = true; 46 bool handled = true;
44 IPC_BEGIN_MESSAGE_MAP(CommandBufferProxy, message) 47 IPC_BEGIN_MESSAGE_MAP(CommandBufferProxy, message)
45 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_UpdateState, OnUpdateState); 48 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_UpdateState, OnUpdateState);
46 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed); 49 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Destroyed, OnDestroyed);
47 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffers, OnSwapBuffers); 50 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffers, OnSwapBuffers);
48 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_NotifyRepaint, 51 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_NotifyRepaint,
49 OnNotifyRepaint); 52 OnNotifyRepaint);
50 IPC_MESSAGE_UNHANDLED(handled = false) 53 IPC_MESSAGE_UNHANDLED(handled = false)
51 IPC_END_MESSAGE_MAP() 54 IPC_END_MESSAGE_MAP()
52 55
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 delete msg; 439 delete msg;
437 return false; 440 return false;
438 } 441 }
439 442
440 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { 443 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) {
441 // Handle wraparound. It works as long as we don't have more than 2B state 444 // Handle wraparound. It works as long as we don't have more than 2B state
442 // updates in flight across which reordering occurs. 445 // updates in flight across which reordering occurs.
443 if (state.generation - last_state_.generation < 0x80000000U) 446 if (state.generation - last_state_.generation < 0x80000000U)
444 last_state_ = state; 447 last_state_ = state;
445 } 448 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698