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

Unified Diff: services/native_viewport/onscreen_context_provider.h

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
Index: services/native_viewport/onscreen_context_provider.h
diff --git a/services/native_viewport/onscreen_context_provider.h b/services/native_viewport/onscreen_context_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..04115cb5e22e51ba49601f0c3d78bc875bc317b1
--- /dev/null
+++ b/services/native_viewport/onscreen_context_provider.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_
+#define SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_
+
+#include "base/memory/ref_counted.h"
+#include "mojo/services/gpu/public/interfaces/context_provider.mojom.h"
+#include "mojo/services/gpu/public/interfaces/viewport_parameter_listener.mojom.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace gles2 {
+class GpuState;
+}
+
+namespace native_viewport {
+
+class OnscreenContextProvider : public mojo::ContextProvider {
+ public:
+ explicit OnscreenContextProvider(const scoped_refptr<gles2::GpuState>& state);
+ ~OnscreenContextProvider() override;
+
+ void Bind(mojo::InterfaceRequest<mojo::ContextProvider> request);
+
+ void SetAcceleratedWidget(gfx::AcceleratedWidget widget);
+
+ private:
+ // mojo::ContextProvider implementation:
+ void Create(mojo::ViewportParameterListenerPtr viewport_parameter_listener,
+ const CreateCallback& callback) override;
+
+ void CreateAndReturnCommandBuffer();
+
+ scoped_refptr<gles2::GpuState> state_;
+ gfx::AcceleratedWidget widget_;
+ mojo::ViewportParameterListenerPtr pending_listener_;
+ CreateCallback pending_create_callback_;
+ mojo::Binding<mojo::ContextProvider> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(OnscreenContextProvider);
+};
+
+} // namespace mojo
+
+#endif // SERVICES_NATIVE_VIEWPORT_ONSCREEN_CONTEXT_PROVIDER_H_
« no previous file with comments | « services/native_viewport/native_viewport_impl.cc ('k') | services/native_viewport/onscreen_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698