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, |