summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h')
-rw-r--r--chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h b/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h
new file mode 100644
index 00000000000..4f6c690d7b3
--- /dev/null
+++ b/chromium/third_party/blink/renderer/platform/graphics/gpu/webgpu_image_bitmap_handler.h
@@ -0,0 +1,32 @@
+// Copyright 2019 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_
+#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_
+
+#include "base/containers/span.h"
+#include "third_party/blink/renderer/platform/platform_export.h"
+#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
+
+namespace blink {
+
+struct WebGPUImageUploadSizeInfo {
+ uint64_t size_in_bytes;
+ uint32_t wgpu_row_pitch;
+};
+
+class CanvasColorParams;
+class IntRect;
+class StaticBitmapImage;
+
+WebGPUImageUploadSizeInfo PLATFORM_EXPORT
+ComputeImageBitmapWebGPUUploadSizeInfo(const IntRect& rect,
+ const CanvasColorParams& color_params);
+bool PLATFORM_EXPORT
+CopyBytesFromImageBitmapForWebGPU(scoped_refptr<StaticBitmapImage> image,
+ base::span<uint8_t> dst,
+ const IntRect& rect,
+ const CanvasColorParams& color_params);
+} // namespace blink
+#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_GPU_WEBGPU_IMAGE_BITMAP_HANDLER_H_