Index: ui/aura/mus/mus_context_factory.cc |
diff --git a/ui/aura/mus/mus_context_factory.cc b/ui/aura/mus/mus_context_factory.cc |
index c73271e077b84ca4187fd1e3b7414197021a7735..539350d9db45ea2f0db582b4edba75dccc7272da 100644 |
--- a/ui/aura/mus/mus_context_factory.cc |
+++ b/ui/aura/mus/mus_context_factory.cc |
@@ -18,13 +18,28 @@ |
namespace aura { |
+namespace { |
+cc::BufferToTextureTargetMap CreateBufferToTextureTargetMap() { |
+ cc::BufferToTextureTargetMap image_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); |
+ // TODO(sad): http://crbug.com/675431 |
+ image_targets[std::make_pair(usage, format)] = GL_TEXTURE_2D; |
+ } |
+ } |
+ return image_targets; |
+} |
+} // namespace |
+ |
MusContextFactory::MusContextFactory(ui::Gpu* gpu) |
: gpu_(gpu), |
- renderer_settings_(ui::CreateRendererSettings( |
- [](gfx::BufferFormat format, gfx::BufferUsage usage) -> uint32_t { |
- // TODO(sad): http://crbug.com/675431 |
- return GL_TEXTURE_2D; |
- })), |
+ renderer_settings_( |
+ ui::CreateRendererSettings(CreateBufferToTextureTargetMap())), |
weak_ptr_factory_(this) {} |
MusContextFactory::~MusContextFactory() {} |