Bug 17486: Support HTML5 Canvas.getImageData API
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Feb 2008 01:16:16 +0000 (01:16 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Feb 2008 01:16:16 +0000 (01:16 +0000)
commit2d28578a7dc8ad607295593783ec0298478f04d4
treee266fa2c81083f4252dbdc3bd3eeab9c0a3b35da
parentf6fe0a7bba1ceb21b7f64b15ab2cd31a36fb82b2
Bug 17486: Support HTML5 Canvas.getImageData API
Support Canvas.getImageData and Canvas.createImageData

Reviewed by Sam W.

This patch adds support for all the pixel reading portions
of the HTML5 Canvas spec.  There are two new types ImageData
and CanvasPixelArray which are used to provide the HTML5
ImageData object, and the required semantics for assignment
to the ImageData data array.

We only implement the CG version of ImageBuffer::getImageData,
but the logic is null safe, so this will not introduce any
crashes into other platforms, unfortunately it will result in
JS Object detection "lying" on non-CG platforms.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/canvas-ImageData-behaviour-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-ImageData-behaviour.html [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-ImageData-behaviour.js [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-getImageData-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-getImageData.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/GNUmakefile.am
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSCanvasPixelArrayCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
WebCore/bindings/scripts/CodeGeneratorJS.pm
WebCore/html/CanvasPixelArray.cpp [new file with mode: 0644]
WebCore/html/CanvasPixelArray.h [new file with mode: 0644]
WebCore/html/CanvasPixelArray.idl [new file with mode: 0644]
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/html/CanvasRenderingContext2D.h
WebCore/html/CanvasRenderingContext2D.idl
WebCore/html/HTMLCanvasElement.cpp
WebCore/html/HTMLCanvasElement.h
WebCore/html/ImageData.cpp [new file with mode: 0644]
WebCore/html/ImageData.h [new file with mode: 0644]
WebCore/html/ImageData.idl [new file with mode: 0644]
WebCore/platform/graphics/ImageBuffer.h
WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
WebCore/platform/graphics/cg/ImageBufferCG.cpp
WebCore/platform/graphics/qt/ImageBufferQt.cpp
WebCore/platform/graphics/wx/ImageBufferWx.cpp