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

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 215803002: Remove CommandBuffer::GetTransferBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix NaClMessageScannerTest 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/renderer/pepper/ppb_graphics_3d_impl.cc
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 18a8e90e0b63d61478acecaa2cfed2d7056d0f6a..954129be6e73d04ad92ab0dbad3b847ac6ad0572 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -113,9 +113,18 @@ gpu::CommandBuffer::State PPB_Graphics3D_Impl::GetState() {
return GetCommandBuffer()->GetState();
}
-int32_t PPB_Graphics3D_Impl::CreateTransferBuffer(uint32_t size) {
+int32_t PPB_Graphics3D_Impl::CreateTransferBuffer(uint32_t size,
+ int* shm_handle,
+ uint32_t* shm_size) {
int32_t id = -1;
- GetCommandBuffer()->CreateTransferBuffer(size, &id);
+ scoped_refptr<gpu::Buffer> buffer =
+ GetCommandBuffer()->CreateTransferBuffer(size, &id);
+ if (id < 0)
no sievers 2014/03/28 21:01:03 Why not 'if (!buffer) return id'?
piman 2014/03/28 23:23:40 Either way, doesn't matter. Either buffer is set a
+ return id;
+ DCHECK(buffer);
+ PP_Bool result = ShmToHandle(
+ buffer->shared_memory(), buffer->size(), shm_handle, shm_size);
+ DCHECK(result);
return id;
}
@@ -124,14 +133,6 @@ PP_Bool PPB_Graphics3D_Impl::DestroyTransferBuffer(int32_t id) {
return PP_TRUE;
}
-PP_Bool PPB_Graphics3D_Impl::GetTransferBuffer(int32_t id,
- int* shm_handle,
- uint32_t* shm_size) {
- scoped_refptr<gpu::Buffer> buffer = GetCommandBuffer()->GetTransferBuffer(id);
- return ShmToHandle(
- buffer->shared_memory(), buffer->size(), shm_handle, shm_size);
-}
-
PP_Bool PPB_Graphics3D_Impl::Flush(int32_t put_offset) {
GetCommandBuffer()->Flush(put_offset);
return PP_TRUE;

Powered by Google App Engine
This is Rietveld 408576698