summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/windows/d3d11_texture_wrapper.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-02 12:21:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-02-12 08:13:00 +0000
commit606d85f2a5386472314d39923da28c70c60dc8e7 (patch)
treea8f4d7bf997f349f45605e6058259fba0630e4d7 /chromium/media/gpu/windows/d3d11_texture_wrapper.h
parent5786336dda477d04fb98483dca1a5426eebde2d7 (diff)
downloadqtwebengine-chromium-606d85f2a5386472314d39923da28c70c60dc8e7.tar.gz
BASELINE: Update Chromium to 96.0.4664.181
Change-Id: I762cd1da89d73aa6313b4a753fe126c34833f046 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/gpu/windows/d3d11_texture_wrapper.h')
-rw-r--r--chromium/media/gpu/windows/d3d11_texture_wrapper.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/chromium/media/gpu/windows/d3d11_texture_wrapper.h b/chromium/media/gpu/windows/d3d11_texture_wrapper.h
index 88171c16a82..4d8c95e6ecd 100644
--- a/chromium/media/gpu/windows/d3d11_texture_wrapper.h
+++ b/chromium/media/gpu/windows/d3d11_texture_wrapper.h
@@ -51,6 +51,14 @@ class MEDIA_GPU_EXPORT Texture2DWrapper {
ComD3D11Texture2D texture,
size_t array_size) = 0;
+ // If the |texture| has key mutex, it is important to acquire the key mutex
+ // before any usage or you'll get an error. This API is required to be called:
+ // - Before reading or writing to the texture via views on the texture or
+ // other means.
+ // - Before calling ProcessTexture.
+ // And need to call ProcessTexture() to release the key mutex.
+ virtual Status AcquireKeyedMutexIfNeeded() = 0;
+
// Import |texture|, |array_slice| and return the mailbox(es) that can be
// used to refer to it.
virtual Status ProcessTexture(const gfx::ColorSpace& input_color_space,
@@ -82,6 +90,8 @@ class MEDIA_GPU_EXPORT DefaultTexture2DWrapper : public Texture2DWrapper {
ComD3D11Texture2D in_texture,
size_t array_slice) override;
+ Status AcquireKeyedMutexIfNeeded() override;
+
Status ProcessTexture(const gfx::ColorSpace& input_color_space,
MailboxHolderArray* mailbox_dest,
gfx::ColorSpace* output_color_space) override;
@@ -104,6 +114,10 @@ class MEDIA_GPU_EXPORT DefaultTexture2DWrapper : public Texture2DWrapper {
DXGI_FORMAT dxgi_format,
ComD3D11Texture2D texture,
size_t array_slice);
+
+ GpuResources(const GpuResources&) = delete;
+ GpuResources& operator=(const GpuResources&) = delete;
+
~GpuResources();
private:
@@ -111,8 +125,6 @@ class MEDIA_GPU_EXPORT DefaultTexture2DWrapper : public Texture2DWrapper {
std::vector<std::unique_ptr<gpu::SharedImageRepresentationFactoryRef>>
shared_images_;
-
- DISALLOW_COPY_AND_ASSIGN(GpuResources);
};
// Receive an error from |gpu_resources_| and store it in |received_error_|.
@@ -126,6 +138,9 @@ class MEDIA_GPU_EXPORT DefaultTexture2DWrapper : public Texture2DWrapper {
MailboxHolderArray mailbox_holders_;
DXGI_FORMAT dxgi_format_;
+ Microsoft::WRL::ComPtr<IDXGIKeyedMutex> keyed_mutex_;
+ bool keyed_mutex_acquired_ = false;
+
base::WeakPtrFactory<DefaultTexture2DWrapper> weak_factory_{this};
};