2010-12-02 Yuqiang Xian <yuqiang.xian@intel.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Dec 2010 10:40:07 +0000 (10:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Dec 2010 10:40:07 +0000 (10:40 +0000)
commit0972782640320fdbb685d5414f7cd61374b3fa1f
treef6ffd939f5fc0ffc9c5df956486bc58dece48c09
parent6c38d949c6aec4466b4e2419fec12a279f543ef0
2010-12-02  Yuqiang Xian  <yuqiang.xian@intel.com>

        Reviewed by Pavel Feldman.

        [V8] Speed up data property access for ImageData.
        https://bugs.webkit.org/show_bug.cgi?id=49999

        We create a normal V8 object which has a PixelArray as the backing storage,
        and set the "data" property of the ImageData object to it.
        This way "data" becomes a pure JS property and we don't need to call through
        the C++ bindings for ImageData "data" access.
        This eliminates big overhead in switching between JavaScript and native
        contexts and performing object bindings.

        No new tests. Relying on existing Canvas tests.

        * WebCore.gypi:
        * bindings/scripts/CodeGeneratorV8.pm:
        * bindings/v8/custom/V8CanvasPixelArrayCustom.cpp:
        (WebCore::toV8):
        * bindings/v8/custom/V8ImageDataCustom.cpp: Added.
        (WebCore::toV8):
        * html/ImageData.idl:
        * html/canvas/CanvasPixelArray.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.gypi
WebCore/bindings/scripts/CodeGeneratorV8.pm
WebCore/bindings/v8/custom/V8CanvasPixelArrayCustom.cpp
WebCore/bindings/v8/custom/V8ImageDataCustom.cpp [new file with mode: 0644]
WebCore/html/ImageData.idl
WebCore/html/canvas/CanvasPixelArray.idl