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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index b26757559392e78ff52656e50b5aafcf1d7b53f1..43cab101a433348b4897496acaa9b12e047e25e6 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -542,11 +542,14 @@ void GpuCommandBufferStub::OnInitialize(
base::Unretained(this)));
}
- if (!command_buffer_->SetSharedStateBuffer(shared_state_shm.Pass())) {
- DLOG(ERROR) << "Failed to map shared stae buffer.";
+ const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState);
+ if (!shared_state_shm->Map(kSharedStateSize)) {
+ DLOG(ERROR) << "Failed to map shared state buffer.";
OnInitializeFailed(reply_message);
return;
}
+ command_buffer_->SetSharedStateBuffer(gpu::MakeBackingFromSharedMemory(
+ shared_state_shm.Pass(), kSharedStateSize));
GpuCommandBufferMsg_Initialize::WriteReplyParams(
reply_message, true, gpu_control_->GetCapabilities());
@@ -694,8 +697,10 @@ void GpuCommandBufferStub::OnRegisterTransferBuffer(
return;
}
- if (command_buffer_)
- command_buffer_->RegisterTransferBuffer(id, shared_memory.Pass(), size);
+ if (command_buffer_) {
+ command_buffer_->RegisterTransferBuffer(
+ id, gpu::MakeBackingFromSharedMemory(shared_memory.Pass(), size));
+ }
}
void GpuCommandBufferStub::OnDestroyTransferBuffer(int32 id) {
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | gpu/command_buffer/client/client_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698