2012-12-17  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        {WebCL,WebCLPlatform,WebCLDevice}::getSupportedExtensions implementations are wrong (Part I)
        Issue #20

        Reviewed by Igor.

        Patch does not address the implementation issues, but instead removes the current
        implementation, so that we do leave the current code opened to security holes.

        Related spec bug:
        WebCL::getSupportedExtensions should not expose supported system extension
        https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9764

        * Modules/webcl/WebCL.cpp:
        (WebCore::WebCL::getSupportedExtensions):
        * Modules/webcl/WebCLDevice.cpp:
        (WebCore::WebCLDevice::getSupportedExtensions):
        * Modules/webcl/WebCLPlatform.cpp:
        (WebCore::WebCLPlatform::getDevices):
        (WebCore::WebCLPlatform::getSupportedExtensions):
2012-12-18  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Properly implement WebCLCommandQueue::enqueueBarrier with OpenCL1.1
        Issue #27

        Reviewed by Igor.

        In OpenCL 1.1, we can either block a command_queue execution
        until all its events have been finished (by calling clEnqueueBarrier),
        or until a given list of event has been finished (by calling
        clEnqueueWaitForEvents). The combination of both get us closer
        to the funcionality needed for WebCLCommandQueue::enqueueBarrier.

        NOTE: With OpenCL 1.2, clEnqueueBarrierWithWaitEvents has made
        WebCLCommandQueue::enqueueBarrier trival.

        * platform/ComputeContext.cpp:
        (WebCore::ComputeContext::enqueueBarrier):
2012-12-19  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Unreviewed code clean up to WebCLCommandQueue::enqueueNDRangeKernel variable names.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
2012-12-19  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Route WebCLCommandQueue::finish and ::flush through ComputeContext
        Issue #29

        Reviewed by Igor.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::finish):
        (WebCore::WebCLCommandQueue::flush):
        * platform/ComputeContext.cpp:
        (WebCore::ComputeContext::finishCommandQueue):
        (WebCore):
        (WebCore::ComputeContext::flushCommandQueue):
        * platform/ComputeContext.h:
2012-12-21  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Add a way to make error out-parameters/return values more explicit in ComputeContext APIs
        Issue #32

        Reviewed by Igor.

        Right now most methods return a CCint (which maps to cl_int),
        representing an error. Patch introduces a "typedef int CCError"
        in ComputeContextTypes.h and uses it to represent a ComputeContext's error,
        return types, etc. This makes the code clearer in terms of what
        methods return, and what a out-parameter is there for.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::~WebCLCommandQueue):
        (WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
        (WebCore::WebCLCommandQueue::finish):
        (WebCore::WebCLCommandQueue::flush):
        (WebCore::WebCLCommandQueue::enqueueBarrier):
        (WebCore::WebCLCommandQueue::enqueueMarker):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::create):
        (WebCore::WebCLContext::WebCLContext):
        (WebCore::WebCLContext::createCommandQueue):
        (WebCore::WebCLContext::createProgram):
        (WebCore::WebCLContext::createBuffer):
        (WebCore::WebCLContext::createImage2DBaseMemory):
        (WebCore::WebCLContext::createImage2DBaseImage):
        (WebCore::WebCLContext::createFromGLBuffer):
        (WebCore::WebCLContext::createFromGLRenderBuffer):
        (WebCore::WebCLContext::createSampler):
        (WebCore::WebCLContext::createFromGLTexture2D):
        (WebCore::WebCLContext::getSupportedImageFormats):
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::createKernel):
        * platform/ComputeContext.cpp:
        (WebCore::ComputeContext::ComputeContext):
        (WebCore::ComputeContext::create):
        (WebCore):
        (WebCore::ComputeContext::createCommandQueue):
        (WebCore::ComputeContext::createProgram):
        (WebCore::ComputeContext::createBuffer):
        (WebCore::ComputeContext::createImage2D):
        (WebCore::ComputeContext::createFromGLBuffer):
        (WebCore::ComputeContext::createFromGLRenderbuffer):
        (WebCore::computeFilterModeToCL):
        (WebCore::ComputeContext::createSampler):
        (WebCore::ComputeContext::createFromGLTexture2D):
        (WebCore::ComputeContext::supportedImageFormats):
        (WebCore::ComputeContext::enqueueNDRangeKernel):
        (WebCore::ComputeContext::enqueueBarrier):
        (WebCore::ComputeContext::enqueueMarker):
        (WebCore::ComputeContext::releaseCommandQueue):
        (WebCore::ComputeContext::finishCommandQueue):
        (WebCore::ComputeContext::flushCommandQueue):
        (WebCore::ComputeContext::createKernel):
        * platform/ComputeContext.h:
        (ComputeContext):
        * platform/ComputeTypes.h:
2012-12-21 Antonio Gomes <a1.gomes@sisa.samsung.com>

        Clean up error handling in WebCLProgram class
        Issue #33

        Reviewed by Igor.

        Make use of the existing WebCLException::computeContextErrorToExceptionCode
        in order to handle error from clXXX cals throughout WebCLProgram class.

        Lots of code duplication removal, no funcionality change.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::getInfo):
        (WebCore::WebCLProgram::getBuildInfo):
        (WebCore::WebCLProgram::createKernel):
        (WebCore::WebCLProgram::createKernelsInProgram):
        (WebCore::WebCLProgram::buildProgram):
        (WebCore::WebCLProgram::build):
2012-12-21  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        WebCLContext: Exception code can not get assigned from clXXX calls' error code
        Issue #34

        Reviewed by Igor.

        There is static method called computeContextErrorToExceptionCode
        of WebCLException that can be used to fix this.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createCommandQueue):
        (WebCore::WebCLContext::createProgram):
        (WebCore::WebCLContext::createBuffer):
        (WebCore::WebCLContext::createFromGLBuffer):
        (WebCore::WebCLContext::createFromGLRenderBuffer):
        (WebCore::WebCLContext::createSampler):
        (WebCore::WebCLContext::createFromGLTexture2D):
        (WebCore::WebCLContext::getSupportedImageFormats):
2012-12-21  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        WebCLProgram.cpp: Fixed WebKit style issues.
        Unreviewed.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::~WebCLProgram):
        (WebCore::WebCLProgram::create):
        (WebCore::WebCLProgram::getInfo):
        (WebCore::WebCLProgram::getBuildInfo):
        (WebCore::WebCLProgram::createKernel):
        (WebCore::WebCLProgram::createKernelsInProgram):
        (WebCore::WebCLProgram::buildProgram):
        (WebCore::WebCLProgram::finishCallBack):
        (WebCore::WebCLProgram::build):
        (WebCore):
        (WebCore::WebCLProgram::setDevice):
        (WebCore::WebCLProgram::getCLProgram):
2012-12-18  Sharath Kamath  <kamath.sharath@gmail.com>

    WebCL class cleanup and style changes

    Examples:
    Replacing the createSharedContext API with createContext.
    Issue #21

    Reviewed by Antonio .

    * WebCL/Nbody/SimCL.js: Style changes.
    (getKernel): Style changes.
    (InitCL): createSharedContext fix.
    (SimulateCL): Style changes.
    (GetWorkGroupSize): Style changes.

    Source/WebCore:

    WebCL class cleanup.
    Issue #21

    Reviewed by Antonio.

    Code cleanup as per the specification for WebCL,
    Style changes as per the webkit styling guidelines.

    No new tests.

    * Modules/webcl/WebCL.cpp:
    (WebCore::WebCL::WebCL):
    (WebCore::WebCL::create):
    (WebCore::WebCL::getPlatforms):
    (WebCore::WebCL::getImageInfo):
    (WebCore::WebCL::waitForEvents):
    (WebCore::WebCL::createContext):
    (WebCore::WebCL::getSupportedExtensions):
    (WebCore::WebCL::setCLDeviceID):
    (WebCore):
    (WebCore::WebCL::getCLDeviceID):
    * Modules/webcl/WebCL.h:
    (WebCore):
    (WebCore::WebCL::createContext):
    (WebCL):
    * Modules/webcl/WebCL.idl:
    * Modules/webcl/WebCLContext.cpp:
    (WebCore::WebCLContext::createCommandQueue):
    * Modules/webcl/WebCLDevice.cpp:
    (WebCore::WebCLDevice::getInfo):
    * Modules/webcl/WebCLKernel.cpp:
    (WebCore::WebCLKernel::setArg):
    * bindings/js/JSWebCLCustom.cpp:
    (WebCore::JSWebCL::getImageInfo):
    (WebCore::JSWebCL::createContext):
    (WebCore::JSWebCLConstructor::constructJSWebCL):
2012-12-20  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLContext class cleanup.
        Issue #23

        Reviewed by Antonio.

        Style changes as per webkit standards.

        No new tests.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::~WebCLContext):
        (WebCore):
        (WebCore::WebCLContext::create): Style changes
        (WebCore::WebCLContext::WebCLContext): Style changes
        (WebCore::WebCLContext::getInfo): Style changes
        (WebCore::WebCLContext::createCommandQueue): Style changes
        (WebCore::WebCLContext::createProgram): Style changes
        (WebCore::WebCLContext::createBuffer): Style changes & validation for flags.
        (WebCore::WebCLContext::createImage2DBaseMemory): Style changes
        (WebCore::WebCLContext::createImage2DBaseImage): Style changes
        (WebCore::WebCLContext::createImage): Style changes & change in error handling.
        (WebCore::WebCLContext::createImageWithDescriptor): Style changes & change in error handling.
        (WebCore::WebCLContext::createFromGLBuffer): Style changes
        (WebCore::WebCLContext::createFromGLRenderBuffer): Style changes
        (WebCore::WebCLContext::createSampler): Style changes
        (WebCore::WebCLContext::createFromGLTexture2D): Style changes
        (WebCore::WebCLContext::createUserEvent): Style changes.
        (WebCore::WebCLContext::videoFrameToImage): Style changes.
        (WebCore::WebCLContext::LRUImageBufferCache::imageBuffer): Style changes.
        (WebCore::WebCLContext::LRUImageBufferCache::bubbleToFront): Style changes.
        (WebCore::WebCLContext::getSupportedImageFormats): Style changes & validation for flags and image Type.
        (WebCore::WebCLContext::createImage2D): Style changes & change in error handling.
        * Modules/webcl/WebCLContext.h: Style changes.
        (WebCore):
        (WebCLContext):
        (WebCore::WebCLContext::createBuffer):
        (WebCore::WebCLContext::createCommandQueue):
        (WebCore::WebCLContext::createImageWithDescriptor):
        (LRUImageBufferCache):
        * Modules/webcl/WebCLContext.idl: Style changes.
        * bindings/js/JSWebCLContextCustom.cpp:
        (WebCore):
        (WebCore::JSWebCLContext::getInfo):
        (WebCore::JSWebCLContext::createImageWithDescriptor):