Title: [140444] branches/chromium/1364
- Revision
- 140444
- Author
- senorbla...@chromium.org
- Date
- 2013-01-22 11:24:50 -0800 (Tue, 22 Jan 2013)
Log Message
Merge 140057
> imageSmoothingEnabled frequent, unpredictable crashes
> https://bugs.webkit.org/show_bug.cgi?id=107161
>
> Patch by Alexis Hetu <su...@chromium.org> on 2013-01-17
> Reviewed by Stephen White.
>
> Source/WebCore:
>
> Added a NULL pointer check to fix a crash.
>
> Test: fast/canvas/canvas-imageSmoothingEnabled-zero-size.html
>
> * html/canvas/CanvasRenderingContext2D.cpp:
> (WebCore::CanvasRenderingContext2D::setWebkitImageSmoothingEnabled):
>
> LayoutTests:
>
> Added a layout test for setting image smoothing enabled on a 0 sized
> canvas.
>
> * fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt: Added.
> * fast/canvas/canvas-imageSmoothingEnabled-zero-size.html: Added.
TBR=commit-qu...@webkit.org
Review URL: https://codereview.chromium.org/12039021
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt (from rev 140057, trunk/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt) (0 => 140444)
--- branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt (rev 0)
+++ branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size-expected.txt 2013-01-22 19:24:50 UTC (rev 140444)
@@ -0,0 +1 @@
+This test passes by not crashing !
Copied: branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size.html (from rev 140057, trunk/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size.html) (0 => 140444)
--- branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size.html (rev 0)
+++ branches/chromium/1364/LayoutTests/fast/canvas/canvas-imageSmoothingEnabled-zero-size.html 2013-01-22 19:24:50 UTC (rev 140444)
@@ -0,0 +1,20 @@
+
+<!doctype html>
+<html>
+ <body>
+ This test passes by not crashing !
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ }
+ window._onload_ = function () {
+ var canvas = document.createElement('canvas');
+ canvas.width = 0;
+ canvas.height = 0;
+ var context = canvas.getContext('2d');
+ if(context.webkitImageSmoothingEnabled) {context.webkitImageSmoothingEnabled = false;}
+ };
+ </script>
+ </body>
+</html>
+
Modified: branches/chromium/1364/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (140443 => 140444)
--- branches/chromium/1364/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2013-01-22 19:15:38 UTC (rev 140443)
+++ branches/chromium/1364/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2013-01-22 19:24:50 UTC (rev 140444)
@@ -2402,7 +2402,9 @@
realizeSaves();
modifiableState().m_imageSmoothingEnabled = enabled;
- drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone);
+ GraphicsContext* c = drawingContext();
+ if (c)
+ c->setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone);
}
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes