2013-01-31  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLCommandQueue check pointers to avoid bad memory access.
        Issue #98

        Reviewed by NOBODY (OOPS!).

        Error can be thrown by WebCL or a null passed to OpenCL.
        If OpenCL needs a non-null value it will throw a exception which will
        be handled by WebCL.

        No new tests (OOPS!).

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::enqueueWriteBuffer):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferRect):
        (WebCore::WebCLCommandQueue::enqueueReadImage):
        (WebCore::WebCLCommandQueue::enqueueReadBuffer):
        (WebCore::WebCLCommandQueue::enqueueReadBufferRect):
        (WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
        (WebCore::WebCLCommandQueue::enqueueWriteImage):
        (WebCore::WebCLCommandQueue::enqueueCopyImage):
        (WebCore::WebCLCommandQueue::enqueueCopyImageToBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferToImage):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferRect):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createImageWithDescriptor):
2013-02-01  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLEvent interface cleanup.
        Issue #103

        Reviewed by NOBODY (OOPS!).

        Fix webkit style issues and cleanup WebCLEvent interface files.

        No new tests (OOPS!).

        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::createUserEvent):uncomment the code since it will work after WebCLEvent cleanup.
        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::~WebCLEvent):
        (WebCore::WebCLEvent::create):
        (WebCore::WebCLEvent::WebCLEvent):
        (WebCore::WebCLEvent::getInfo):
        (WebCore::WebCLEvent::getProfilingInfo):
        (WebCore::WebCLEvent::setUserEventStatus):
        (WebCore):
        (WebCore::WebCLEvent::setCallback):
        (WebCore::WebCLEvent::getCLEvent):
        * Modules/webcl/WebCLEvent.h:
        (WebCLEvent):
        * Modules/webcl/WebCLEvent.idl:
        * bindings/js/JSWebCLEventCustom.cpp:
        (WebCore::createFinishCallback):
        (WebCore::JSWebCLEvent::getInfo):
        (WebCore::JSWebCLEvent::getProfilingInfo):
        (WebCore::JSWebCLEvent::setCallback):
        * platform/ComputeTypes.h:
2013-02-01  Sharath Kamath  <kamath.sharath@gmail.com>

        ComputeContextCL::computeMemoryTypeToCL doesnt handle HOST_PTR flags.
        Issue #104

        Reviewed by none.

        Need to add support to CL_MEM_USE_HOST_PTR, CL_MEM_ALLOC_HOST_PTR, CL_MEM_COPY_HOST_PTR flags.
        Gives a INVALID_HOST_POINTER with createImage API when a Image element is passes as i/p.

        No new tests.

        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::computeMemoryTypeToCL):
        (WebCore):
2013-02-01  Sharath Kamath  <kamath.sharath@gmail.com>

        createSubBuffer() API crashes the safari browser.
        Issue #105

        Reviewed by NOBODY (OOPS!).

        On running the conformance test case to getInfo on MEM_ASSOCIATED_MEMOBJECT flag , the browser crashes.
        The stack reports crash in ~WebCLMemoryObject.
        Need to investigate the way the desctructor is called for a sub buffer as a subbuffer
        is also WebCLMemoryObject. And it depends on the cl_mem of the WebCLMemoryObject on using which it was created.

        The subbuffer will have a reference count heigher than 1. Thus can check it before calling clRelease.

        No new tests.

        * Modules/webcl/WebCLMemoryObject.cpp:
        (WebCore::WebCLMemoryObject::~WebCLMemoryObject):
2013-02-04  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLMemoryObject::getInfo must also support all associated flags.
        Issue #83

        Reviewed by Antonio.

        The flags MEM_FLAGS ,MEM_ASSOCIATED_MEMOBJECT, MEM_OFFSET needs to be supported and
        the suport for CL_MEM_HOST_PTR and CL_MEM_MAP_COUNT must be revocked as per specification.

        Also add suport for WebCLMemoryObject to WebCLGetInfo class.

        No new tests.

        * Modules/webcl/WebCLGetInfo.cpp:
        (WebCore::WebCLGetInfo::WebCLGetInfo):
        (WebCore):
        (WebCore::WebCLGetInfo::getWebCLMemoryObject):
        * Modules/webcl/WebCLGetInfo.h:
        (WebCore):
        * Modules/webcl/WebCLMemoryObject.cpp:
        (WebCore::WebCLMemoryObject::getInfo):
        * bindings/js/JSWebCLCustom.h:
        (WebCore::toJS):
        * platform/ComputeTypes.h:
2013-02-04  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLImage::getInfo needs to get the right informantion from OpenCL and return a valid object.
        Issue #106

        Reviewed by NOBODY (OOPS!).

        Current implementation returns CL_IMAGE_FORMAT as channelOrder and CL_IMAGE_ELEMENT_SIZE as channelType.
        According to OpenCL specification CL_IMAGE_FORMAT will return a structure cl_image_format , consisting both channelOrder and channelType.
        Implimenting it to take this value and populate width, height and row_pitch into WebCLIImageDescriptor object.

        No new tests (OOPS!).

        * Modules/webcl/WebCLImage.cpp:
        (WebCore::WebCLImage::getInfo):
2013-02-04  Sharath Kamath  <kamath.sharath@gmail.com>

        WebCLDevice::getInfo needs to support all flags mentioned in spec.
        Issue #107

        Reviewed by Antonio & Igor.

        Add support for DEVICE_VERSION getInfo.
        Implimentation for DEVICE_MAX_WORK_ITEM_SIZES case to avoid exceptions.
        Remove DEVICE_DOUBLE_FP_CONFIG and DEVICE_HALF_FP_CONFIG as they are invisible in
        webcl as per specification.
        Also replace fetch all the OpenCL constants (like DEVICE_VERSION) from WebCL.idl
        & WebCL.h.

        No new tests.

        * Modules/webcl/WebCL.h: Add DEVICE_VERSION and DEVICE_MAX_WORK_ITEM_SIZES constants.
        * Modules/webcl/WebCL.idl:  Add DEVICE_VERSION and DEVICE_MAX_WORK_ITEM_SIZES constants.
        * Modules/webcl/WebCLDevice.cpp:
        (WebCore::WebCLDevice::getInfo): Add DEVICE_VERSION and impliment DEVICE_MAX_WORK_ITEM_SIZES in proper way.
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::computeDeviceInfoTypeToCL): Add DEVICE_MAX_WORK_ITEM_SIZES and DEVICE_VERSION to computeDeviceInfoTypeToCL.
2013-02-04  Sharath Kamath  <kamath.sharath@gmail.com>

        Remove PROGRAM_BINARY_SIZES & PROGRAM_BINARIES  support from getInfo API.
        Issue #108

        Reviewed by NOBODY (OOPS!).

        Currently getInfo supports PROGRAM_NUM_DEVICES ,PROGRAM_SOURCE, PROGRAM_CONTEXT,
        PROGRAM_DEVICES, PROGRAM_BINARY_SIZES and PROGRAM_BINARIES flags.
        The flags PROGRAM_BINARIES and PROGRAM_BINARY_SIZES are not supported as per specification.

        https://cvs.khronos.org/svn/repos/registry/trunk/public/webcl/spec/latest/index.html#2.11

        No new tests (OOPS!).

        * Modules/webcl/WebCL.h:
        * Modules/webcl/WebCL.idl:
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::getInfo): Also add a proper error for default case.
        * platform/ComputeContext.h:
        * platform/opencl/ComputeContextCL.cpp: Remove PROGRAM_BINARY_SIZES & PROGRAM_BINARIES.
        (WebCore::computeProgramInfoTypeToCL):