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

Unified Diff: services/native_viewport/native_viewport_impl.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/native_viewport_impl.h
diff --git a/services/native_viewport/native_viewport_impl.h b/services/native_viewport/native_viewport_impl.h
index 0701cff3ef8c51775a6c7ca0841e40c67fc14a04..6592cc44e20145f4a2145cb85a2695ea109c5a7d 100644
--- a/services/native_viewport/native_viewport_impl.h
+++ b/services/native_viewport/native_viewport_impl.h
@@ -12,17 +12,22 @@
#include "mojo/services/gpu/public/interfaces/gpu.mojom.h"
#include "mojo/services/native_viewport/public/interfaces/native_viewport.mojom.h"
#include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h"
+#include "services/native_viewport/onscreen_context_provider.h"
#include "services/native_viewport/platform_viewport.h"
#include "ui/gfx/geometry/rect.h"
-namespace ui {
-class Event;
-}
-
namespace mojo {
class ApplicationImpl;
}
+namespace gles2 {
+class GpuState;
+}
+
+namespace ui {
+class Event;
+}
+
namespace native_viewport {
class ViewportSurface;
@@ -33,25 +38,23 @@ class ViewportSurface;
class NativeViewportImpl : public mojo::NativeViewport,
public PlatformViewport::Delegate,
public mojo::ErrorHandler {
- using CreateCallback = mojo::Callback<void(uint64_t native_viewport_id,
- mojo::ViewportMetricsPtr metrics)>;
- using MetricsCallback =
- mojo::Callback<void(mojo::ViewportMetricsPtr metrics)>;
-
public:
NativeViewportImpl(mojo::ApplicationImpl* app,
bool is_headless,
+ const scoped_refptr<gles2::GpuState>& gpu_state,
mojo::InterfaceRequest<mojo::NativeViewport> request);
~NativeViewportImpl() override;
// NativeViewport implementation.
void Create(mojo::SizePtr size, const CreateCallback& callback) override;
- void RequestMetrics(const MetricsCallback& callback) override;
+ void RequestMetrics(const RequestMetricsCallback& callback) override;
void Show() override;
void Hide() override;
void Close() override;
void SetSize(mojo::SizePtr size) override;
- void SubmittedFrame(mojo::SurfaceIdPtr surface_id) override;
+ // void SubmittedFrame(mojo::SurfaceIdPtr surface_id) override;
+ void GetContextProvider(
+ mojo::InterfaceRequest<mojo::ContextProvider> request) override;
void SetEventDispatcher(
mojo::NativeViewportEventDispatcherPtr dispatcher) override;
@@ -70,6 +73,7 @@ class NativeViewportImpl : public mojo::NativeViewport,
bool is_headless_;
scoped_ptr<PlatformViewport> platform_viewport_;
scoped_ptr<ViewportSurface> viewport_surface_;
+ OnscreenContextProvider context_provider_;
uint64_t widget_id_;
bool sent_metrics_;
mojo::ViewportMetricsPtr metrics_;
@@ -78,7 +82,7 @@ class NativeViewportImpl : public mojo::NativeViewport,
cc::SurfaceId child_surface_id_;
bool waiting_for_event_ack_;
CreateCallback create_callback_;
- MetricsCallback metrics_callback_;
+ RequestMetricsCallback metrics_callback_;
mojo::NativeViewportEventDispatcherPtr event_dispatcher_;
mojo::Binding<mojo::NativeViewport> binding_;
base::WeakPtrFactory<NativeViewportImpl> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698