| 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" |
| 10 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/gfx/overlay_transform.h" | 12 #include "ui/gfx/overlay_transform.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Rect; | 15 class Rect; |
| 15 class RectF; | 16 class RectF; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 | 20 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // This represents a callback function pointing to scaling unit like VPP | 48 // This represents a callback function pointing to scaling unit like VPP |
| 48 // to do scaling operations on native pixmap with required size. | 49 // to do scaling operations on native pixmap with required size. |
| 49 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size)> | 50 typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size)> |
| 50 ScalingCallback; | 51 ScalingCallback; |
| 51 | 52 |
| 52 // Set callback function for the pixmap used for scaling. | 53 // Set callback function for the pixmap used for scaling. |
| 53 virtual void SetScalingCallback(const ScalingCallback& scaling_callback) = 0; | 54 virtual void SetScalingCallback(const ScalingCallback& scaling_callback) = 0; |
| 54 virtual scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) = 0; | 55 virtual scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) = 0; |
| 55 | 56 |
| 57 // Export the buffer for sharing across processes. |
| 58 // Any file descriptors in the exported handle are owned by the caller. |
| 59 virtual bool ExportHandle(gfx::NativePixmapHandle* handle) = 0; |
| 60 |
| 56 protected: | 61 protected: |
| 57 virtual ~NativePixmap() {} | 62 virtual ~NativePixmap() {} |
| 58 | 63 |
| 59 private: | 64 private: |
| 60 friend class base::RefCountedThreadSafe<NativePixmap>; | 65 friend class base::RefCountedThreadSafe<NativePixmap>; |
| 61 | 66 |
| 62 DISALLOW_COPY_AND_ASSIGN(NativePixmap); | 67 DISALLOW_COPY_AND_ASSIGN(NativePixmap); |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 } // namespace ui | 70 } // namespace ui |
| 66 | 71 |
| 67 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ | 72 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ |
| OLD | NEW |