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

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: Change switches::kContentImageTextureTarget to a list of image texture targets Created 5 years, 5 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/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 e6df625995260a1880ca0af522c5ceaff11abee8..c8f158ddde633b487284b207394d6a281a8aad2c 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -399,6 +399,17 @@ class SessionStorageHolder : public base::SupportsUserData::Data {
DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder);
};
+std::string UintVectorToString(const std::vector<uint>& vector) {
+ std::string rt;
reveman 2015/07/27 17:07:15 nit: maybe s/rt/str/ to be consistent with StringT
+ for (std::vector<uint>::const_iterator it = vector.begin();
+ it != vector.end(); ++it) {
reveman 2015/07/27 17:07:15 nit: for (auto it : vector) { ...
+ if (!rt.empty())
+ rt += ",";
+ rt += base::UintToString(*it);
+ }
+ return rt;
+}
+
} // namespace
RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
@@ -1135,21 +1146,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::GpuMemoryBuffer::BGRA_8888,
- // TODO(danakj): When one-copy supports partial update, change
- // this usage to PERSISTENT_MAP for one-copy.
- gfx::GpuMemoryBuffer::MAP)));
+ std::vector<uint> image_targets(gfx::GpuMemoryBuffer::FORMAT_LAST + 1,
+ GL_TEXTURE_2D);
+ for (size_t format = 0; format < gfx::GpuMemoryBuffer::FORMAT_LAST + 1;
+ format++) {
+ image_targets[format] =
+ BrowserGpuMemoryBufferManager::GetImageTextureTarget(
+ static_cast<gfx::GpuMemoryBuffer::Format>(format),
+ // TODO(danakj): When one-copy supports partial update, change
+ // this usage to PERSISTENT_MAP for one-copy.
+ gfx::GpuMemoryBuffer::MAP);
+ }
+ command_line->AppendSwitchASCII(switches::kContentImageTextureTarget,
+ UintVectorToString(image_targets));
command_line->AppendSwitchASCII(
switches::kVideoImageTextureTarget,

Powered by Google App Engine
This is Rietveld 408576698