2013-08-09  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        conformance/buffimgs/cl_buffer_createSubBuffer.html crashes Safari
        Issue #262

        Reviewed by Igor.

        Patch works around a bug in Apple's OpenCL drivers
        (tested on both Mac OSX 10.8.4/10.7.5, and GeForce 650 and
        AMD GPUs respectively), where creating a subbuffer from another
        subbuffer hangs the GPU. Instead, OpenCL should basically report back an
        error, which would be converted to a WebCL exception.
        I will report this OpenCL issue back to Apple directly.

        Keep track if the WebCLBuffer is either a "Buffer" or
        "SubBuffer" object at its creation. That allows us to throw
        an exception is a subbuffer is created from another subbuffer
        without relying on OpenCL doing this.

        It fixes buffimgs/cl_buffer_createSubBuffer.html

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::create):
        (WebCore::WebCLBuffer::WebCLBuffer):
        (WebCore::WebCLBuffer::createSubBuffer):
        * Modules/webcl/WebCLBuffer.h:
        * Modules/webcl/WebCLBuffer.idl:
        * Modules/webcl/WebCLMemoryObject.h: