Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Issue 2344573002: Correct SourceImageStatus in OffscreenCanvas::getSourceImageForCanvas (Closed)

Created:
4 years, 3 months ago by xlai (Olivia)
Modified:
4 years, 3 months ago
Reviewers:
Justin Novosad
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Rik, f(malita), blink-reviews, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Correct SourceImageStatus in OffscreenCanvas::getSourceImageForCanvas 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 Committed: https://crrev.com/ce494afba26d386e562b8e8d84ef707d5c54bfc3 Cr-Commit-Position: refs/heads/master@{#418927}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Redo #

Patch Set 3 : One more status #

Patch Set 4 : Adding test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -3 lines) Patch
A third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-empty-image-source.html View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 2 1 chunk +12 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (7 generated)
xlai (Olivia)
4 years, 3 months ago (2016-09-14 17:37:23 UTC) #2
Justin Novosad
https://codereview.chromium.org/2344573002/diff/1/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp File third_party/WebKit/Source/platform/graphics/ImagePattern.cpp (right): https://codereview.chromium.org/2344573002/diff/1/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp#newcode26 third_party/WebKit/Source/platform/graphics/ImagePattern.cpp:26: matrix.setIdentity(); I don't understand what this is supposed to ...
4 years, 3 months ago (2016-09-14 18:05:08 UTC) #4
Justin Novosad
I just looked at the crash report. What I think is happening is that |image| ...
4 years, 3 months ago (2016-09-14 18:06:33 UTC) #5
Justin Novosad
https://codereview.chromium.org/2344573002/diff/1/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp File third_party/WebKit/Source/platform/graphics/ImagePattern.cpp (right): https://codereview.chromium.org/2344573002/diff/1/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp#newcode18 third_party/WebKit/Source/platform/graphics/ImagePattern.cpp:18: return adoptRef(new ImagePattern(std::move(image), repeatMode)); Perhaps add a null check ...
4 years, 3 months ago (2016-09-14 18:07:45 UTC) #6
xlai (Olivia)
Redo the CL and changed title and description. Instead of doing an ad-hoc null check, ...
4 years, 3 months ago (2016-09-14 18:58:45 UTC) #9
Justin Novosad
Great fix, but please add a test
4 years, 3 months ago (2016-09-14 20:30:31 UTC) #10
xlai (Olivia)
Using the ClusterFuzz use case to write a minimized test case. This test will crash ...
4 years, 3 months ago (2016-09-15 16:28:33 UTC) #11
Justin Novosad
lgtm
4 years, 3 months ago (2016-09-15 17:14:46 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2344573002/60001
4 years, 3 months ago (2016-09-15 17:56:56 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-09-15 19:05:34 UTC) #16
commit-bot: I haz the power
4 years, 3 months ago (2016-09-15 19:07:45 UTC) #18
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ce494afba26d386e562b8e8d84ef707d5c54bfc3
Cr-Commit-Position: refs/heads/master@{#418927}

Powered by Google App Engine
This is Rietveld 408576698