| 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..b03a8801758364c7938984062d36c0994d1af6f7 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -399,6 +399,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;
|
| @@ -1135,21 +1145,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<unsigned> 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,
|
|
|