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

Unified Diff: ui/aura/mus/mus_context_factory.cc

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: nit taken care Created 3 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ui/compositor/compositor_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ui/compositor/compositor_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698