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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 699073004: content: Add command line flag for native GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu-memory-buffer-impl-unittests
Patch Set: fix unit test failures on macosx Created 6 years, 1 month 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/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 463a9b5b558ba4a8c3cda087449756dbe602944e..37875eb70f2492ec84d391fc0e50b63250fdbc03 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -50,6 +50,7 @@
#include "content/browser/fileapi/fileapi_message_filter.h"
#include "content/browser/frame_host/render_frame_message_filter.h"
#include "content/browser/geofencing/geofencing_dispatcher_host.h"
+#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/gpu/gpu_process_host.h"
@@ -105,6 +106,7 @@
#include "content/common/child_process_host_impl.h"
#include "content/common/child_process_messages.h"
#include "content/common/content_switches_internal.h"
+#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/common/mojo/mojo_messages.h"
#include "content/common/resource_messages.h"
@@ -1021,6 +1023,20 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) {
if (IsForceGpuRasterizationEnabled())
command_line->AppendSwitch(switches::kForceGpuRasterization);
+ if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled(
+ gfx::GpuMemoryBuffer::MAP)) {
+ std::vector<gfx::GpuMemoryBufferType> supported_types;
+ GpuMemoryBufferFactory::GetSupportedTypes(&supported_types);
+ DCHECK(!supported_types.empty());
+
+ // The GPU service will always use the preferred type.
+ gfx::GpuMemoryBufferType type = supported_types[0];
+
+ // Surface texture backed GPU memory buffers require TEXTURE_EXTERNAL_OES.
+ if (type == gfx::SURFACE_TEXTURE_BUFFER)
+ command_line->AppendSwitch(switches::kUseImageExternal);
+ }
+
// Appending disable-gpu-feature switches due to software rendering list.
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
DCHECK(gpu_data_manager);

Powered by Google App Engine
This is Rietveld 408576698