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

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

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 5 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 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_VGEM_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_
7
8 #include "ui/ozone/public/native_pixmap.h"
9 #include "ui/ozone/public/surface_factory_ozone.h"
10
11 namespace ui {
12
13 class VgemPixmap : public NativePixmap {
14 public:
15 VgemPixmap(base::FileDescriptor handle,
16 base::FileDescriptor vgem_handle,
17 gfx::Size size,
18 SurfaceFactoryOzone::BufferFormat format,
19 BufferUsage usage);
20 bool Initialize();
21
22 // NativePixmap:
23 void* GetEGLClientBuffer() override;
24 int GetDmaBufFd() override;
25 int GetDmaBufPitch() override;
26 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
27 int plane_z_order,
28 gfx::OverlayTransform plane_transform,
29 const gfx::Rect& display_bounds,
30 const gfx::RectF& crop_rect) override;
31 void SetScalingCallback(const ScalingCallback& scaling_callback) override;
32 scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) override;
33 BufferUsage GetBufferUsage() const override;
34 void* Map() override;
35 void Unmap() override;
36
37 protected:
38 ~VgemPixmap() override;
39
40 private:
41 uint32_t vgem_bo_handle_;
42 base::ScopedFD dma_buf_;
43 base::FileDescriptor vgem_fd_;
44 gfx::Size size_;
45 SurfaceFactoryOzone::BufferFormat format_;
46 BufferUsage usage_;
47 size_t stride_;
48 void* mmap_ptr_;
49
50 DISALLOW_COPY_AND_ASSIGN(VgemPixmap);
51 };
52
53 } // namespace ui
54
55 #endif // UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698