Title: [146613] trunk/Source/WebCore
Revision
146613
Author
[email protected]
Date
2013-03-22 08:04:10 -0700 (Fri, 22 Mar 2013)

Log Message

[Qt] Fix build with OPENCL 1.2
https://bugs.webkit.org/show_bug.cgi?id=113056

Reviewed by Kenneth Rohde Christiansen.

Switch qmake checks to the modern style which means we can enable OpenCL with
WEBKIT_CONFIG+=opencl.

Upgrade OpenCL 1.1 clCreateImage2D to OpenCL 1.2 clCreateImage calls.

* Target.pri:
* WebCore.pri:
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::createOpenCLImageResult):
* platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
(WebCore::FilterContextOpenCL::createOpenCLImage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146612 => 146613)


--- trunk/Source/WebCore/ChangeLog	2013-03-22 14:57:49 UTC (rev 146612)
+++ trunk/Source/WebCore/ChangeLog	2013-03-22 15:04:10 UTC (rev 146613)
@@ -1,3 +1,22 @@
+2013-03-22  Allan Sandfeld Jensen  <[email protected]>
+
+        [Qt] Fix build with OPENCL 1.2
+        https://bugs.webkit.org/show_bug.cgi?id=113056
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Switch qmake checks to the modern style which means we can enable OpenCL with
+        WEBKIT_CONFIG+=opencl. 
+
+        Upgrade OpenCL 1.1 clCreateImage2D to OpenCL 1.2 clCreateImage calls.
+
+        * Target.pri:
+        * WebCore.pri:
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::createOpenCLImageResult):
+        * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
+        (WebCore::FilterContextOpenCL::createOpenCLImage):
+
 2013-03-22  ChangSeok Oh  <[email protected]>
 
         [GTK][AC] Opacity animation doesn't work with clutter backend

Modified: trunk/Source/WebCore/Target.pri (146612 => 146613)


--- trunk/Source/WebCore/Target.pri	2013-03-22 14:57:49 UTC (rev 146612)
+++ trunk/Source/WebCore/Target.pri	2013-03-22 15:04:10 UTC (rev 146613)
@@ -4254,7 +4254,7 @@
     DEFINES += QT_OPENGL_SHIMS=1
 }
 
-contains(DEFINES, ENABLE_OPENCL=1) {
+enable?(opencl) {
     HEADERS += \
         platform/graphics/gpu/opencl/OpenCLHandle.h \
         platform/graphics/gpu/opencl/FilterContextOpenCL.h

Modified: trunk/Source/WebCore/WebCore.pri (146612 => 146613)


--- trunk/Source/WebCore/WebCore.pri	2013-03-22 14:57:49 UTC (rev 146612)
+++ trunk/Source/WebCore/WebCore.pri	2013-03-22 15:04:10 UTC (rev 146613)
@@ -273,6 +273,11 @@
 use?(libpng): LIBS += -lpng
 use?(webp): LIBS += -lwebp
 
+enable?(opencl) {
+    LIBS += -lOpenCL
+    INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gpu/opencl
+}
+
 mac {
     LIBS += -framework Carbon -framework AppKit -framework IOKit
 }
@@ -320,12 +325,6 @@
 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
 
-contains(DEFINES, ENABLE_OPENCL=1) {
-    LIBS += -lOpenCL
-
-    INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gpu/opencl
-}
-
 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
 
 !production_build:have?(FONTCONFIG): PKGCONFIG += fontconfig

Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (146612 => 146613)


--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp	2013-03-22 14:57:49 UTC (rev 146612)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp	2013-03-22 15:04:10 UTC (rev 146613)
@@ -474,8 +474,14 @@
     clImageFormat.image_channel_data_type = CL_UNORM_INT8;
 
     int errorCode = 0;
+#ifdef CL_API_SUFFIX__VERSION_1_2
+    cl_image_desc imageDescriptor = { CL_MEM_OBJECT_IMAGE2D, m_absolutePaintRect.width(), m_absolutePaintRect.height(), 0, 0, 0, 0, 0, 0, 0};
+    m_openCLImageResult = clCreateImage(context->deviceContext(), CL_MEM_READ_WRITE | (source ? CL_MEM_COPY_HOST_PTR : 0),
+        &clImageFormat, &imageDescriptor, source, &errorCode);
+#else
     m_openCLImageResult = clCreateImage2D(context->deviceContext(), CL_MEM_READ_WRITE | (source ? CL_MEM_COPY_HOST_PTR : 0),
         &clImageFormat, m_absolutePaintRect.width(), m_absolutePaintRect.height(), 0, source, &errorCode);
+#endif
     if (context->isFailed(errorCode))
         return 0;
 

Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp (146612 => 146613)


--- trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp	2013-03-22 14:57:49 UTC (rev 146612)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp	2013-03-22 15:04:10 UTC (rev 146613)
@@ -136,8 +136,13 @@
     clImageFormat.image_channel_order = CL_RGBA;
     clImageFormat.image_channel_data_type = CL_UNORM_INT8;
 
+#ifdef CL_API_SUFFIX__VERSION_1_2
+    cl_image_desc imageDescriptor = { CL_MEM_OBJECT_IMAGE2D, paintSize.width(), paintSize.height(), 0, 0, 0, 0, 0, 0, 0};
+    OpenCLHandle image = clCreateImage(context->deviceContext(), CL_MEM_READ_WRITE, &clImageFormat, &imageDescriptor, 0, 0);
+#else
     OpenCLHandle image = clCreateImage2D(context->deviceContext(), CL_MEM_READ_WRITE, &clImageFormat,
         paintSize.width(), paintSize.height(), 0, 0, 0);
+#endif
     return image;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to