2013-12-07  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Revert: Replace isReleased by holdsValidPlatformObject
        Issue #364

        Reviewed by Igor.

        We still need both concepts: isReleased and validPlatformObject.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::enqueueWriteBufferBase):
        (WebCore::WebCLCommandQueue::ccEventFromWebCLEvent):
        (WebCore::WebCLCommandQueue::enqueueMarker):
        * Modules/webcl/WebCLObject.h:
        (WebCore::WebCLObjectImpl::isReleased):
        (WebCore::WebCLObjectImpl::release):
        (WebCore::WebCLObjectImpl::releasePlatformObject):
        (WebCore::WebCLObjectImpl::isPlatformObjectNeutralized):
        (WebCore::WebCLObjectImpl::WebCLObjectImpl):
2013-12-07  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Introduces isPlatformObjectNeutralized
        Issue #364

        Reviewed by Igor.

        WebCLObject::platformObject is not the best method to check
        against in order to "validate" a WebCL object.
        Reason: WebCLEvent object can be a "valid" object that momentarely
        do not hold a valid CL platform object.
        Due to that, we now check if an object has been "neutralized" by
        an explict "release" call.

        Note that
        - WebCLPlatform and WebCLDevice classes override the release related
        methods, given that they can not be released.
        - WebCLEvent also overrides isPlatformObjectNeutralized, given its peculiar behavior
        (mentioned above).
        - WebCLInputChecker::validateWebCLObject was also updated to use isPlatformObjectNeutralized.

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::createSubBuffer):
        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::getInfo):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferBase):
        (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::enqueueCopyImage):
        (WebCore::WebCLCommandQueue::enqueueCopyImageToBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferToImage):
        (WebCore::WebCLCommandQueue::enqueueCopyBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferRect):
        (WebCore::WebCLCommandQueue::enqueueBarrier):
        (WebCore::WebCLCommandQueue::enqueueMarker):
        (WebCore::WebCLCommandQueue::enqueueAcquireGLObjects):
        (WebCore::WebCLCommandQueue::enqueueReleaseGLObjects):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::getInfo):
        (WebCore::WebCLContext::createCommandQueue):
        (WebCore::WebCLContext::createProgram):
        (WebCore::WebCLContext::createBufferBase):
        (WebCore::WebCLContext::createImage2DBase):
        (WebCore::WebCLContext::createSampler):
        (WebCore::WebCLContext::createUserEvent):
        (WebCore::WebCLContext::getSupportedImageFormats):
        (WebCore::WebCLContext::releaseAll):
        (WebCore::WebCLContext::createFromGLBuffer):
        (WebCore::WebCLContext::createFromGLRenderbuffer):
        (WebCore::WebCLContext::createFromGLTexture):
        * Modules/webcl/WebCLDevice.cpp:
        (WebCore::WebCLDevice::getInfo):
        * Modules/webcl/WebCLDevice.h:
        (WebCore::WebCLDevice::isPlatformObjectNeutralized):
        (WebCore::WebCLDevice::isReleased):
        (WebCore::WebCLDevice::release):
        (WebCore::WebCLDevice::releasePlatformObject):
        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::getInfo):
        (WebCore::WebCLEvent::getProfilingInfo):
        (WebCore::WebCLEvent::isPlatformObjectNeutralized):
        * Modules/webcl/WebCLEvent.h:
        * Modules/webcl/WebCLImage.cpp:
        (WebCore::WebCLImage::getGLTextureInfo):
        (WebCore::WebCLImage::getInfo):
        * Modules/webcl/WebCLKernel.cpp:
        (WebCore::WebCLKernel::getInfo):
        (WebCore::WebCLKernel::getWorkGroupInfo):
        (WebCore::WebCLKernel::setArg):
        * Modules/webcl/WebCLKernel.idl:
        * Modules/webcl/WebCLMemoryObject.cpp:
        (WebCore::WebCLMemoryObject::getInfo):
        (WebCore::WebCLMemoryObject::getGLObjectInfo):
        * Modules/webcl/WebCLObject.h:
        (WebCore::WebCLObjectImpl::isPlatformObjectNeutralized):
        * Modules/webcl/WebCLPlatform.cpp:
        (WebCore::WebCLPlatform::getInfo):
        (WebCore::WebCLPlatform::getDevices):
        * Modules/webcl/WebCLPlatform.h:
        (WebCore::WebCLPlatform::isPlatformObjectNeutralized):
        (WebCore::WebCLPlatform::isReleased):
        (WebCore::WebCLPlatform::release):
        (WebCore::WebCLPlatform::releasePlatformObject):
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::getInfo):
        (WebCore::WebCLProgram::getBuildInfo):
        (WebCore::WebCLProgram::createKernel):
        (WebCore::WebCLProgram::createKernelsInProgram):
        (WebCore::WebCLProgram::callbackProxy):
        (WebCore::WebCLProgram::build):
        * Modules/webcl/WebCLSampler.cpp:
        (WebCore::WebCLSampler::getInfo):
        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::setUserEventStatus):
2013-12-09  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Remove implicit -cl-std1.1 addition to build options
        Issue #368

        Reviewed by Igor.

        On some OpenCL platforms/drives for Linux, implicitly
        specifying -cl-std=CL1.1 as a program build argument does not work.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::build):
2013-12-09  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Assert reached on basicoperations/cl_program_build.html and functionalityTesting/buildCallback.html
        Issue #369

        Reviewed by Igor.

        WebCLProgram instances were getting added to 's_thisPointers' vector
        starting from index 1, instead of 0.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::callbackProxy):
        (WebCore::WebCLProgram::build):
2013-12-09  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Properly use WeakPtrFactory in WebCLProgram
        Issue #370

        Reviewed by Igor.

        By making WeakPtrFactory a WebCLProgram class member,
        it goes out of scope together with the class, and null-out
        the WebCLProgram weak ptr properly.

        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::build):