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

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

Issue 2895273002: Unified the use of BufferToTextureTargetMap for all the Processes (Closed)
Patch Set: Unified the use of BufferToTextureTargetMap for all the Processes Created 3 years, 6 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
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 fd6cd926e637a4ca7a73f3e62442be340e8f24b8..e34b8c28eff0d562d9451c44cfd549a026dc671f 100644
--- a/ui/aura/mus/mus_context_factory.cc
+++ b/ui/aura/mus/mus_context_factory.cc
@@ -18,13 +18,25 @@
namespace aura {
+cc::BufferToTextureTargetMap GetBufferToTextureTargetMap() {
+ 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);
+ image_targets[std::make_pair(usage, format)] = GL_TEXTURE_2D;
+ }
+ }
+ return image_targets;
+}
+
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
danakj 2017/06/28 17:00:19 Keep this TODO where we set them to GL_TEXTURE_2D
sujith 2017/06/29 06:21:50 Done.
- return GL_TEXTURE_2D;
- })),
+ renderer_settings_(
+ ui::CreateRendererSettings(GetBufferToTextureTargetMap())),
weak_ptr_factory_(this) {}
MusContextFactory::~MusContextFactory() {}

Powered by Google App Engine
This is Rietveld 408576698