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

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

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: . Created 5 years, 3 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_
7 7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "ui/gfx/native_widget_types.h"
8 #include "ui/ozone/public/surface_ozone_egl.h" 11 #include "ui/ozone/public/surface_ozone_egl.h"
9 12
10 namespace gfx { 13 namespace gfx {
11 class Size; 14 class Size;
12 } // namespace gfx 15 }
13 16
14 namespace ui { 17 namespace ui {
15 18
16 class DrmDeviceManager; 19 class DrmThread;
17 class DrmWindow; 20 class DrmWindow;
18 21
19 // In surfaceless mode drawing and displaying happens directly through 22 // In surfaceless mode drawing and displaying happens directly through
20 // NativePixmap buffers. CC would call into SurfaceFactoryOzone to allocate the 23 // NativePixmap buffers. CC would call into SurfaceFactoryOzone to allocate the
21 // buffers and then call ScheduleOverlayPlane(..) to schedule the buffer for 24 // buffers and then call ScheduleOverlayPlane(..) to schedule the buffer for
22 // presentation. 25 // presentation.
23 class GbmSurfaceless : public SurfaceOzoneEGL { 26 class GbmSurfaceless : public SurfaceOzoneEGL {
24 public: 27 public:
25 GbmSurfaceless(DrmWindow* window, DrmDeviceManager* drm_device_manager); 28 GbmSurfaceless(gfx::AcceleratedWidget widget, DrmThread* drm_thread);
26 ~GbmSurfaceless() override; 29 ~GbmSurfaceless() override;
27 30
28 // SurfaceOzoneEGL: 31 // SurfaceOzoneEGL:
29 intptr_t GetNativeWindow() override; 32 intptr_t GetNativeWindow() override;
30 bool ResizeNativeWindow(const gfx::Size& viewport_size) override; 33 bool ResizeNativeWindow(const gfx::Size& viewport_size) override;
31 bool OnSwapBuffers() override; 34 bool OnSwapBuffers() override;
32 bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) override; 35 bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) override;
33 scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override; 36 scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
34 bool IsUniversalDisplayLinkDevice() override; 37 bool IsUniversalDisplayLinkDevice() override;
35 38
36 protected: 39 protected:
37 DrmWindow* window_; 40 gfx::AcceleratedWidget widget_;
38 DrmDeviceManager* drm_device_manager_; 41 DrmThread* drm_thread_;
42 base::WeakPtr<DrmWindow> window_;
39 43
40 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceless); 44 DISALLOW_COPY_AND_ASSIGN(GbmSurfaceless);
41 }; 45 };
42 46
43 } // namespace ui 47 } // namespace ui
44 48
45 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_ 49 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_SURFACELESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698