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

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

Issue 7395020: Create new GLSurface for cross process image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years, 5 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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (stub == NULL) 175 if (stub == NULL)
176 return; 176 return;
177 177
178 stub->ViewResized(); 178 stub->ViewResized();
179 } 179 }
180 180
181 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { 181 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) {
182 return stubs_.Lookup(route_id); 182 return stubs_.Lookup(route_id);
183 } 183 }
184 184
185 #if defined(TOUCH_UI) 185 #if defined(OS_MACOSX)
186 void GpuChannel::AcceleratedSurfaceIOSurfaceSet(
187 int32 route_id, uint64 surface_id) {
188 GpuCommandBufferStub* stub = stubs_.Lookup(route_id);
189 if (stub == NULL)
190 return;
191 stub->AcceleratedSurfaceIOSurfaceSet(surface_id);
192 }
193
194 void GpuChannel::AcceleratedSurfaceReleased(
195 int32 route_id, uint64 surface_id) {
196 GpuCommandBufferStub* stub = stubs_.Lookup(route_id);
197 if (stub == NULL)
198 return;
199 stub->AcceleratedSurfaceReleased(surface_id);
200 }
201 #endif
202
203 #if defined(OS_MACOSX) || defined(TOUCH_UI)
204 void GpuChannel::AcceleratedSurfaceBuffersSwapped( 186 void GpuChannel::AcceleratedSurfaceBuffersSwapped(
205 int32 route_id, uint64 swap_buffers_count) { 187 int32 route_id, uint64 swap_buffers_count) {
206 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); 188 GpuCommandBufferStub* stub = stubs_.Lookup(route_id);
207 if (stub == NULL) 189 if (stub == NULL)
208 return; 190 return;
209 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count); 191 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count);
210 } 192 }
211 #endif
212 193
213 #if defined(OS_MACOSX)
214 void GpuChannel::DestroyCommandBufferByViewId(int32 render_view_id) { 194 void GpuChannel::DestroyCommandBufferByViewId(int32 render_view_id) {
215 // This responds to a message from the browser process to destroy the command 195 // This responds to a message from the browser process to destroy the command
216 // buffer when the window with a GpuScheduler is closed (see 196 // buffer when the window with a GpuScheduler is closed (see
217 // RenderWidgetHostViewMac::DeallocFakePluginWindowHandle). Find the route id 197 // RenderWidgetHostViewMac::DeallocFakePluginWindowHandle). Find the route id
218 // that matches the given render_view_id and delete the route. 198 // that matches the given render_view_id and delete the route.
219 for (StubMap::const_iterator iter(&stubs_); !iter.IsAtEnd(); iter.Advance()) { 199 for (StubMap::const_iterator iter(&stubs_); !iter.IsAtEnd(); iter.Advance()) {
220 if (iter.GetCurrentValue()->render_view_id() == render_view_id) { 200 if (iter.GetCurrentValue()->render_view_id() == render_view_id) {
221 OnDestroyCommandBuffer(iter.GetCurrentKey()); 201 OnDestroyCommandBuffer(iter.GetCurrentKey());
222 return; 202 return;
223 } 203 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 353
374 #if defined(OS_POSIX) 354 #if defined(OS_POSIX)
375 int GpuChannel::GetRendererFileDescriptor() { 355 int GpuChannel::GetRendererFileDescriptor() {
376 int fd = -1; 356 int fd = -1;
377 if (channel_.get()) { 357 if (channel_.get()) {
378 fd = channel_->GetClientFileDescriptor(); 358 fd = channel_->GetClientFileDescriptor();
379 } 359 }
380 return fd; 360 return fd;
381 } 361 }
382 #endif // defined(OS_POSIX) 362 #endif // defined(OS_POSIX)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698