2014-02-03  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Clean up the WebCLImage/WebCLImageDescriptor classes

        Reviewed by TrustMe.

        - Lots of code removal in WebCLImageDescriptor.
        - Changed the way parameters are passed for
        - WebCLImage creations.
        - Use const references where they apply.
        - Also fixed the debug build.

        No funcionality change. It is a preparation to fix
        bug issue #440 (crash on createImage2D).

        * Modules/webcl/WebCL.cpp:
        (WebCore::WebCL::waitForEvents):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createImage2DBase):
        * Modules/webcl/WebCLImage.cpp:
        (WebCore::WebCLImage::create):
        (WebCore::WebCLImage::WebCLImage):
        (WebCore::WebCLImage::getInfo):
        (WebCore::WebCLImage::imageFormat):
        * Modules/webcl/WebCLImage.h:
        * Modules/webcl/WebCLImageDescriptor.cpp:
        (WebCore::WebCLImageDescriptor::create):
        (WebCore::WebCLImageDescriptor::WebCLImageDescriptor):
        (WebCore::WebCLImageDescriptor::setChannelOrder):
        (WebCore::WebCLImageDescriptor::channelOrder):
        (WebCore::WebCLImageDescriptor::setChannelType):
        (WebCore::WebCLImageDescriptor::channelType):
        (WebCore::WebCLImageDescriptor::imageFormat):
        * Modules/webcl/WebCLImageDescriptor.h:
        (WebCore::WebCLImageDescriptor::create):
        * bindings/js/JSWebCLContextCustom.cpp:
        (WebCore::JSWebCLContext::createImage):
        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::ComputeContext::createImage2D):
2014-02-05  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        crash on createImage2D
        Issue #440

        Reviewed by TrustMe.

        Covered by the allocations' webcl app
        (translated from OpenCL by Anthony Liot).

        Clear use-after-free bug:

        void *data = 0;
        {
            data = ArrayBuffer::create(sizeInBytes, bytesPerElement)->data();
        }
        bleh(data); // 'data' has been free'd at this point already.

        Additionally, the way clImage gets allocated was wrong: it has to
        take width, height, channelOrder and channelType into account.

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::create):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createBufferBase):
        (WebCore::WebCLContext::createBuffer):
        (WebCore::WebCLContext::createImage2DBase):
        (WebCore::numberOfChannelsForChannelOrder):
        (WebCore::bytesPerChannelType):
        (WebCore::WebCLContext::createImage):
        * Modules/webcl/WebCLImage.cpp:
        (WebCore::WebCLImage::create):