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

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

Issue 1251693003: cc: Fix the format of GpuMemoryBuffer for SurfaceTexture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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 | « components/html_viewer/web_layer_tree_view_impl.cc ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d290778c2ef396872a90bc8ac67359e78b6a3f7e..538def269c686ced634f4d4261531f70a7de3b40 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -404,6 +404,16 @@ class SessionStorageHolder : public base::SupportsUserData::Data {
DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder);
};
+std::string UintVectorToString(const std::vector<unsigned>& vector) {
+ std::string str;
+ for (auto it : vector) {
+ if (!str.empty())
+ str += ",";
+ str += base::UintToString(it);
+ }
+ return str;
+}
+
} // namespace
RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
@@ -1142,21 +1152,19 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) {
if (IsForceGpuRasterizationEnabled())
command_line->AppendSwitch(switches::kForceGpuRasterization);
- command_line->AppendSwitchASCII(
- switches::kContentImageTextureTarget,
- base::UintToString(
- // TODO(reveman): We currently assume that the compositor will use
- // BGRA_8888 if it's able to, and RGBA_8888 otherwise. Since we don't
- // know what it will use we hardcode BGRA_8888 here for now. We should
- // instead move decisions about GpuMemoryBuffer format to the browser
- // embedder so we know it here, and pass that decision to the
- // compositor for each usage.
- // crbug.com/490362
- BrowserGpuMemoryBufferManager::GetImageTextureTarget(
- gfx::BufferFormat::BGRA_8888,
- // TODO(danakj): When one-copy supports partial update, change
- // this usage to PERSISTENT_MAP for one-copy.
- gfx::BufferUsage::MAP)));
+ std::vector<unsigned> image_targets(
+ static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D);
+ for (size_t format = 0;
+ format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
+ image_targets[format] =
+ BrowserGpuMemoryBufferManager::GetImageTextureTarget(
+ static_cast<gfx::BufferFormat>(format),
+ // TODO(danakj): When one-copy supports partial update, change
+ // this usage to PERSISTENT_MAP for one-copy.
+ gfx::BufferUsage::MAP);
+ }
+ command_line->AppendSwitchASCII(switches::kContentImageTextureTarget,
+ UintVectorToString(image_targets));
command_line->AppendSwitchASCII(
switches::kVideoImageTextureTarget,
« no previous file with comments | « components/html_viewer/web_layer_tree_view_impl.cc ('k') | content/renderer/gpu/compositor_dependencies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698