Diff
Modified: trunk/Source/WebCore/ChangeLog (137998 => 137999)
--- trunk/Source/WebCore/ChangeLog 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/ChangeLog 2012-12-18 09:56:09 UTC (rev 137999)
@@ -1,3 +1,25 @@
+2012-12-18 Tamas Czene <[email protected]>
+
+ Style fix to OpenCL SVG Filters
+ https://bugs.webkit.org/show_bug.cgi?id=105265
+
+ Reviewed by Zoltan Herczeg.
+
+ Inserted missing spaces and correct copyright text. There were no vital changes.
+
+ * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
+ (WebCore):
+ * platform/graphics/gpu/opencl/FilterContextOpenCL.h:
+ (FilterContextOpenCL):
+ * platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp:
+ (WebCore::FilterContextOpenCL::applyFEColorMatrix):
+ * platform/graphics/gpu/opencl/OpenCLFETurbulence.cpp:
+ (WebCore):
+ (WebCore::FilterContextOpenCL::compileFETurbulence):
+ (WebCore::FilterContextOpenCL::applyFETurbulence):
+ (WebCore::FETurbulence::platformApplyOpenCL):
+ * platform/graphics/gpu/opencl/OpenCLHandle.h:
+
2012-12-17 Andrey Adaikin <[email protected]>
Web Inspector: [WebGL] handle video elements used in WebGL
Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp (137998 => 137999)
--- trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.cpp 2012-12-18 09:56:09 UTC (rev 137999)
@@ -102,7 +102,7 @@
}
static const char* transformColorSpaceKernelProgram =
-PROGRAM_STR(
+PROGRAM(
const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
__kernel void transformColorSpace(__read_only image2d_t source, __write_only image2d_t destination, __constant float *clLookUpTable)
@@ -110,12 +110,12 @@
int2 sourceCoord = (int2) (get_global_id(0), get_global_id(1));
float4 pixel = read_imagef(source, sampler, sourceCoord);
- pixel = (float4)(clLookUpTable[(int)(round(pixel.x * 255))], clLookUpTable[(int)(round(pixel.y * 255))],
- clLookUpTable[(int)(round(pixel.z * 255))], pixel.w);
+ pixel = (float4) (clLookUpTable[(int)(round(pixel.x * 255))], clLookUpTable[(int)(round(pixel.y * 255))],
+ clLookUpTable[(int) (round(pixel.z * 255))], pixel.w);
write_imagef(destination, sourceCoord, pixel);
}
-);
+); // End of OpenCL kernels
void FilterContextOpenCL::openCLTransformColorSpace(OpenCLHandle& source, IntRect sourceSize, ColorSpace srcColorSpace, ColorSpace dstColorSpace)
{
Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.h (137998 => 137999)
--- trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.h 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/FilterContextOpenCL.h 2012-12-18 09:56:09 UTC (rev 137999)
@@ -73,9 +73,9 @@
inline bool compileFEColorMatrix();
inline bool compileFETurbulence();
- inline void applyFEColorMatrix(OpenCLHandle, IntSize, OpenCLHandle, IntPoint, void*, int);
+ inline void applyFEColorMatrix(OpenCLHandle, IntSize, OpenCLHandle, IntPoint, float*, int);
inline void applyFETurbulence(OpenCLHandle, IntSize, int, void*, void*, void*, void*, void*,
- void*, int, int, int, int, float, float, bool, int, int);
+ int*, int, int, int, int, float, float, bool, int, int);
private:
Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp (137998 => 137999)
--- trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp 2012-12-18 09:56:09 UTC (rev 137999)
@@ -90,7 +90,7 @@
return openclCompileSuccessful;
}
-inline void FilterContextOpenCL::applyFEColorMatrix(OpenCLHandle destination, IntSize destinationSize, OpenCLHandle source, IntPoint relativeSourceLocation, void* values, int type)
+inline void FilterContextOpenCL::applyFEColorMatrix(OpenCLHandle destination, IntSize destinationSize, OpenCLHandle source, IntPoint relativeSourceLocation, float* values, int type)
{
cl_kernel colorMatrix;
OpenCLHandle clValues;
Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFETurbulence.cpp (137998 => 137999)
--- trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFETurbulence.cpp 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFETurbulence.cpp 2012-12-18 09:56:09 UTC (rev 137999)
@@ -36,7 +36,7 @@
namespace WebCore {
static const char* turbulenceKernelProgram =
-PROGRAM_STR(
+PROGRAM(
__constant int s_perlinNoise = 4096;
__constant int s_blockSize = 256;
__constant int s_blockMask = 255;
@@ -165,7 +165,7 @@
write_imagef(destination, (int2)(get_global_id(0), get_global_id(1)), turbulenceFunctionResult);
}
-);
+); // End of OpenCL kernels
inline bool FilterContextOpenCL::compileFETurbulence()
{
@@ -181,25 +181,25 @@
return false;
m_turbulenceCompileStatus = openclCompileSuccessful;
- return openclCompileFailed;
+ return openclCompileSuccessful;
}
inline void FilterContextOpenCL::applyFETurbulence(OpenCLHandle destination,
- IntSize destinationSize, int blockSize,
+ IntSize destinationSize, int totalBlockSize,
void* transform, void* redComponent, void* greenComponent,
void* blueComponent, void* alphaComponent,
- void* latticeSelector, int offsetX, int offsetY, int tileWidth, int tileHeight,
+ int* latticeSelector, int offsetX, int offsetY, int tileWidth, int tileHeight,
float baseFrequencyX, float baseFrequencyY, bool stitchTiles, int numOctaves, int type)
{
RunKernel kernel(this, m_turbulenceOperation, destinationSize.width(), destinationSize.height());
kernel.addArgument(destination);
OpenCLHandle transformHandle(kernel.addArgument(transform, sizeof(float) * 6));
- OpenCLHandle redComponentHandle(kernel.addArgument(redComponent, sizeof(float) * (2 * blockSize + 2) * 2));
- OpenCLHandle greenComponentHandle(kernel.addArgument(greenComponent, sizeof(float) * (2 * blockSize + 2) * 2));
- OpenCLHandle blueComponentHandle(kernel.addArgument(blueComponent, sizeof(float) * (2 * blockSize + 2) * 2));
- OpenCLHandle alphaComponentHandle(kernel.addArgument(alphaComponent, sizeof(float) * (2 * blockSize + 2) * 2));
- OpenCLHandle latticeSelectorHandle(kernel.addArgument(latticeSelector, sizeof(int) * (2 * blockSize + 2)));
+ OpenCLHandle redComponentHandle(kernel.addArgument(redComponent, sizeof(float) * totalBlockSize * 2));
+ OpenCLHandle greenComponentHandle(kernel.addArgument(greenComponent, sizeof(float) * totalBlockSize * 2));
+ OpenCLHandle blueComponentHandle(kernel.addArgument(blueComponent, sizeof(float) * totalBlockSize * 2));
+ OpenCLHandle alphaComponentHandle(kernel.addArgument(alphaComponent, sizeof(float) * totalBlockSize * 2));
+ OpenCLHandle latticeSelectorHandle(kernel.addArgument(latticeSelector, sizeof(int) * totalBlockSize));
kernel.addArgument(offsetX);
kernel.addArgument(offsetY);
kernel.addArgument(tileWidth);
@@ -235,7 +235,7 @@
AffineTransform invertedTransform = reinterpret_cast<SVGFilter*>(filter())->absoluteTransform().inverse();
float transformComponents[6] = { invertedTransform.a(), invertedTransform.b(), invertedTransform.c(), invertedTransform.d(), invertedTransform.e(), invertedTransform.f() };
- context->applyFETurbulence(destination, absolutePaintRect().size(), s_blockSize, transformComponents, paintingData.gradient,
+ context->applyFETurbulence(destination, absolutePaintRect().size(), 2 * s_blockSize + 2, transformComponents, paintingData.gradient,
paintingData.gradient + 1, paintingData.gradient + 2, paintingData.gradient + 3, paintingData.latticeSelector,
absolutePaintRect().x(), absolutePaintRect().y(), paintingData.filterSize.width(), paintingData.filterSize.height(),
m_baseFrequencyX, m_baseFrequencyY, m_stitchTiles, m_numOctaves, m_type);
Modified: trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLHandle.h (137998 => 137999)
--- trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLHandle.h 2012-12-18 09:42:37 UTC (rev 137998)
+++ trunk/Source/WebCore/platform/graphics/gpu/opencl/OpenCLHandle.h 2012-12-18 09:56:09 UTC (rev 137999)
@@ -1,20 +1,28 @@
/*
+ * Copyright (C) 2012 University of Szeged
* Copyright (C) 2012 Tamas Czene <[email protected]>
+ * All rights reserved.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if ENABLE(OPENCL)