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

Unified Diff: services/native_viewport/main.cc

Issue 940293003: Add a Display and ContextProvider concept to mojom, use to recreate (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « services/native_viewport/BUILD.gn ('k') | services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/native_viewport/main.cc
diff --git a/services/native_viewport/main.cc b/services/native_viewport/main.cc
index 459b8f5bccf8f7cee376b1220e5e5e9e3d9a2d98..63d6fecb81ba21bfb769cd501ad9ea2cd8c006b1 100644
--- a/services/native_viewport/main.cc
+++ b/services/native_viewport/main.cc
@@ -32,18 +32,16 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
private:
// mojo::ApplicationDelegate implementation.
void Initialize(mojo::ApplicationImpl* application) override {
- app_ = application;
+ tracing_.Initialize(application);
- tracing_.Initialize(app_);
-
- if (app_->HasArg(mojo::kUseTestConfig))
+ if (application->HasArg(mojo::kUseTestConfig))
gfx::GLSurface::InitializeOneOffForTests();
- else if (app_->HasArg(mojo::kUseOSMesa))
+ else if (application->HasArg(mojo::kUseOSMesa))
gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL);
else
gfx::GLSurface::InitializeOneOff();
- is_headless_ = app_->HasArg(mojo::kUseHeadlessConfig);
+ is_headless_ = application->HasArg(mojo::kUseHeadlessConfig);
}
bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
@@ -55,19 +53,20 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
// mojo::InterfaceFactory<NativeViewport> implementation.
void Create(ApplicationConnection* connection,
mojo::InterfaceRequest<NativeViewport> request) override {
- new NativeViewportImpl(app_, is_headless_, request.Pass());
+ if (!gpu_state_.get())
+ gpu_state_ = new gles2::GpuState;
+ new NativeViewportImpl(is_headless_, gpu_state_, request.Pass());
}
// mojo::InterfaceFactory<Gpu> implementation.
void Create(ApplicationConnection* connection,
mojo::InterfaceRequest<Gpu> request) override {
if (!gpu_state_.get())
- gpu_state_ = new gles2::GpuImpl::State;
+ gpu_state_ = new gles2::GpuState;
new gles2::GpuImpl(request.Pass(), gpu_state_);
}
- mojo::ApplicationImpl* app_;
- scoped_refptr<gles2::GpuImpl::State> gpu_state_;
+ scoped_refptr<gles2::GpuState> gpu_state_;
bool is_headless_;
mojo::TracingImpl tracing_;
« no previous file with comments | « services/native_viewport/BUILD.gn ('k') | services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698