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

Side by Side Diff: services/native_viewport/viewport_surface.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, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_NATIVE_VIEWPORT_VIEWPORT_SURFACE_H_
6 #define SERVICES_NATIVE_VIEWPORT_VIEWPORT_SURFACE_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "cc/surfaces/surface_id.h"
11 #include "mojo/services/gpu/public/interfaces/gpu.mojom.h"
12 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h"
13 #include "ui/gfx/native_widget_types.h"
14 #include "ui/gfx/size.h"
15
16 namespace native_viewport {
17
18 // This manages the surface that draws to a particular NativeViewport instance.
19 class ViewportSurface {
20 public:
21 ViewportSurface(mojo::SurfacePtr surface,
22 mojo::Gpu* gpu_service,
23 const gfx::Size& size,
24 cc::SurfaceId child_id);
25 ~ViewportSurface();
26
27 void SetWidgetId(uint64_t widget_id);
28 void SetSize(const gfx::Size& size);
29 void SetChildId(cc::SurfaceId child_id);
30
31 private:
32 void BindSurfaceToNativeViewport();
33 void SubmitFrame();
34
35 mojo::SurfacePtr surface_;
36 mojo::Gpu* gpu_service_;
37 uint64_t widget_id_;
38 gfx::Size size_;
39 bool gles2_bound_surface_created_;
40 cc::SurfaceId child_id_;
41 base::WeakPtrFactory<ViewportSurface> weak_factory_;
42
43 DISALLOW_COPY_AND_ASSIGN(ViewportSurface);
44 };
45
46 } // namespace native_viewport
47
48 #endif // SERVICES_NATIVE_VIEWPORT_VIEWPORT_SURFACE_H_
OLDNEW
« no previous file with comments | « services/native_viewport/onscreen_context_provider.cc ('k') | services/native_viewport/viewport_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698