gl_image_glx_native_pixmap.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2020 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. #ifndef UI_GL_GL_IMAGE_GLX_NATIVE_PIXMAP_H_
  5. #define UI_GL_GL_IMAGE_GLX_NATIVE_PIXMAP_H_
  6. #include "base/memory/scoped_refptr.h"
  7. #include "ui/gfx/buffer_types.h"
  8. #include "ui/gfx/geometry/size.h"
  9. #include "ui/gfx/native_pixmap.h"
  10. #include "ui/gl/gl_export.h"
  11. #include "ui/gl/gl_image_glx.h"
  12. namespace gl {
  13. class GL_EXPORT GLImageGLXNativePixmap : public GLImageGLX {
  14. public:
  15. GLImageGLXNativePixmap(const gfx::Size& size,
  16. gfx::BufferFormat format,
  17. gfx::BufferPlane plane = gfx::BufferPlane::DEFAULT);
  18. GLImageGLXNativePixmap(const GLImageGLXNativePixmap&) = delete;
  19. GLImageGLXNativePixmap& operator=(const GLImageGLXNativePixmap&) = delete;
  20. bool Initialize(scoped_refptr<gfx::NativePixmap> pixmap);
  21. static bool CanImportNativePixmap();
  22. protected:
  23. ~GLImageGLXNativePixmap() override;
  24. private:
  25. scoped_refptr<gfx::NativePixmap> native_pixmap_;
  26. };
  27. } // namespace gl
  28. #endif // UI_GL_GL_IMAGE_GLX_NATIVE_PIXMAP_H_