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

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

Issue 2879463002: Initialize RendererSettings in ContextFactory (Closed)
Patch Set: Address comments Created 3 years, 7 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 9517875318f35ee39d05ef00313a8b7970cf1c18..dd1c0a392b9de3b5b7cd27f33f6a60355fdeb6ec 100644
--- a/ui/aura/mus/mus_context_factory.cc
+++ b/ui/aura/mus/mus_context_factory.cc
@@ -4,16 +4,32 @@
#include "ui/aura/mus/mus_context_factory.h"
+#include "base/command_line.h"
#include "base/memory/ptr_util.h"
+#include "cc/base/switches.h"
#include "services/ui/public/cpp/gpu/gpu.h"
#include "ui/aura/mus/window_port_mus.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/compositor/compositor_switches.h"
+#include "ui/compositor/compositor_util.h"
+#include "ui/display/display_switches.h"
+#include "ui/gfx/switches.h"
#include "ui/gl/gl_bindings.h"
namespace aura {
+// uint32_t Helper(gfx::BufferUsage)
danakj 2017/05/11 20:10:16 unintended?
Alex Z. 2017/05/12 14:12:36 It's removed.
+
MusContextFactory::MusContextFactory(ui::Gpu* gpu)
- : gpu_(gpu), weak_ptr_factory_(this) {}
+ : gpu_(gpu), weak_ptr_factory_(this) {
+ ui::InitializeRendererSettings(
+ base::Bind(
+ [](gfx::BufferFormat format, gfx::BufferUsage usage) -> uint32_t {
+ // TODO(sad): http://crbug.com/675431
+ return GL_TEXTURE_2D;
+ }),
+ &renderer_settings_);
+}
MusContextFactory::~MusContextFactory() {}
@@ -62,12 +78,6 @@ double MusContextFactory::GetRefreshRate() const {
return 60.0;
}
-uint32_t MusContextFactory::GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) {
- // TODO(sad): http://crbug.com/675431
- return GL_TEXTURE_2D;
-}
-
gpu::GpuMemoryBufferManager* MusContextFactory::GetGpuMemoryBufferManager() {
return gpu_->gpu_memory_buffer_manager();
}
@@ -76,4 +86,8 @@ cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() {
return raster_thread_helper_.task_graph_runner();
}
+const cc::RendererSettings& MusContextFactory::GetRendererSettings() const {
+ return renderer_settings_;
+}
+
} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698