2013-03-03  Igor Oliveira  <igor.o@sisa.samsung.com>

        For our own sake, WebCL objects should create opencl objects internally.
        Issue #145

        This patch is the first attempt to fix WebCL objects creation.
        For now, WebCLPlatform objects can only be constructed by WebCore::getPlatforms.
        This change was done because WebCLPlatform was used in the wrong place and we
        are trying to avoid mistakes using that defensive approach.

        Reviewed by Antonio Gomes.

        * Modules/webcl/WebCL.cpp:
        (WebCore::WebCL::getPlatforms):
        (WebCore::WebCL::defaultProperties):
        (WebCore::WebCL::createContext):
        * Modules/webcl/WebCL.h:
        (WebCL):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::create):
        (WebCore::WebCLContext::WebCLContext):
        (WebCore::WebCLContext::getInfo):
        * Modules/webcl/WebCLContext.h:
        (WebCLContext):
        * Modules/webcl/WebCLContextProperties.cpp:
        (WebCore::WebCLContextProperties::platform):
        (WebCore):
        (WebCore::WebCLContextProperties::setPlatform):
        (WebCore::WebCLContextProperties::setDeviceType):
        (WebCore::WebCLContextProperties::setShareGroup):
        (WebCore::WebCLContextProperties::computeContextProperties):
        * Modules/webcl/WebCLContextProperties.h:
        (WebCLContextProperties):
        * Modules/webcl/WebCLDevice.cpp:
        (WebCore::WebCLDevice::getInfo):
        * Modules/webcl/WebCLPlatform.cpp:
        (WebCore::getPlatforms):
        (WebCore):
        * Modules/webcl/WebCLPlatform.h:
        (WebCLPlatform):
        (WebCore):
        * bindings/js/JSWebCLCustom.cpp:
        (WebCore::JSWebCL::createContext):

Conflicts:
	Source/WebCore/Modules/webcl/WebCL.h
2013-03-03  Igor Oliveira  <igor.o@sisa.samsung.com>

        WebCLContext does not need CCDeviceID as attribute
        Issue #156

        We should avoid to call platform objects every where in the WebCL code,
        specially because we already have the necessary information in the WebCL
        objects.

        Reviewed by Antonio Gomes.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::create):
        (WebCore::WebCLContext::WebCLContext):
        (WebCore::WebCLContext::createCommandQueue):
        * Modules/webcl/WebCLContext.h:
        (WebCLContext):
        * Modules/webcl/WebCLContextProperties.cpp:
        (WebCore::WebCLContextProperties::devices):
        * Modules/webcl/WebCLContextProperties.h:
        (WebCLContextProperties):
2013-03-02  Sharath Kamath  <kamath.sharath@gmail.com>

        Route WebCLProgram::build via ComputeContext.
        Issue #152

        Reviewed by Antonio.

        Route call to clBuildProgram opencl API via ComputeContext interface.

        No new tests.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::build):
        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::ComputeContext::buildProgram):
        (WebCore):
2013-03-04  Sharath Kamath  <kamath.sharath@gmail.com>

        Route WebCLContext::createUserEvent via ComputeContext.
        Issue #155

        Reviewed by Antonio.

        Route call to OpenCL clCreateUserEvent via CreateContext interface.

        No new tests.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createUserEvent):
        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::ComputeContext::createUserEvent):
        (WebCore):
2013-03-04  Sharath Kamath  <kamath.sharath@gmail.com>

        Code cleanup for WebCLKernelArgumentTypes interface.
        Issue #158

        Reviewed by Antonio.

        Code cleanup for files WebCLKernelArgumentTypes.idl/.cpp/.h.
        Removing commented code and make it WebKit compliant.

        No new tests.

        * Modules/webcl/WebCLKernelArgumentTypes.cpp:
        (WebCore):
        (WebCore::WebCLKernelArgumentTypes::create):
        (WebCore::WebCLKernelArgumentTypes::WebCLKernelArgumentTypes):
        (WebCore::WebCLKernelArgumentTypes::~WebCLKernelArgumentTypes):
        * Modules/webcl/WebCLKernelArgumentTypes.h:
        (WebCLKernelArgumentTypes):
        * Modules/webcl/WebCLKernelArgumentTypes.idl:
2013-03-05  Sharath Kamath  <kamath.sharath@gmail.com>

        Part 1 - WebCL API must throw meaning full Exceptions.
        Issue #123

        Reviewed by Antonio.

        Refactor WebCLCommandQueue.cpp.
        Check exceptions thrown and also add null checks when pointer
        are dereferenced.

        No new tests.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::getInfo):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferBase):
        (WebCore::WebCLCommandQueue::enqueueWriteBuffer):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferRect):
        (WebCore::WebCLCommandQueue::enqueueReadBuffer):
        (WebCore::WebCLCommandQueue::enqueueReadImage):
        (WebCore::WebCLCommandQueue::enqueueReadBufferRect):
        (WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
        (WebCore::WebCLCommandQueue::finish):
        (WebCore::WebCLCommandQueue::flush):
        (WebCore::WebCLCommandQueue::enqueueWriteImage):
        (WebCore::WebCLCommandQueue::enqueueAcquireGLObjects):
        (WebCore::WebCLCommandQueue::enqueueReleaseGLObjects):
        (WebCore::WebCLCommandQueue::enqueueCopyImage):
        (WebCore::WebCLCommandQueue::enqueueCopyImageToBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferToImage):
        (WebCore::WebCLCommandQueue::enqueueCopyBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferRect):
        (WebCore::WebCLCommandQueue::enqueueBarrier):
        (WebCore::WebCLCommandQueue::enqueueTask):
2013-03-05  Igor Oliveira  <igor.o@sisa.samsung.com>

        For our own sake, WebCL objects should create opencl objects internally.
        Issue #145

        WebCLCommandQueue is not a wrap anymore, all the opencl creation machinery is now
        done by WebCLCommandQueue::create.

        Reviewed by Antonio Gomes.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::create):
        (WebCore::WebCLCommandQueue::WebCLCommandQueue):
        (WebCore::WebCLCommandQueue::getInfo):
        * Modules/webcl/WebCLCommandQueue.h:
        (WebCLCommandQueue):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createCommandQueue):
        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::getInfo):
2013-03-06  Igor Oliveira  <igor.o@sisa.samsung.com>

        For our own sake, WebCL objects should create opencl objects internally.
        Issue #145

        Move WebCLProgram creation machinery from WebCLContext to WebCLProgram::create.
        Additionaly, fix WebCLProgram::getInfo method.

        Reviewed by Antonio Gomes.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createProgram):
        * Modules/webcl/WebCLKernel.cpp:
        (WebCore::WebCLKernel::getInfo):
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::create):
        (WebCore::WebCLProgram::WebCLProgram):
        (WebCore::WebCLProgram::getInfo):
        * Modules/webcl/WebCLProgram.h:
        (WebCLProgram):
2013-03-06  Igor Oliveira  <igor.o@sisa.samsung.com>

        WebCLType::create should not return CCerror
        Issue #151

        if WebCLBuffer::create fails, it returns should return a
        ExceptionCode instead of a CCerror.

        Reviewed by Antonio Gomes.

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::create):
        (WebCore::WebCLBuffer::createFromGLBuffer):
        * Modules/webcl/WebCLBuffer.h:
        (WebCLBuffer):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createBuffer):
        (WebCore::WebCLContext::createFromGLBuffer):
2013-03-07  Igor Oliveira  <igor.o@sisa.samsung.com>

        Unreviewed commit: Fix wrong ASSERT and logic in createCommandQueue

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createCommandQueue):
2013-03-04  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Fix ComputeContext::supportedImageFormats signature
        Issue #159

        Reviewed by NOBODY (OOPS!).

        1) Change the return to be a CCerror.
        2) Use a vector as an out paramenter, which would make it
        possible to also eliminate numberOfSupportedImageFormats parameter.

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::getSupportedImageFormats):
        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::ComputeContext::supportedImageFormats):
        (WebCore):