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

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

Issue 6880218: Removed "compositor" child window that was created by the GPU process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.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) 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/common/gpu/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/win/scoped_com_initializer.h" 10 #include "app/win/scoped_com_initializer.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { 42 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
43 bool msg_is_ok = true; 43 bool msg_is_ok = true;
44 bool handled = true; 44 bool handled = true;
45 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok) 45 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok)
46 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) 46 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel)
47 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) 47 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel)
48 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, 48 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer,
49 OnCreateViewCommandBuffer) 49 OnCreateViewCommandBuffer)
50 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize, OnSynchronize) 50 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize, OnSynchronize)
51 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged) 51 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged)
52 #if defined(OS_MACOSX) 52 #if defined(OS_LINUX) && !defined(TOUCH_UI) || defined(OS_WIN)
53 IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK);
54 #elif defined(OS_MACOSX)
53 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, 55 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK,
54 OnAcceleratedSurfaceBuffersSwappedACK) 56 OnAcceleratedSurfaceBuffersSwappedACK)
55 IPC_MESSAGE_HANDLER(GpuMsg_DestroyCommandBuffer, 57 IPC_MESSAGE_HANDLER(GpuMsg_DestroyCommandBuffer,
56 OnDestroyCommandBuffer) 58 OnDestroyCommandBuffer)
57 #endif 59 #endif
58 IPC_MESSAGE_UNHANDLED(handled = false) 60 IPC_MESSAGE_UNHANDLED(handled = false)
59 IPC_END_MESSAGE_MAP_EX() 61 IPC_END_MESSAGE_MAP_EX()
60 return handled; 62 return handled;
61 } 63 }
62 64
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 126
125 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 127 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
126 if (iter != gpu_channels_.end()) { 128 if (iter != gpu_channels_.end()) {
127 iter->second->CreateViewCommandBuffer( 129 iter->second->CreateViewCommandBuffer(
128 window, render_view_id, init_params, &route_id); 130 window, render_view_id, init_params, &route_id);
129 } 131 }
130 132
131 Send(new GpuHostMsg_CommandBufferCreated(route_id)); 133 Send(new GpuHostMsg_CommandBufferCreated(route_id));
132 } 134 }
133 135
136 void GpuChannelManager::OnResizeViewACK(int32 renderer_id,
137 int32 command_buffer_route_id) {
138 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
139 if (iter == gpu_channels_.end())
140 return;
141 scoped_refptr<GpuChannel> channel = iter->second;
142
143 channel->ViewResized(command_buffer_route_id);
144 }
145
134 #if defined(OS_MACOSX) 146 #if defined(OS_MACOSX)
135 void GpuChannelManager::OnAcceleratedSurfaceBuffersSwappedACK( 147 void GpuChannelManager::OnAcceleratedSurfaceBuffersSwappedACK(
136 int renderer_id, int32 route_id, uint64 swap_buffers_count) { 148 int renderer_id, int32 route_id, uint64 swap_buffers_count) {
137 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 149 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
138 if (iter == gpu_channels_.end()) 150 if (iter == gpu_channels_.end())
139 return; 151 return;
140 scoped_refptr<GpuChannel> channel = iter->second; 152 scoped_refptr<GpuChannel> channel = iter->second;
141 channel->AcceleratedSurfaceBuffersSwapped(route_id, swap_buffers_count); 153 channel->AcceleratedSurfaceBuffersSwapped(route_id, swap_buffers_count);
142 } 154 }
155
143 void GpuChannelManager::OnDestroyCommandBuffer( 156 void GpuChannelManager::OnDestroyCommandBuffer(
144 int renderer_id, int32 renderer_view_id) { 157 int renderer_id, int32 renderer_view_id) {
145 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 158 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
146 if (iter == gpu_channels_.end()) 159 if (iter == gpu_channels_.end())
147 return; 160 return;
148 scoped_refptr<GpuChannel> channel = iter->second; 161 scoped_refptr<GpuChannel> channel = iter->second;
149 channel->DestroyCommandBufferByViewId(renderer_view_id); 162 channel->DestroyCommandBufferByViewId(renderer_view_id);
150 } 163 }
151 #endif 164 #endif
152 165
153 void GpuChannelManager::LoseAllContexts() { 166 void GpuChannelManager::LoseAllContexts() {
154 MessageLoop::current()->PostTask( 167 MessageLoop::current()->PostTask(
155 FROM_HERE, method_factory_.NewRunnableMethod( 168 FROM_HERE, method_factory_.NewRunnableMethod(
156 &GpuChannelManager::OnLoseAllContexts)); 169 &GpuChannelManager::OnLoseAllContexts));
157 } 170 }
158 171
159 void GpuChannelManager::OnLoseAllContexts() { 172 void GpuChannelManager::OnLoseAllContexts() {
160 gpu_channels_.clear(); 173 gpu_channels_.clear();
161 } 174 }
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698