Diff
Modified: trunk/Source/WebCore/ChangeLog (156509 => 156510)
--- trunk/Source/WebCore/ChangeLog 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/ChangeLog 2013-09-26 22:49:33 UTC (rev 156510)
@@ -1,3 +1,24 @@
+2013-09-26 Brent Fulgham <[email protected]>
+
+ [Windows] Unreviewed build fix after r156487.
+
+ Add explicit casting needed by MSVC to compile this code. Much
+ of this could probably be removed when we move to VS2012 or newer.
+
+ * bindings/js/JSEventListener.cpp:
+ (WebCore::JSEventListener::JSEventListener):
+ * bindings/js/JSEventListener.h:
+ (WebCore::JSEventListener::jsFunction):
+ * bridge/jsc/BridgeJSC.cpp:
+ (JSC::Bindings::Instance::createRuntimeObject):
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::platformApplyGeneric):
+ (WebCore::FEGaussianBlur::platformApply):
+ * platform/graphics/win/DIBPixelData.cpp:
+ (WebCore::DIBPixelData::DIBPixelData):
+ (WebCore::DIBPixelData::writeToFile):
+ * platform/graphics/win/DIBPixelData.h:
+
2013-09-26 Dean Jackson <[email protected]>
Expose a setting to disable hardware accelerated animations
Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (156509 => 156510)
--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp 2013-09-26 22:49:33 UTC (rev 156510)
@@ -47,7 +47,7 @@
{
if (wrapper) {
JSC::Heap::writeBarrier(wrapper, function);
- m_jsFunction = function;
+ m_jsFunction = JSC::Weak<JSC::JSObject>(function);
} else
ASSERT(!function);
#if ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/bindings/js/JSEventListener.h (156509 => 156510)
--- trunk/Source/WebCore/bindings/js/JSEventListener.h 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.h 2013-09-26 22:49:33 UTC (rev 156510)
@@ -85,7 +85,7 @@
if (!m_jsFunction) {
JSC::JSObject* function = initializeJSFunction(scriptExecutionContext);
JSC::Heap::writeBarrier(m_wrapper.get(), function);
- m_jsFunction = function;
+ m_jsFunction = JSC::Weak<JSC::JSObject>(function);
}
// Verify that we have a valid wrapper protecting our function from
Modified: trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp (156509 => 156510)
--- trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/bridge/jsc/BridgeJSC.cpp 2013-09-26 22:49:33 UTC (rev 156510)
@@ -82,7 +82,7 @@
JSLockHolder lock(exec);
RuntimeObject* newObject = newRuntimeObject(exec);
- m_runtimeObject = newObject;
+ m_runtimeObject = JSC::Weak<RuntimeObject>(newObject);
m_rootObject->addRuntimeObject(exec->vm(), newObject);
return newObject;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp (156509 => 156510)
--- trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2013-09-26 22:49:33 UTC (rev 156510)
@@ -163,6 +163,13 @@
Uint8ClampedArray* src = ""
Uint8ClampedArray* dst = tmpPixelArray;
+ void* dataOrig = src->data();
+ void* dataDone = dst->data();
+ size_t pixelCount = paintSize.height() * paintSize.width() * 4;
+ DIBPixelData original(paintSize, dataOrig, pixelCount, stride, 32);
+ if (0)
+ original.writeToFile(L"C:\\Public\\ImageTest\\original.bmp");
+
for (int i = 0; i < 3; ++i) {
if (kernelSizeX) {
kernelPosition(i, kernelSizeX, dxLeft, dxRight);
@@ -191,6 +198,10 @@
}
}
+ DIBPixelData blurred(paintSize, dataDone, pixelCount, stride, 32);
+ if (0)
+ blurred.writeToFile(L"C:\\Public\\ImageTest\\blurred.bmp");
+
// The final result should be stored in srcPixelArray.
if (dst == srcPixelArray) {
ASSERT(src->length() == dst->length());
@@ -212,6 +223,13 @@
int extraHeight = 3 * kernelSizeY * 0.5f;
int optimalThreadNumber = (paintSize.width() * paintSize.height()) / (s_minimalRectDimension + extraHeight * paintSize.width());
+ size_t pixelCount = paintSize.width() * paintSize.height() * 4;
+ void* dataOrig = srcPixelArray->data();
+ void* tmpOrig = tmpPixelArray->data();
+ DIBPixelData original(paintSize, dataOrig, pixelCount, scanline, 32);
+ if (0)
+ original.writeToFile(L"C:\\Public\\ImageTest\\original.bmp");
+
if (optimalThreadNumber > 1) {
WTF::ParallelJobs<PlatformApplyParameters> parallelJobs(&platformApplyWorker, optimalThreadNumber);
@@ -265,6 +283,12 @@
memcpy(srcPixelArray->data() + destinationOffset, params.srcPixelArray->data() + sourceOffset, size);
}
+
+ // Dump the bitmap to disk.
+ DIBPixelData blurred(paintSize, dataOrig, pixelCount, scanline, 32);
+ if (0)
+ blurred.writeToFile(L"C:\\Public\\ImageTest\\blurred.bmp");
+
return;
}
// Fallback to single threaded mode.
Modified: trunk/Source/WebCore/platform/graphics/win/DIBPixelData.cpp (156509 => 156510)
--- trunk/Source/WebCore/platform/graphics/win/DIBPixelData.cpp 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/platform/graphics/win/DIBPixelData.cpp 2013-09-26 22:49:33 UTC (rev 156510)
@@ -36,6 +36,15 @@
initialize(bitmap);
}
+DIBPixelData::DIBPixelData(IntSize size, void* data, size_t bufferLen, int bytesPerRow, int bytesPerPixel)
+{
+ m_bitmapBuffer = reinterpret_cast<UInt8*>(data);
+ m_bitmapBufferLength = bufferLen;
+ m_size = size;
+ m_bytesPerRow = bytesPerRow;
+ m_bitsPerPixel = bytesPerPixel;
+}
+
void DIBPixelData::initialize(HBITMAP bitmap)
{
BITMAP bmpInfo;
@@ -52,8 +61,20 @@
void DIBPixelData::writeToFile(LPCWSTR filePath)
{
HANDLE hFile = ::CreateFile(filePath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
- if (INVALID_HANDLE_VALUE == hFile)
+ if (INVALID_HANDLE_VALUE == hFile) {
+ DWORD error = ::GetLastError();
+
+ static const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
+ static const size_t bufSize = 4096;
+
+ wchar_t errorMessage[bufSize];
+ DWORD len = ::FormatMessageW(kFlags, 0, error, 0, errorMessage, bufSize, 0);
+ if (len >= bufSize)
+ len = bufSize - 1;
+
+ errorMessage[len + 1] = 0;
return;
+ }
BITMAPFILEHEADER header;
header.bfType = bitmapType;
Modified: trunk/Source/WebCore/platform/graphics/win/DIBPixelData.h (156509 => 156510)
--- trunk/Source/WebCore/platform/graphics/win/DIBPixelData.h 2013-09-26 22:47:16 UTC (rev 156509)
+++ trunk/Source/WebCore/platform/graphics/win/DIBPixelData.h 2013-09-26 22:49:33 UTC (rev 156510)
@@ -48,6 +48,7 @@
{
}
DIBPixelData(HBITMAP);
+ DIBPixelData(IntSize size, void* data, size_t bufferLen, int bytesPerRow, int bytesPerPixel);
void initialize(HBITMAP);