client_native_pixmap_factory.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2015 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_GFX_CLIENT_NATIVE_PIXMAP_FACTORY_H_
  5. #define UI_GFX_CLIENT_NATIVE_PIXMAP_FACTORY_H_
  6. #include <memory>
  7. #include <vector>
  8. #include "base/files/scoped_file.h"
  9. #include "ui/gfx/buffer_types.h"
  10. #include "ui/gfx/client_native_pixmap.h"
  11. #include "ui/gfx/gfx_export.h"
  12. namespace gfx {
  13. struct NativePixmapHandle;
  14. class Size;
  15. // The Ozone interface allows external implementations to hook into Chromium to
  16. // provide a client pixmap for non-GPU processes.
  17. class GFX_EXPORT ClientNativePixmapFactory {
  18. public:
  19. virtual ~ClientNativePixmapFactory() {}
  20. // Import the native pixmap from |handle| to be used in non-GPU processes.
  21. // Implementations must verify that the buffer in |handle| fits an image of
  22. // the specified |size| and |format|. Otherwise nullptr is returned.
  23. virtual std::unique_ptr<ClientNativePixmap> ImportFromHandle(
  24. gfx::NativePixmapHandle handle,
  25. const gfx::Size& size,
  26. gfx::BufferFormat format,
  27. gfx::BufferUsage usage) = 0;
  28. };
  29. } // namespace gfx
  30. #endif // UI_GFX_CLIENT_NATIVE_PIXMAP_FACTORY_H_