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

Side by Side Diff: ui/ozone/public/native_pixmap.h

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extends the lifetime of VaapiWrapper Created 5 years, 1 month 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_PUBLIC_NATIVE_PIXMAP_H_ 5 #ifndef UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_
6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ 6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "ui/gfx/native_pixmap_handle_ozone.h" 10 #include "ui/gfx/native_pixmap_handle_ozone.h"
(...skipping 10 matching lines...) Expand all
21 // This represents a buffer that can be directly imported via GL for 21 // This represents a buffer that can be directly imported via GL for
22 // rendering, or exported via dma-buf fds. 22 // rendering, or exported via dma-buf fds.
23 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { 23 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> {
24 public: 24 public:
25 NativePixmap() {} 25 NativePixmap() {}
26 26
27 virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0; 27 virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0;
28 virtual int GetDmaBufFd() = 0; 28 virtual int GetDmaBufFd() = 0;
29 virtual int GetDmaBufPitch() = 0; 29 virtual int GetDmaBufPitch() = 0;
30 virtual gfx::BufferFormat GetBufferFormat() = 0; 30 virtual gfx::BufferFormat GetBufferFormat() = 0;
31 virtual gfx::Size size() = 0;
Pawel Osciak 2015/11/20 10:09:18 This should be a const method.
william.xie1 2015/11/23 03:33:58 Done.
31 32
32 // Sets the overlay plane to switch to at the next page flip. 33 // Sets the overlay plane to switch to at the next page flip.
33 // |w| specifies the screen to display this overlay plane on. 34 // |w| specifies the screen to display this overlay plane on.
34 // |plane_z_order| specifies the stacking order of the plane relative to the 35 // |plane_z_order| specifies the stacking order of the plane relative to the
35 // main framebuffer located at index 0. 36 // main framebuffer located at index 0.
36 // |plane_transform| specifies how the buffer is to be transformed during. 37 // |plane_transform| specifies how the buffer is to be transformed during.
37 // composition. 38 // composition.
38 // |buffer| to be presented by the overlay. 39 // |buffer| to be presented by the overlay.
39 // |display_bounds| specify where it is supposed to be on the screen. 40 // |display_bounds| specify where it is supposed to be on the screen.
40 // |crop_rect| specifies the region within the buffer to be placed 41 // |crop_rect| specifies the region within the buffer to be placed
41 // inside |display_bounds|. This is specified in texture coordinates, in the 42 // inside |display_bounds|. This is specified in texture coordinates, in the
42 // range of [0,1]. 43 // range of [0,1].
43 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 44 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
44 int plane_z_order, 45 int plane_z_order,
45 gfx::OverlayTransform plane_transform, 46 gfx::OverlayTransform plane_transform,
46 const gfx::Rect& display_bounds, 47 const gfx::Rect& display_bounds,
47 const gfx::RectF& crop_rect) = 0; 48 const gfx::RectF& crop_rect) = 0;
48 49
49 // This represents a callback function pointing to processing unit like VPP to 50 // This represents a callback function pointing to processing unit like VPP to
50 // do post-processing operations on native pixmap with required size and 51 // do post-processing operations on native pixmap with required size and
51 // format. 52 // format.
52 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size, 53 typedef base::Callback<scoped_refptr<NativePixmap>(
53 gfx::BufferFormat)> 54 const scoped_refptr<NativePixmap>& pixmap,
54 ProcessingCallback; 55 gfx::Size,
Pawel Osciak 2015/11/20 10:09:18 const&
william.xie1 2015/11/23 03:33:58 Done.
56 gfx::BufferFormat)> ProcessingCallback;
55 57
56 // Set callback function for the pixmap used for post processing. 58 // Set callback function for the pixmap used for post processing.
57 virtual void SetProcessingCallback( 59 virtual void SetProcessingCallback(
58 const ProcessingCallback& processing_callback) = 0; 60 const ProcessingCallback& processing_callback) = 0;
59 virtual scoped_refptr<NativePixmap> GetProcessedPixmap( 61 virtual scoped_refptr<NativePixmap> GetProcessedPixmap(
60 gfx::Size target_size, 62 gfx::Size target_size,
61 gfx::BufferFormat target_format) = 0; 63 gfx::BufferFormat target_format) = 0;
62 64
63 // Export the buffer for sharing across processes. 65 // Export the buffer for sharing across processes.
64 // Any file descriptors in the exported handle are owned by the caller. 66 // Any file descriptors in the exported handle are owned by the caller.
65 virtual gfx::NativePixmapHandle ExportHandle() = 0; 67 virtual gfx::NativePixmapHandle ExportHandle() = 0;
66 68
67 protected: 69 protected:
68 virtual ~NativePixmap() {} 70 virtual ~NativePixmap() {}
69 71
70 private: 72 private:
71 friend class base::RefCountedThreadSafe<NativePixmap>; 73 friend class base::RefCountedThreadSafe<NativePixmap>;
72 74
73 DISALLOW_COPY_AND_ASSIGN(NativePixmap); 75 DISALLOW_COPY_AND_ASSIGN(NativePixmap);
74 }; 76 };
75 77
76 } // namespace ui 78 } // namespace ui
77 79
78 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ 80 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_
OLDNEW
« ui/ozone/platform/cast/surface_factory_cast.cc ('K') | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698