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

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

Issue 7518016: Revert 94743 - Allow the renderer process to map textures from one context into another. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.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/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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 gpu::error::ContextLostReason reason) { 342 gpu::error::ContextLostReason reason) {
343 // Not implemented in proxy. 343 // Not implemented in proxy.
344 NOTREACHED(); 344 NOTREACHED();
345 } 345 }
346 346
347 void CommandBufferProxy::OnSwapBuffers() { 347 void CommandBufferProxy::OnSwapBuffers() {
348 if (swap_buffers_callback_.get()) 348 if (swap_buffers_callback_.get())
349 swap_buffers_callback_->Run(); 349 swap_buffers_callback_->Run();
350 } 350 }
351 351
352 bool CommandBufferProxy::MapExternalResource(
353 gpu::resource_type::ResourceType resource_type,
354 uint32 resource_source_id,
355 CommandBufferProxy* source_command_buffer,
356 uint32 resource_dest_id) {
357 if (last_state_.error != gpu::error::kNoError)
358 return false;
359
360 if (!Send(new GpuCommandBufferMsg_MapExternalResource(
361 route_id_,
362 resource_type,
363 resource_source_id,
364 source_command_buffer ?
365 source_command_buffer->route_id() : MSG_ROUTING_NONE,
366 resource_dest_id))) {
367 return false;
368 }
369
370 return true;
371 }
372
373 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer, 352 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer,
374 uint32 parent_texture_id) { 353 uint32 parent_texture_id) {
375 if (last_state_.error != gpu::error::kNoError) 354 if (last_state_.error != gpu::error::kNoError)
376 return false; 355 return false;
377 356
378 bool result; 357 bool result;
379 if (parent_command_buffer) { 358 if (parent_command_buffer) {
380 if (!Send(new GpuCommandBufferMsg_SetParent( 359 if (!Send(new GpuCommandBufferMsg_SetParent(
381 route_id_, 360 route_id_,
382 parent_command_buffer->route_id_, 361 parent_command_buffer->route_id_,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 delete msg; 436 delete msg;
458 return false; 437 return false;
459 } 438 }
460 439
461 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { 440 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) {
462 // Handle wraparound. It works as long as we don't have more than 2B state 441 // Handle wraparound. It works as long as we don't have more than 2B state
463 // updates in flight across which reordering occurs. 442 // updates in flight across which reordering occurs.
464 if (state.generation - last_state_.generation < 0x80000000U) 443 if (state.generation - last_state_.generation < 0x80000000U)
465 last_state_ = state; 444 last_state_ = state;
466 } 445 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698