protected_native_pixmap_query_delegate.h 1.1 KB

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 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 COMPONENTS_EXO_PROTECTED_NATIVE_PIXMAP_QUERY_DELEGATE_H_
  5. #define COMPONENTS_EXO_PROTECTED_NATIVE_PIXMAP_QUERY_DELEGATE_H_
  6. #include "base/callback_forward.h"
  7. #include "base/files/scoped_file.h"
  8. namespace exo {
  9. // Interface for querying if a GMB handle is associated with a protected native
  10. // pixmap. This is needed for platforms with HW protected video so we set the
  11. // properties on the quad correctly.
  12. class ProtectedNativePixmapQueryDelegate {
  13. public:
  14. virtual ~ProtectedNativePixmapQueryDelegate() = default;
  15. using IsProtectedNativePixmapHandleCallback = base::OnceCallback<void(bool)>;
  16. // Queries the GPU process for whether or not the passed in handle is
  17. // associated with protected native pixmap. Invokes the callback
  18. // asynchronously with the result.
  19. virtual void IsProtectedNativePixmapHandle(
  20. base::ScopedFD handle,
  21. IsProtectedNativePixmapHandleCallback callback) = 0;
  22. };
  23. } // namespace exo
  24. #endif // COMPONENTS_EXO_PROTECTED_NATIVE_PIXMAP_QUERY_DELEGATE_H_