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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_surface.h

Issue 2165303002: Convert Ozone GBM to use new surface API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone_impl
Patch Set: Add missing dep. Created 4 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/drm/gbm.gypi ('k') | ui/ozone/platform/drm/gpu/gbm_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "ui/gl/gl_context.h"
13 #include "ui/gl/gl_image.h"
14 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
15
16 namespace ui {
17
18 class DrmWindowProxy;
19 class GbmSurfaceFactory;
20
21 // A GLSurface for GBM Ozone platform provides surface-like semantics
22 // implemented through surfaceless. A framebuffer is bound automatically.
23 class GbmSurface : public GbmSurfaceless {
24 public:
25 GbmSurface(GbmSurfaceFactory* surface_factory,
26 std::unique_ptr<DrmWindowProxy> window,
27 gfx::AcceleratedWidget widget);
28
29 // gl::GLSurface:
30 unsigned int GetBackingFrameBufferObject() override;
31 bool OnMakeCurrent(gl::GLContext* context) override;
32 bool Resize(const gfx::Size& size,
33 float scale_factor,
34 bool has_alpha) override;
35 bool SupportsPostSubBuffer() override;
36 void SwapBuffersAsync(const SwapCompletionCallback& callback) override;
37 void Destroy() override;
38 bool IsSurfaceless() const override;
39
40 private:
41 ~GbmSurface() override;
42
43 void BindFramebuffer();
44 bool CreatePixmaps();
45
46 scoped_refptr<gl::GLContext> context_;
47 GLuint fbo_ = 0;
48 GLuint textures_[2];
49 scoped_refptr<gl::GLImage> images_[2];
50 int current_surface_ = 0;
51
52 DISALLOW_COPY_AND_ASSIGN(GbmSurface);
53 };
54
55 } // namespace ui
56
57 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gbm.gypi ('k') | ui/ozone/platform/drm/gpu/gbm_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698