| OLD | NEW |
| (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 UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ | |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/gfx/native_widget_types.h" | |
| 12 #include "ui/ozone/platform/drm/gpu/overlay_plane.h" | |
| 13 #include "ui/ozone/public/surface_ozone_egl.h" | |
| 14 | |
| 15 namespace gfx { | |
| 16 class Size; | |
| 17 } | |
| 18 | |
| 19 namespace ui { | |
| 20 | |
| 21 class DrmWindowProxy; | |
| 22 class GbmSurfaceFactory; | |
| 23 | |
| 24 // In surfaceless mode drawing and displaying happens directly through | |
| 25 // NativePixmap buffers. CC would call into SurfaceFactoryOzone to allocate the | |
| 26 // buffers and then call ScheduleOverlayPlane(..) to schedule the buffer for | |
| 27 // presentation. | |
| 28 class GbmSurfaceless : public SurfaceOzoneEGL { | |
| 29 public: | |
| 30 GbmSurfaceless(std::unique_ptr<DrmWindowProxy> window, | |
| 31 GbmSurfaceFactory* surface_manager); | |
| 32 ~GbmSurfaceless() override; | |
| 33 | |
| 34 void QueueOverlayPlane(const OverlayPlane& plane); | |
| 35 | |
| 36 // SurfaceOzoneEGL: | |
| 37 intptr_t GetNativeWindow() override; | |
| 38 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; | |
| 39 bool OnSwapBuffers() override; | |
| 40 void OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; | |
| 41 std::unique_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; | |
| 42 bool IsUniversalDisplayLinkDevice() override; | |
| 43 void* /* EGLConfig */ GetEGLSurfaceConfig( | |
| 44 const EglConfigCallbacks& egl) override; | |
| 45 | |
| 46 protected: | |
| 47 std::unique_ptr<DrmWindowProxy> window_; | |
| 48 | |
| 49 GbmSurfaceFactory* surface_manager_; | |
| 50 | |
| 51 std::vector<OverlayPlane> planes_; | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceless); | |
| 55 }; | |
| 56 | |
| 57 } // namespace ui | |
| 58 | |
| 59 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ | |
| OLD | NEW |