diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/imagebitmap')
3 files changed, 10 insertions, 14 deletions
diff --git a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc index 6a20a923983..95997336af0 100644 --- a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc +++ b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc @@ -570,8 +570,7 @@ ImageBitmap::ImageBitmap(ImageElementBase* image, if (!image_) return; - image_->SetOriginClean( - !image->WouldTaintOrigin(document->GetSecurityOrigin())); + image_->SetOriginClean(!image->WouldTaintOrigin()); UpdateImageBitmapMemoryUsage(); } @@ -606,8 +605,7 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, if (!image_) return; - image_->SetOriginClean( - !video->WouldTaintOrigin(document->GetSecurityOrigin())); + image_->SetOriginClean(!video->WouldTaintOrigin()); UpdateImageBitmapMemoryUsage(); } @@ -709,8 +707,9 @@ ImageBitmap::ImageBitmap(ImageData* data, } // Copy / color convert the pixels - scoped_refptr<ArrayBuffer> pixels_buffer = ArrayBuffer::CreateOrNull( - src_rect.Size().Area(), parsed_options.color_params.BytesPerPixel()); + scoped_refptr<ArrayBuffer> pixels_buffer = + ArrayBuffer::CreateOrNull(SafeCast<uint32_t>(src_rect.Size().Area()), + parsed_options.color_params.BytesPerPixel()); if (!pixels_buffer) return; unsigned byte_length = pixels_buffer->ByteLength(); @@ -987,8 +986,7 @@ ScriptPromise ImageBitmap::CreateAsync(ImageElementBase* image, ImageBitmap* bitmap = MakeGarbageCollected<ImageBitmap>(MakeBlankImage(parsed_options)); if (bitmap->BitmapImage()) { - bitmap->BitmapImage()->SetOriginClean( - !image->WouldTaintOrigin(document->GetSecurityOrigin())); + bitmap->BitmapImage()->SetOriginClean(!image->WouldTaintOrigin()); resolver->Resolve(bitmap); } else { resolver->Reject( @@ -1011,7 +1009,7 @@ ScriptPromise ImageBitmap::CreateAsync(ImageElementBase* image, CrossThreadBind(&RasterizeImageOnBackgroundThread, WrapCrossThreadPersistent(resolver), std::move(paint_record), draw_dst_rect, - !image->WouldTaintOrigin(document->GetSecurityOrigin()), + !image->WouldTaintOrigin(), WTF::Passed(std::move(passed_parsed_options)))); return promise; } diff --git a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.h b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.h index 08e225280c0..bea78c0d82d 100644 --- a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.h +++ b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap.h @@ -141,9 +141,7 @@ class CORE_EXPORT ImageBitmap final : public ScriptWrappable, scoped_refptr<Image> GetSourceImageForCanvas(SourceImageStatus*, AccelerationHint, const FloatSize&) override; - bool WouldTaintOrigin(const SecurityOrigin*) const override { - return !image_->OriginClean(); - } + bool WouldTaintOrigin() const override { return !image_->OriginClean(); } void AdjustDrawRects(FloatRect* src_rect, FloatRect* dst_rect) const override; FloatSize ElementSize(const FloatSize&) const override; bool IsImageBitmap() const override { return true; } diff --git a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap_test.cc b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap_test.cc index 0b2b63e3962..80d1e199ccf 100644 --- a/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap_test.cc +++ b/chromium/third_party/blink/renderer/core/imagebitmap/image_bitmap_test.cc @@ -614,8 +614,8 @@ TEST_F(ImageBitmapTest, ImageBitmapPixelFormat) { // internal SkImage back storage. ASSERT_EQ(sk_image_internal, sk_image_internal_8888); - sk_sp<SkColorSpace> p3_color_space = SkColorSpace::MakeRGB( - SkColorSpace::kLinear_RenderTargetGamma, SkColorSpace::kDCIP3_D65_Gamut); + sk_sp<SkColorSpace> p3_color_space = + SkColorSpace::MakeRGB(SkNamedTransferFn::kLinear, SkNamedGamut::kDCIP3); SkImageInfo info_f16 = SkImageInfo::Make(10, 10, kRGBA_F16_SkColorType, kPremul_SkAlphaType, p3_color_space); sk_sp<SkSurface> surface_f16(SkSurface::MakeRaster(info_f16)); |