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

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: rebase Created 5 years 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() const = 0; 27 virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() const = 0;
28 virtual int GetDmaBufFd() const = 0; 28 virtual int GetDmaBufFd() const = 0;
29 virtual int GetDmaBufPitch() const = 0; 29 virtual int GetDmaBufPitch() const = 0;
30 virtual gfx::BufferFormat GetBufferFormat() const = 0; 30 virtual gfx::BufferFormat GetBufferFormat() const = 0;
31 31 virtual gfx::Size GetBufferSize() const = 0;
32 // Sets the overlay plane to switch to at the next page flip. 32 // Sets the overlay plane to switch to at the next page flip.
33 // |w| specifies the screen to display this overlay plane on. 33 // |w| specifies the screen to display this overlay plane on.
34 // |plane_z_order| specifies the stacking order of the plane relative to the 34 // |plane_z_order| specifies the stacking order of the plane relative to the
35 // main framebuffer located at index 0. 35 // main framebuffer located at index 0.
36 // |plane_transform| specifies how the buffer is to be transformed during. 36 // |plane_transform| specifies how the buffer is to be transformed during.
37 // composition. 37 // composition.
38 // |buffer| to be presented by the overlay. 38 // |buffer| to be presented by the overlay.
39 // |display_bounds| specify where it is supposed to be on the screen. 39 // |display_bounds| specify where it is supposed to be on the screen.
40 // |crop_rect| specifies the region within the buffer to be placed 40 // |crop_rect| specifies the region within the buffer to be placed
41 // inside |display_bounds|. This is specified in texture coordinates, in the 41 // inside |display_bounds|. This is specified in texture coordinates, in the
42 // range of [0,1]. 42 // range of [0,1].
43 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, 43 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
44 int plane_z_order, 44 int plane_z_order,
45 gfx::OverlayTransform plane_transform, 45 gfx::OverlayTransform plane_transform,
46 const gfx::Rect& display_bounds, 46 const gfx::Rect& display_bounds,
47 const gfx::RectF& crop_rect) = 0; 47 const gfx::RectF& crop_rect) = 0;
48 48
49 // This represents a callback function pointing to processing unit like VPP to 49 // This represents a callback function pointing to processing unit like VPP to
50 // do post-processing operations on native pixmap with required size and 50 // do post-processing operations on native pixmap with required size and
51 // format. 51 // format.
Pawel Osciak 2015/12/02 00:49:06 Please update this documentation.
william.xie1 2015/12/02 02:31:13 Done.
52 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size, 52 typedef base::Callback<bool(const scoped_refptr<NativePixmap>&,
53 gfx::BufferFormat)> 53 NativePixmap*)> ProcessingCallback;
54 ProcessingCallback;
55 54
56 // Set callback function for the pixmap used for post processing. 55 // Set callback function for the pixmap used for post processing.
57 virtual void SetProcessingCallback( 56 virtual void SetProcessingCallback(
58 const ProcessingCallback& processing_callback) = 0; 57 const ProcessingCallback& processing_callback) = 0;
59 virtual scoped_refptr<NativePixmap> GetProcessedPixmap( 58 virtual scoped_refptr<NativePixmap> GetProcessedPixmap(
60 gfx::Size target_size, 59 gfx::Size target_size,
61 gfx::BufferFormat target_format) = 0; 60 gfx::BufferFormat target_format) = 0;
62 61
63 // Export the buffer for sharing across processes. 62 // Export the buffer for sharing across processes.
64 // Any file descriptors in the exported handle are owned by the caller. 63 // Any file descriptors in the exported handle are owned by the caller.
65 virtual gfx::NativePixmapHandle ExportHandle() = 0; 64 virtual gfx::NativePixmapHandle ExportHandle() = 0;
66 65
67 protected: 66 protected:
68 virtual ~NativePixmap() {} 67 virtual ~NativePixmap() {}
69 68
70 private: 69 private:
71 friend class base::RefCountedThreadSafe<NativePixmap>; 70 friend class base::RefCountedThreadSafe<NativePixmap>;
72 71
73 DISALLOW_COPY_AND_ASSIGN(NativePixmap); 72 DISALLOW_COPY_AND_ASSIGN(NativePixmap);
74 }; 73 };
75 74
76 } // namespace ui 75 } // namespace ui
77 76
78 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ 77 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698