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

Unified Diff: content/common/child_process_host_impl.cc

Issue 77023002: gpu: Add IOSurface backed GpuMemoryBuffer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix overflow check Created 7 years 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 | « content/common/child_process_host_impl.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_process_host_impl.cc
diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc
index a2f40d4d7b37704c742b6ee725a8aad2aa53776f..1467536ac91131404381ba8f1b1d177c564e4de8 100644
--- a/content/common/child_process_host_impl.cc
+++ b/content/common/child_process_host_impl.cc
@@ -17,6 +17,7 @@
#include "base/strings/stringprintf.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "content/common/child_process_messages.h"
+#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
#include "content/public/common/child_process_host_delegate.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
@@ -296,10 +297,15 @@ void ChildProcessHostImpl::OnShutdownRequest() {
}
void ChildProcessHostImpl::OnAllocateGpuMemoryBuffer(
- uint32 buffer_size,
+ uint32 width,
+ uint32 height,
+ uint32 internalformat,
gfx::GpuMemoryBufferHandle* handle) {
handle->type = gfx::SHARED_MEMORY_BUFFER;
- AllocateSharedMemory(buffer_size, peer_handle_, &handle->handle);
+ AllocateSharedMemory(
+ width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat),
+ peer_handle_,
+ &handle->handle);
}
} // namespace content
« no previous file with comments | « content/common/child_process_host_impl.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698