• xlai's avatar
    Correct SourceImageStatus in OffscreenCanvas::getSourceImageForCanvas · ce494afb
    xlai authored
    The crash in constructor of ImagePattern may be due to the fact that
    image passed in as its constructor argument is nullptr. By tracking
    all the call trace backwards, we find the image creation originates
    from BaseRenderingContext2D::createPattern, where the SourceImageStatus
    indicates what corresponding action to do. But this SourceImageStatus
    was wrongly set for OffscreenCanvas, in particular, in the function
    OffscreenCanvas::getSourceImageForCanvas. This CL corrects it and makes
    sure that if the image is null, BaseRenderingContext2D::createPattern
    will return Image::nullImage() instead of nullptr.
    
    BUG=646654
    
    Review-Url: https://codereview.chromium.org/2344573002
    Cr-Commit-Position: refs/heads/master@{#418927}
    ce494afb
OffscreenCanvas-empty-image-source.html 945 Bytes