OLD | NEW |
---|---|
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/buffer_types.h" | |
reveman
2015/08/05 13:58:53
is this include needed?
spang
2015/08/05 14:06:18
Seems not, removed.
| |
11 #include "ui/gfx/native_pixmap_handle_ozone.h" | |
10 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
11 #include "ui/gfx/overlay_transform.h" | 13 #include "ui/gfx/overlay_transform.h" |
12 | 14 |
13 namespace gfx { | 15 namespace gfx { |
16 class NativePixmapHandle; | |
14 class Rect; | 17 class Rect; |
15 class RectF; | 18 class RectF; |
16 } | 19 } |
17 | 20 |
18 namespace ui { | 21 namespace ui { |
19 | 22 |
20 // This represents a buffer that can be directly imported via GL for | 23 // This represents a buffer that can be directly imported via GL for |
21 // rendering, or exported via dma-buf fds. | 24 // rendering, or exported via dma-buf fds. |
22 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { | 25 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { |
23 public: | 26 public: |
(...skipping 22 matching lines...) Expand all Loading... | |
46 | 49 |
47 // This represents a callback function pointing to scaling unit like VPP | 50 // This represents a callback function pointing to scaling unit like VPP |
48 // to do scaling operations on native pixmap with required size. | 51 // to do scaling operations on native pixmap with required size. |
49 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size)> | 52 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size)> |
50 ScalingCallback; | 53 ScalingCallback; |
51 | 54 |
52 // Set callback function for the pixmap used for scaling. | 55 // Set callback function for the pixmap used for scaling. |
53 virtual void SetScalingCallback(const ScalingCallback& scaling_callback) = 0; | 56 virtual void SetScalingCallback(const ScalingCallback& scaling_callback) = 0; |
54 virtual scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) = 0; | 57 virtual scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) = 0; |
55 | 58 |
59 // Export the buffer for sharing across processes. | |
60 // Any file descriptors in the exported handle are owned by the caller. | |
61 virtual gfx::NativePixmapHandle ExportHandle() = 0; | |
62 | |
56 protected: | 63 protected: |
57 virtual ~NativePixmap() {} | 64 virtual ~NativePixmap() {} |
58 | 65 |
59 private: | 66 private: |
60 friend class base::RefCountedThreadSafe<NativePixmap>; | 67 friend class base::RefCountedThreadSafe<NativePixmap>; |
61 | 68 |
62 DISALLOW_COPY_AND_ASSIGN(NativePixmap); | 69 DISALLOW_COPY_AND_ASSIGN(NativePixmap); |
63 }; | 70 }; |
64 | 71 |
65 } // namespace ui | 72 } // namespace ui |
66 | 73 |
67 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ | 74 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ |
OLD | NEW |