Bug 150108 - Change GraphicsContext image-drawing functions to take references
Summary: Change GraphicsContext image-drawing functions to take references
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-13 16:59 PDT by Simon Fraser (smfr)
Modified: 2015-10-14 11:11 PDT (History)
1 user (show)

See Also:


Attachments
Patch (92.94 KB, patch)
2015-10-13 17:00 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (96.83 KB, patch)
2015-10-13 18:11 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (98.03 KB, patch)
2015-10-13 18:43 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (94.78 KB, patch)
2015-10-13 20:07 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (99.80 KB, patch)
2015-10-13 20:48 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (100.57 KB, patch)
2015-10-14 08:43 PDT, Simon Fraser (smfr)
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-10-13 16:59:16 PDT
Change GraphicsContext image-drawing functions to take references
Comment 1 Simon Fraser (smfr) 2015-10-13 17:00:54 PDT
Created attachment 263038 [details]
Patch
Comment 2 Tim Horton 2015-10-13 17:09:19 PDT
Comment on attachment 263038 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=263038&action=review

> Source/WebCore/platform/graphics/filters/FEBlend.cpp:76
> +    if (!imageBuffer || !imageBuffer2)
> +        return;

Please make sure this doesn't cause us to end up with uninitialized data in a filter buffer.

> Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp:151
> +    if (inBuffer)

As above. I really think crashing might be better in some of these cases.

> Source/WebCore/platform/graphics/filters/FEMerge.cpp:54
> +        if (ImageBuffer* inBuffer = in->asImageBuffer())

Ditto.

> Source/WebCore/platform/graphics/filters/FEOffset.cpp:83
> +    if (!resultImage || !inBuffer)

Ditto.

> Source/WebCore/platform/graphics/filters/FETile.cpp:51
> +    if (!resultImage || !inBuffer)

Ditto.

> Source/WebCore/platform/graphics/filters/SourceAlpha.cpp:57
> +    if (!imageBuffer)

Ditto.

> Source/WebCore/platform/graphics/filters/SourceGraphic.cpp:56
> +    if (!resultImage || !sourceImage)

Ditto maybe?

> Source/WebCore/rendering/FilterEffectRenderer.cpp:432
> +    if (ImageBuffer* outputBuffer = filter->output()) {

I'm going to stop dittoing now.
Comment 3 Simon Fraser (smfr) 2015-10-13 17:48:49 PDT
I simulated failure in some of the FE* cases and got blank, not garbage pixels.
Comment 4 Simon Fraser (smfr) 2015-10-13 18:11:47 PDT
Created attachment 263046 [details]
Patch
Comment 5 Tim Horton 2015-10-13 18:38:57 PDT
Comment on attachment 263046 [details]
Patch

EWS is still not happy.
Comment 6 Simon Fraser (smfr) 2015-10-13 18:43:58 PDT
Created attachment 263050 [details]
Patch
Comment 7 Simon Fraser (smfr) 2015-10-13 20:07:57 PDT
Created attachment 263051 [details]
Patch
Comment 8 Simon Fraser (smfr) 2015-10-13 20:48:29 PDT
Created attachment 263053 [details]
Patch
Comment 9 Simon Fraser (smfr) 2015-10-14 08:43:12 PDT
Created attachment 263078 [details]
Patch
Comment 10 Simon Fraser (smfr) 2015-10-14 11:11:27 PDT
https://trac.webkit.org/r191049