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

Unified Diff: mojo/services/native_viewport/native_viewport_impl.h

Issue 510553002: Teach the native viewport service to draw a Surface into itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: mojo/services/native_viewport/native_viewport_impl.h
diff --git a/mojo/services/native_viewport/native_viewport_impl.h b/mojo/services/native_viewport/native_viewport_impl.h
index b57c36a4946cf28bfdb6ca240246c69a43a4ddf9..829973ab3d6f95fca90020271789d103f83938ec 100644
--- a/mojo/services/native_viewport/native_viewport_impl.h
+++ b/mojo/services/native_viewport/native_viewport_impl.h
@@ -6,8 +6,13 @@
#define MOJO_SERVICES_NATIVE_VIEWPORT_IMPL_H_
#include "base/memory/weak_ptr.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "mojo/services/native_viewport/platform_viewport.h"
+#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.h"
+#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
+#include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
+#include "ui/gfx/geometry/rect.h"
namespace ui {
class Event;
@@ -16,9 +21,10 @@ class Event;
namespace mojo {
class NativeViewportImpl : public InterfaceImpl<NativeViewport>,
- public PlatformViewport::Delegate {
+ public PlatformViewport::Delegate,
+ public SurfaceClient {
public:
- NativeViewportImpl();
+ NativeViewportImpl(SurfacesServicePtr surfaces_service, GpuPtr gpu_service);
virtual ~NativeViewportImpl();
// InterfaceImpl<NativeViewport> implementation.
@@ -27,6 +33,7 @@ class NativeViewportImpl : public InterfaceImpl<NativeViewport>,
virtual void Hide() OVERRIDE;
virtual void Close() OVERRIDE;
virtual void SetBounds(RectPtr bounds) OVERRIDE;
+ virtual void SubmittedFrame(SurfaceIdPtr surface_id) OVERRIDE;
// PlatformViewport::Delegate implementation.
virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
@@ -38,9 +45,22 @@ class NativeViewportImpl : public InterfaceImpl<NativeViewport>,
void AckEvent();
private:
+ // SurfaceClient implementation.
+ virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
+
+ void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace);
+ void CreateViewportBoundSurface();
+ void SubmitFrame();
- gfx::AcceleratedWidget widget_;
scoped_ptr<PlatformViewport> platform_viewport_;
+ SurfacesServicePtr surfaces_service_;
jamesr 2014/08/26 23:05:50 might be worth splitting all this crap out into a
sky 2014/08/26 23:16:32 Sure.
+ SurfacePtr surface_;
+ GpuPtr gpu_service_;
+ gfx::Rect bounds_;
+ uint64_t widget_id_;
+ scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
+ cc::SurfaceId surface_id_;
+ cc::SurfaceId child_surface_id_;
bool waiting_for_event_ack_;
base::WeakPtrFactory<NativeViewportImpl> weak_factory_;
};

Powered by Google App Engine
This is Rietveld 408576698