OLD | NEW |
(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_PUBLIC_NATIVE_PIXMAP_H_ |
| 6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/overlay_transform.h" |
| 11 |
| 12 namespace gfx { |
| 13 class Rect; |
| 14 class RectF; |
| 15 } |
| 16 |
| 17 namespace ui { |
| 18 |
| 19 // This represents a buffer that can be directly imported via GL for |
| 20 // rendering, or exported via dma-buf fds. |
| 21 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { |
| 22 public: |
| 23 NativePixmap() {} |
| 24 |
| 25 virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0; |
| 26 virtual int GetDmaBufFd() = 0; |
| 27 virtual int GetDmaBufPitch() = 0; |
| 28 |
| 29 // Sets the overlay plane to switch to at the next page flip. |
| 30 // |w| specifies the screen to display this overlay plane on. |
| 31 // |plane_z_order| specifies the stacking order of the plane relative to the |
| 32 // main framebuffer located at index 0. |
| 33 // |plane_transform| specifies how the buffer is to be transformed during. |
| 34 // composition. |
| 35 // |buffer| to be presented by the overlay. |
| 36 // |display_bounds| specify where it is supposed to be on the screen. |
| 37 // |crop_rect| specifies the region within the buffer to be placed |
| 38 // inside |display_bounds|. This is specified in texture coordinates, in the |
| 39 // range of [0,1]. |
| 40 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
| 41 int plane_z_order, |
| 42 gfx::OverlayTransform plane_transform, |
| 43 const gfx::Rect& display_bounds, |
| 44 const gfx::RectF& crop_rect) = 0; |
| 45 |
| 46 protected: |
| 47 virtual ~NativePixmap() {} |
| 48 |
| 49 private: |
| 50 friend class base::RefCountedThreadSafe<NativePixmap>; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(NativePixmap); |
| 53 }; |
| 54 |
| 55 } // namespace ui |
| 56 |
| 57 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ |
OLD | NEW |