// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_GL_GL_FENCE_WIN_H_ #define UI_GL_GL_FENCE_WIN_H_ #include "ui/gl/gl_fence.h" #include #include namespace gl { class GL_EXPORT GLFenceWin : public GLFence { public: static std::unique_ptr CreateForGpuFence(); static std::unique_ptr CreateForGpuFence(ID3D11Device*); static std::unique_ptr CreateFromGpuFence( const gfx::GpuFence& gpu_fence); static std::unique_ptr CreateFromGpuFence( ID3D11Device*, const gfx::GpuFence& gpu_fence); static bool IsSupported(); GLFenceWin(Microsoft::WRL::ComPtr d3d11_fence, gfx::GpuFenceHandle gpu_fence_handle); ~GLFenceWin() override; TransferableFence Transfer() override; bool HasCompleted() override; void ClientWait() override; void ServerWait() override; std::unique_ptr GetGpuFence() override; private: Microsoft::WRL::ComPtr d3d11_fence_; gfx::GpuFenceHandle gpu_fence_handle_; }; } // namespace gl #endif