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

Unified Diff: ui/views/mus/surface_context_factory.cc

Issue 2233003003: services/ui: Inject GpuService instance where needed, instead of singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « ui/views/mus/surface_context_factory.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/surface_context_factory.cc
diff --git a/ui/views/mus/surface_context_factory.cc b/ui/views/mus/surface_context_factory.cc
index 08fb8c6cbbd72610fe5669945a0b07d1cedb9d19..e6efa858c3ce533283ceced85d2aadf156deee8b 100644
--- a/ui/views/mus/surface_context_factory.cc
+++ b/ui/views/mus/surface_context_factory.cc
@@ -8,6 +8,7 @@
#include "cc/output/output_surface.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "cc/surfaces/surface_id_allocator.h"
+#include "services/ui/common/gpu_service.h"
#include "services/ui/public/cpp/output_surface.h"
#include "services/ui/public/cpp/window.h"
#include "ui/compositor/reflector.h"
@@ -28,8 +29,8 @@ class FakeReflector : public ui::Reflector {
} // namespace
-SurfaceContextFactory::SurfaceContextFactory()
- : next_surface_id_namespace_(1u) {}
+SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service)
+ : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {}
SurfaceContextFactory::~SurfaceContextFactory() {}
@@ -38,8 +39,8 @@ void SurfaceContextFactory::CreateOutputSurface(
ui::Window* window = compositor->window();
NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window);
ui::mojom::SurfaceType surface_type = native_widget->surface_type();
- std::unique_ptr<cc::OutputSurface> surface(
- new ui::OutputSurface(window->RequestSurface(surface_type)));
+ std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface(
+ gpu_service_, window->RequestSurface(surface_type)));
compositor->SetOutputSurface(std::move(surface));
}
« no previous file with comments | « ui/views/mus/surface_context_factory.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698