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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 963223002: ui: Pass correct image texture target and one-copy settings to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: usetexturetarget: exportswitch Created 5 years, 10 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/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 0eee6d4ce2ffff896be9cb3740e9047f70cea610..fea661a4084ac07a158f20fe162574be2613ce8c 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -21,6 +21,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/content_client.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_forwarding_message_filter.h"
#include "ipc/message_filter.h"
@@ -247,6 +248,31 @@ bool BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled(
return g_enabled_gpu_memory_buffer_usages.Get().count(usage) != 0;
}
+// static
+uint32 BrowserGpuChannelHostFactory::GetImageTextureTarget() {
+ if (!IsGpuMemoryBufferFactoryUsageEnabled(gfx::GpuMemoryBuffer::MAP))
+ return GL_TEXTURE_2D;
+
+ 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];
+
+ switch (type) {
+ case gfx::SURFACE_TEXTURE_BUFFER:
+ // Surface texture backed GPU memory buffers require
+ // TEXTURE_EXTERNAL_OES.
+ return GL_TEXTURE_EXTERNAL_OES;
+ case gfx::IO_SURFACE_BUFFER:
+ // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
+ return GL_TEXTURE_RECTANGLE_ARB;
+ default:
+ return GL_TEXTURE_2D;
+ }
+}
+
BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
: gpu_client_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
shutdown_event_(new base::WaitableEvent(true, false)),
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698