Index: content/browser/gpu/compositor_util.cc |
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc |
index 1298d758be69ca71da7af70e1afe58c859c8ec19..0252bcb409fb8b8f6a17c57e5f912050b7540615 100644 |
--- a/content/browser/gpu/compositor_util.cc |
+++ b/content/browser/gpu/compositor_util.cc |
@@ -398,4 +398,19 @@ std::vector<std::string> GetDriverBugWorkarounds() { |
return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); |
} |
+void GetBufferToTextureTargetMap( |
+ cc::BufferToTextureTargetMap* texture_targets) { |
+ for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); |
+ ++usage_idx) { |
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); |
+ for (int format_idx = 0; |
+ format_idx <= static_cast<int>(gfx::BufferFormat::LAST); |
+ ++format_idx) { |
+ gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
+ uint32_t target = gpu::GetImageTextureTarget(format, usage); |
+ (*texture_targets)[std::make_pair(usage, format)] = target; |
+ } |
+ } |
+} |
+ |
} // namespace content |