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

Unified 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, 5 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_surface.h
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface.h b/ui/ozone/platform/drm/gpu/gbm_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..372a095c4ff86524cae4e5301e8ea803fc5931a0
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/gbm_surface.h
@@ -0,0 +1,57 @@
+// Copyright 2016 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 UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_image.h"
+#include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
+
+namespace ui {
+
+class DrmWindowProxy;
+class GbmSurfaceFactory;
+
+// A GLSurface for GBM Ozone platform provides surface-like semantics
+// implemented through surfaceless. A framebuffer is bound automatically.
+class GbmSurface : public GbmSurfaceless {
+ public:
+ GbmSurface(GbmSurfaceFactory* surface_factory,
+ std::unique_ptr<DrmWindowProxy> window,
+ gfx::AcceleratedWidget widget);
+
+ // gl::GLSurface:
+ unsigned int GetBackingFrameBufferObject() override;
+ bool OnMakeCurrent(gl::GLContext* context) override;
+ bool Resize(const gfx::Size& size,
+ float scale_factor,
+ bool has_alpha) override;
+ bool SupportsPostSubBuffer() override;
+ void SwapBuffersAsync(const SwapCompletionCallback& callback) override;
+ void Destroy() override;
+ bool IsSurfaceless() const override;
+
+ private:
+ ~GbmSurface() override;
+
+ void BindFramebuffer();
+ bool CreatePixmaps();
+
+ scoped_refptr<gl::GLContext> context_;
+ GLuint fbo_ = 0;
+ GLuint textures_[2];
+ scoped_refptr<gl::GLImage> images_[2];
+ int current_surface_ = 0;
+
+ DISALLOW_COPY_AND_ASSIGN(GbmSurface);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACE_H_
« 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