Commit 1f249157 authored by Aaron Krajeski's avatar Aaron Krajeski Committed by Commit Bot

Don't create a null image in createPattern

NullImage is a static ref that probably saves createPattern some time
and memory if it's creating the same invalid pattern over and over
again. Unfortunately it is not thread safe and createPattern needs to
run in OffscreenCanvas workers as well.

BitmapImage::Create has the same functionality, though perhaps some
slight performance implications.

Bug: 1045346
Change-Id: Iee5287321555ae0e4b7514305254fff97ae20fbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050674Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740887}
parent 7c0c9b6f
......@@ -21,6 +21,7 @@
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_pattern.h"
#include "third_party/blink/renderer/modules/canvas/canvas2d/path_2d.h"
#include "third_party/blink/renderer/platform/geometry/float_quad.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/skia/skia_utils.h"
#include "third_party/blink/renderer/platform/graphics/stroke_data.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
......@@ -1411,7 +1412,7 @@ CanvasPattern* BaseRenderingContext2D::createPattern(
"Source image is in the 'broken' state.");
return nullptr;
case kInvalidSourceImageStatus:
image_for_rendering = Image::NullImage();
image_for_rendering = BitmapImage::Create();
break;
case kIncompleteSourceImageStatus:
return nullptr;
......
......@@ -6427,7 +6427,6 @@ crbug.com/1042848 virtual/feature-policy-permissions/external/wpt/mediacapture-s
crbug.com/1046440 fast/loader/submit-form-while-parsing-2.html [ Pass Failure Timeout ]
crbug.com/1041851 [ Mac ] external/wpt/bluetooth/idl/idlharness.tentative.https.window.html [ Pass Timeout ]
crbug.com/1041851 [ Win10 ] external/wpt/bluetooth/idl/idlharness.tentative.https.window.html [ Pass Timeout ]
crbug.com/1045346 external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Crash Pass Timeout ]
# COOP timeout failure.
crbug.com/1046698 external/wpt/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Timeout ]
......
......@@ -1090,5 +1090,4 @@ external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.html [ Pass Fail
external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.serviceworker.html [ Pass Failure ]
external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.sharedworker.html [ Pass Failure ]
external/wpt/fetch/cross-origin-resource-policy/fetch.https.any.worker.html [ Pass Failure ]
external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Pass Crash Failure Timeout ]
# ---- End tests differing between CQ and Waterfall
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