Commit 14eae65d authored by Jonah Ryan-Davis's avatar Jonah Ryan-Davis Committed by Commit Bot

Revert "Support imageBitmap generated from video by GPU resource"

This reverts commit 46c9a968.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1105923
Failures on webgl image_bitmap_from_video tests on windows

Original change's description:
> Support imageBitmap generated from video by GPU resource
> 
> This patch replaces the backed resource of imageBimap generated from
> video element to GPU resource.
> 
> The old path has been used as fallback path.
> 
> BUG=1098445
> 
> Change-Id: I346396a3a52bfe5034f9ef9580f875b1f5cb3177
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277108
> Reviewed-by: Khushal <khushalsagar@chromium.org>
> Reviewed-by: Kenneth Russell <kbr@chromium.org>
> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
> Cr-Commit-Position: refs/heads/master@{#788457}

TBR=kbr@chromium.org,shaobo.yan@intel.com,khushalsagar@chromium.org

Change-Id: I7080c52b11f60a11789305a9f123bcf41f6b4793
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1098445
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300182Reviewed-by: default avatarJonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Cr-Commit-Position: refs/heads/master@{#788691}
parent 0c6de033
......@@ -6,12 +6,12 @@
#include <memory>
#include <utility>
#include "base/memory/scoped_refptr.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/clamped_math.h"
#include "base/single_thread_task_runner.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
#include "third_party/blink/renderer/core/html/canvas/image_data.h"
......@@ -20,7 +20,6 @@
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
......@@ -248,31 +247,6 @@ std::unique_ptr<CanvasResourceProvider> CreateProvider(
size, kLow_SkFilterQuality, color_params);
}
std::unique_ptr<CanvasResourceProvider> CreateProviderForVideoElement(
HTMLVideoElement* video,
const ImageBitmapOptions* options) {
// TODO(crbug.com/1098445): ImageBitmap resize test case failed when
// quality equals to "low" and "medium". Need further investigate to
// enable gpu backed imageBitmap with resize options.
if (!SharedGpuContext::ContextProviderWrapper() ||
options->hasResizeWidth() || options->hasResizeHeight()) {
return CanvasResourceProvider::CreateBitmapProvider(
IntSize(video->videoWidth(), video->videoHeight()),
kLow_SkFilterQuality, CanvasColorParams());
}
uint32_t shared_image_usage_flags = gpu::SHARED_IMAGE_USAGE_DISPLAY;
return CanvasResourceProvider::CreateSharedImageProvider(
IntSize(video->videoWidth(), video->videoHeight()),
SharedGpuContext::ContextProviderWrapper(), kLow_SkFilterQuality,
CanvasColorParams(CanvasColorSpace::kSRGB,
CanvasColorParams::GetNativeCanvasPixelFormat(),
kNonOpaque), // Default canvas settings
false, // Origin of GL texture is bottom left on screen
RasterMode::kGPU, shared_image_usage_flags);
}
scoped_refptr<StaticBitmapImage> FlipImageVertically(
scoped_refptr<StaticBitmapImage> input,
const ImageBitmap::ParsedOptions& parsed_options) {
......@@ -671,8 +645,12 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video,
if (DstBufferSizeHasOverflow(parsed_options))
return;
// TODO(fserb): this shouldn't be software?
std::unique_ptr<CanvasResourceProvider> resource_provider =
CreateProviderForVideoElement(video, options);
CanvasResourceProvider::CreateBitmapProvider(
IntSize(video->videoWidth(), video->videoHeight()),
kLow_SkFilterQuality,
CanvasColorParams()); // TODO: set color space here to avoid clamping
if (!resource_provider)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment