summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/swap_result.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/gfx/swap_result.h')
-rw-r--r--chromium/ui/gfx/swap_result.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/chromium/ui/gfx/swap_result.h b/chromium/ui/gfx/swap_result.h
index 027a1914ae7..1a71e4ec174 100644
--- a/chromium/ui/gfx/swap_result.h
+++ b/chromium/ui/gfx/swap_result.h
@@ -5,10 +5,16 @@
#ifndef UI_GFX_SWAP_RESULT_H_
#define UI_GFX_SWAP_RESULT_H_
+#include <memory>
+
#include "base/time/time.h"
+#include "ui/gfx/gfx_export.h"
namespace gfx {
+struct CALayerParams;
+class GpuFence;
+
enum class SwapResult {
SWAP_ACK,
SWAP_FAILED,
@@ -38,12 +44,32 @@ struct SwapResponse {
uint64_t swap_id;
// Indicates whether the swap succeeded or not.
+ // TODO(https://crbug.com/894929): It may be more reasonable to add
+ // a full SwapCompletionResult as a member.
SwapResult result;
// Timing information about the given swap.
SwapTimings timings;
};
+// Sent by GLImages to their GLImage::SwapCompletionCallbacks.
+struct GFX_EXPORT SwapCompletionResult {
+ explicit SwapCompletionResult(gfx::SwapResult swap_result);
+ SwapCompletionResult(gfx::SwapResult swap_result,
+ std::unique_ptr<gfx::GpuFence> gpu_fence);
+ SwapCompletionResult(gfx::SwapResult swap_result,
+ std::unique_ptr<gfx::CALayerParams> ca_layer_params);
+ SwapCompletionResult(SwapCompletionResult&& other);
+ ~SwapCompletionResult();
+
+ SwapCompletionResult(const SwapCompletionResult& other) = delete;
+ SwapCompletionResult& operator=(const SwapCompletionResult other) = delete;
+
+ gfx::SwapResult swap_result = SwapResult::SWAP_FAILED;
+ std::unique_ptr<GpuFence> gpu_fence;
+ std::unique_ptr<CALayerParams> ca_layer_params;
+};
+
} // namespace gfx
#endif // UI_GFX_SWAP_RESULT_H_