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

Unified Diff: mojo/services/gles2/command_buffer_impl.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
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/gles2/command_buffer_impl.cc
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc
index 1e8a4f6e1d1132efeff343cbdd5fcb5aa32b7078..7d33b722cd8ddb24fc0fab5e4a392fa0b4698643 100644
--- a/mojo/services/gles2/command_buffer_impl.cc
+++ b/mojo/services/gles2/command_buffer_impl.cc
@@ -118,11 +118,14 @@ bool CommandBufferImpl::DoInitialize(const ShmHandle& shared_state) {
// TODO(piman): other callbacks
+ const size_t kSize = sizeof(gpu::CommandBufferSharedState);
scoped_ptr<base::SharedMemory> shared_state_shm(
new base::SharedMemory(shared_state, false));
- if (!command_buffer_->SetSharedStateBuffer(shared_state_shm.Pass()))
+ if (!shared_state_shm->Map(kSize))
return false;
+ command_buffer_->SetSharedStateBuffer(
+ gpu::MakeBackingFromSharedMemory(shared_state_shm.Pass(), kSize));
return true;
}
@@ -152,7 +155,8 @@ void CommandBufferImpl::RegisterTransferBuffer(int32_t id,
return;
}
- command_buffer_->RegisterTransferBuffer(id, shared_memory.Pass(), size);
+ command_buffer_->RegisterTransferBuffer(
+ id, gpu::MakeBackingFromSharedMemory(shared_memory.Pass(), size));
}
void CommandBufferImpl::DestroyTransferBuffer(int32_t id) {
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.cc ('k') | ppapi/proxy/ppapi_command_buffer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698