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

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

Issue 1285183008: Ozone integration. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add missing license header Created 5 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
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 UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/skia_util.h"
13 #include "ui/gfx/swap_result.h"
14 #include "ui/ozone/ozone_export.h"
15 #include "ui/ozone/public/surface_ozone_canvas.h"
16
17 class SkImage;
18 class SkSurface;
19
20 namespace ui {
21
22 class DrmBuffer;
23 class DrmWindow;
24 class HardwareDisplayController;
25
26 class OZONE_EXPORT DrmSurface : public SurfaceOzoneCanvas {
27 public:
28 DrmSurface(DrmWindow* window_delegate);
29 ~DrmSurface() override;
30
31 // SurfaceOzoneCanvas:
32 skia::RefPtr<SkSurface> GetSurface() override;
33 void ResizeCanvas(const gfx::Size& viewport_size) override;
34 void PresentCanvas(const gfx::Rect& damage) override;
35 scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
36
37 private:
38 void SchedulePageFlip();
39
40 // Callback for SchedulePageFlip(). This will signal when the page flip event
41 // has completed.
42 void OnPageFlip(gfx::SwapResult result);
43
44 DrmWindow* window_delegate_;
45
46 // The actual buffers used for painting.
47 scoped_refptr<DrmBuffer> front_buffer_;
48 scoped_refptr<DrmBuffer> back_buffer_;
49
50 skia::RefPtr<SkSurface> surface_;
51 gfx::Rect last_damage_;
52
53 // Keep track of the requested image and damage for the last presentation.
54 // This will be used to update the scanout buffers once the previous page flip
55 // events completes.
56 skia::RefPtr<SkImage> pending_image_;
57 gfx::Rect pending_image_damage_;
58 bool pending_pageflip_ = false;
59
60 base::WeakPtrFactory<DrmSurface> weak_ptr_factory_;
61
62 DISALLOW_COPY_AND_ASSIGN(DrmSurface);
63 };
64
65 } // namespace ui
66
67 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_SURFACE_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_gpu_platform_support_inprocess.cc ('k') | ui/ozone/platform/drm/gpu/drm_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698