| 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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" | 
| 9 | 9 | 
| 10 namespace ui { | 10 namespace ui { | 
| 11 | 11 | 
| 12 // This represents a buffer that can be directly imported via GL for | 12 // This represents a buffer that can be directly imported via GL for | 
| 13 // rendering, or exported via dma-buf fds. | 13 // rendering, or exported via dma-buf fds. | 
| 14 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { | 14 class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { | 
| 15  public: | 15  public: | 
| 16   NativePixmap() {} | 16   NativePixmap() {} | 
| 17 | 17 | 
| 18   virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0; | 18   virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0; | 
| 19   virtual int GetDmaBufFd() = 0; | 19   virtual int GetDmaBufFd() = 0; | 
| 20   virtual int GetDmaBufPitch() = 0; | 20   virtual int GetDmaBufPitch() = 0; | 
| 21 | 21 | 
|  | 22   enum BufferUsage { | 
|  | 23     MAP, | 
|  | 24     SCANOUT, | 
|  | 25   }; | 
|  | 26   virtual BufferUsage GetBufferUsage() const = 0; | 
|  | 27 | 
| 22  protected: | 28  protected: | 
| 23   virtual ~NativePixmap() {} | 29   virtual ~NativePixmap() {} | 
| 24 | 30 | 
| 25  private: | 31  private: | 
| 26   friend class base::RefCountedThreadSafe<NativePixmap>; | 32   friend class base::RefCountedThreadSafe<NativePixmap>; | 
| 27 | 33 | 
| 28   DISALLOW_COPY_AND_ASSIGN(NativePixmap); | 34   DISALLOW_COPY_AND_ASSIGN(NativePixmap); | 
| 29 }; | 35 }; | 
| 30 | 36 | 
| 31 }  // namespace ui | 37 }  // namespace ui | 
| 32 | 38 | 
| 33 #endif  // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ | 39 #endif  // UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ | 
| OLD | NEW | 
|---|