summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-12 09:21:36 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-12 09:21:36 (GMT)
commit61f454dd144590025d9001b669b102528782bfeb (patch)
tree99f34395836f298ac70738ce652dec4e6d30d445 /src/3rdparty
parentd5315a79b86df6350ed9ed2c90074e8fdae8ab4d (diff)
parentb3b2bc3f190d80e30b968648dd91048df67b8a50 (diff)
downloadQt-61f454dd144590025d9001b669b102528782bfeb.zip
Qt-61f454dd144590025d9001b669b102528782bfeb.tar.gz
Qt-61f454dd144590025d9001b669b102528782bfeb.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qtscript-jsc-backend
Conflicts: configure src/script/qscriptarray_p.h src/script/qscriptasm.cpp src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata.cpp src/script/qscriptclassdata_p.h src/script/qscriptclassinfo_p.h src/script/qscriptclasspropertyiterator_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptcontextinfo_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmaboolean_p.h src/script/qscriptecmacore.cpp src/script/qscriptecmacore_p.h src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptengineagent_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptextvariant_p.h src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptglobals_p.h src/script/qscriptmember_p.h src/script/qscriptnameid_p.h src/script/qscriptnodepool_p.h src/script/qscriptobject_p.h src/script/qscriptobjectfwd_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptsyntaxcheckresult_p.h src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvaluefwd_p.h src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptvalueiteratorimpl_p.h
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp62
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.h4
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp17
-rw-r--r--src/3rdparty/phonon/phonon/mediasource.cpp8
-rw-r--r--src/3rdparty/sha1/sha1.cpp2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp31
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/UString.h3
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro17
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm50
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp2
11 files changed, 198 insertions, 44 deletions
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp
index 10782c2..de2078a 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.cpp
+++ b/src/3rdparty/phonon/ds9/mediaobject.cpp
@@ -57,24 +57,6 @@ namespace Phonon
{
}
- WorkerThread::Work WorkerThread::dequeueWork()
- {
- QMutexLocker locker(&m_mutex);
- if (m_finished) {
- return Work();
- }
- Work ret = m_queue.dequeue();
-
- //we ensure to have the wait condition in the right state
- if (m_queue.isEmpty()) {
- m_waitCondition.reset();
- } else {
- m_waitCondition.set();
- }
-
- return ret;
- }
-
void WorkerThread::run()
{
while (m_finished == false) {
@@ -88,11 +70,6 @@ namespace Phonon
}
DWORD result = ::WaitForMultipleObjects(count, handles, FALSE, INFINITE);
if (result == WAIT_OBJECT_0) {
- if (m_finished) {
- //that's the end of the thread execution
- return;
- }
-
handleTask();
} else {
//this is the event management
@@ -199,22 +176,28 @@ namespace Phonon
void WorkerThread::handleTask()
{
- const Work w = dequeueWork();
-
- if (m_finished) {
+ QMutexLocker locker(&m_mutex);
+ if (m_finished || m_queue.isEmpty()) {
return;
}
+ const Work w = m_queue.dequeue();
+
+ //we ensure to have the wait condition in the right state
+ if (m_queue.isEmpty()) {
+ m_waitCondition.reset();
+ } else {
+ m_waitCondition.set();
+ }
+
HRESULT hr = S_OK;
{
- QMutexLocker locker(&m_mutex);
+ QMutexLocker locker(&m_currentMutex);
m_currentRender = w.graph;
- m_currentRenderId = w.id;
+ m_currentRenderId = w.id;
}
-
if (w.task == ReplaceGraph) {
- QMutexLocker locker(&m_mutex);
int index = -1;
for(int i = 0; i < FILTER_COUNT; ++i) {
if (m_graphHandle[i].graph == w.oldGraph) {
@@ -328,7 +311,7 @@ namespace Phonon
}
{
- QMutexLocker locker(&m_mutex);
+ QMutexLocker locker(&m_currentMutex);
m_currentRender = Graph();
m_currentRenderId = 0;
}
@@ -336,6 +319,13 @@ namespace Phonon
void WorkerThread::abortCurrentRender(qint16 renderId)
{
+ {
+ QMutexLocker locker(&m_currentMutex);
+ if (m_currentRender && m_currentRenderId == renderId) {
+ m_currentRender->Abort();
+ }
+ }
+
QMutexLocker locker(&m_mutex);
bool found = false;
for(int i = 0; !found && i < m_queue.size(); ++i) {
@@ -343,12 +333,11 @@ namespace Phonon
if (w.id == renderId) {
found = true;
m_queue.removeAt(i);
+ if (m_queue.isEmpty()) {
+ m_waitCondition.reset();
+ }
}
}
-
- if (m_currentRender && m_currentRenderId == renderId) {
- m_currentRender->Abort();
- }
}
//tells the thread to stop processing
@@ -523,6 +512,9 @@ namespace Phonon
qSwap(m_graphs[0], m_graphs[1]); //swap the graphs
+ if (m_transitionTime >= 0)
+ m_graphs[1]->stop(); //make sure we stop the previous graph
+
if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid &&
catchComError(currentGraph()->renderResult())) {
setState(Phonon::ErrorState);
diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h
index 2c34ffc..a6beb5f 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.h
+++ b/src/3rdparty/phonon/ds9/mediaobject.h
@@ -135,7 +135,6 @@ namespace Phonon
};
QList<Filter> decoders; //for the state change requests
};
- Work dequeueWork();
void handleTask();
Graph m_currentRender;
@@ -144,7 +143,8 @@ namespace Phonon
bool m_finished;
quint16 m_currentWorkId;
QWinWaitCondition m_waitCondition;
- QMutex m_mutex;
+ QMutex m_mutex; // mutex for the m_queue, m_finished and m_currentWorkId
+ QMutex m_currentMutex; //mutex for current renderer and id
//this is for WaitForMultipleObjects
struct
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp
index 34ff8cb..091be16 100644
--- a/src/3rdparty/phonon/ds9/videowidget.cpp
+++ b/src/3rdparty/phonon/ds9/videowidget.cpp
@@ -84,7 +84,19 @@ namespace Phonon
void setCurrentRenderer(AbstractVideoRenderer *renderer)
{
m_currentRenderer = renderer;
- update();
+ //we disallow repaint on that widget for just a fraction of second
+ //this allows better transition between videos
+ setUpdatesEnabled(false);
+ m_flickerFreeTimer.start(20, this);
+ }
+
+ void timerEvent(QTimerEvent *e)
+ {
+ if (e->timerId() == m_flickerFreeTimer.timerId()) {
+ m_flickerFreeTimer.stop();
+ setUpdatesEnabled(true);
+ }
+ QWidget::timerEvent(e);
}
QSize sizeHint() const
@@ -106,6 +118,8 @@ namespace Phonon
void paintEvent(QPaintEvent *e)
{
+ if (!updatesEnabled())
+ return; //this avoids repaint from native events
checkCurrentRenderingMode();
m_currentRenderer->repaintCurrentFrame(this, e->rect());
}
@@ -160,6 +174,7 @@ namespace Phonon
VideoWidget *m_node;
AbstractVideoRenderer *m_currentRenderer;
QVariant m_restoreScreenSaverActive;
+ QBasicTimer m_flickerFreeTimer;
};
VideoWidget::VideoWidget(QWidget *parent)
diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp
index 0a21c87..c003af9 100644
--- a/src/3rdparty/phonon/phonon/mediasource.cpp
+++ b/src/3rdparty/phonon/phonon/mediasource.cpp
@@ -140,8 +140,12 @@ MediaSourcePrivate::~MediaSourcePrivate()
{
#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
if (autoDelete) {
- delete stream;
- delete ioDevice;
+ //here we use deleteLater because this object
+ //might be destroyed from another thread
+ if (stream)
+ stream->deleteLater();
+ if (ioDevice)
+ ioDevice->deleteLater();
}
#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
}
diff --git a/src/3rdparty/sha1/sha1.cpp b/src/3rdparty/sha1/sha1.cpp
index 03c2773..072a45f 100644
--- a/src/3rdparty/sha1/sha1.cpp
+++ b/src/3rdparty/sha1/sha1.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
index 118751e..f64219c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
@@ -942,6 +942,37 @@ UString UString::from(int i)
return UString(p, static_cast<int>(end - p));
}
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+UString UString::from(int64_t i)
+{
+ UChar buf[1 + sizeof(i) * 3];
+ UChar* end = buf + sizeof(buf) / sizeof(UChar);
+ UChar* p = end;
+
+ if (i == 0)
+ *--p = '0';
+ else if (i == LLONG_MIN) {
+ char minBuf[1 + sizeof(i) * 3];
+ snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", LLONG_MIN);
+ return UString(minBuf);
+ } else {
+ bool negative = false;
+ if (i < 0) {
+ negative = true;
+ i = -i;
+ }
+ while (i) {
+ *--p = static_cast<unsigned short>((i % 10) + '0');
+ i /= 10;
+ }
+ if (negative)
+ *--p = '-';
+ }
+
+ return UString(p, static_cast<int>(end - p));
+}
+#endif
+
UString UString::from(unsigned int u)
{
UChar buf[sizeof(u) * 3];
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
index bb0e7fb..7edb994 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h
@@ -268,6 +268,9 @@ namespace JSC {
}
static UString from(int);
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+ static UString from(int64_t i);
+#endif
static UString from(unsigned int);
static UString from(long);
static UString from(double);
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 2eb7c08..68da1d6 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -3218,3 +3218,20 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4
CONFIG += no_debug_info
}
+!win32-g++:win32:contains(QMAKE_HOST.arch, x86_64):{
+ asm_compiler.commands = ml64 /c
+ asm_compiler.commands += /Fo ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ asm_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ asm_compiler.input = ASM_SOURCES
+ asm_compiler.variable_out = OBJECTS
+ asm_compiler.name = compiling[asm] ${QMAKE_FILE_IN}
+ silent:asm_compiler.commands = @echo compiling[asm] ${QMAKE_FILE_IN} && $$asm_compiler.commands
+ QMAKE_EXTRA_COMPILERS += asm_compiler
+
+ ASM_SOURCES += \
+ plugins/win/PaintHooks.asm
+ if(win32-msvc2005|win32-msvc2008):equals(TEMPLATE_PREFIX, "vc") {
+ SOURCES += \
+ plugins/win/PaintHooks.asm
+ }
+}
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm
new file mode 100644
index 0000000..1508813
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm
@@ -0,0 +1,50 @@
+;/*
+; Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+;
+; 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.
+;
+; 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.
+;*/
+
+;HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+
+PUBLIC _HBeginPaint
+
+_TEXT SEGMENT
+
+_HBeginPaint PROC
+ mov r10,rcx
+ mov eax,1017h
+ syscall
+ ret
+_HBeginPaint ENDP
+
+_TEXT ENDS
+
+;BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+
+PUBLIC _HEndPaint
+
+_TEXT SEGMENT
+
+_HEndPaint PROC
+ mov r10,rcx
+ mov eax,1019h
+ syscall
+ ret
+_HEndPaint ENDP
+
+_TEXT ENDS
+
+END
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
index c97984d..2687186 100644
--- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
@@ -117,6 +117,14 @@ static BYTE* beginPaint;
static unsigned endPaintSysCall;
static BYTE* endPaint;
+typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*);
+typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*);
+
+#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC)
+extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint);
+extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint);
+#endif
+
HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint)
{
PluginView* pluginView = reinterpret_cast<PluginView*>(GetProp(hWnd, kWebPluginViewProperty));
@@ -139,12 +147,14 @@ HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint)
: "memory"
);
return result;
-#else
+#elif defined(_M_IX86)
// Call through to the original BeginPaint.
__asm mov eax, beginPaintSysCall
__asm push lpPaint
__asm push hWnd
__asm call beginPaint
+#else
+ return _HBeginPaint(hWnd, lpPaint);
#endif
}
@@ -166,12 +176,14 @@ BOOL WINAPI PluginView::hookedEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint)
: "a" (endPaintSysCall), "g" (lpPaint), "g" (hWnd), "m" (*endPaint)
);
return result;
-#else
+#elif defined (_M_IX86)
// Call through to the original EndPaint.
__asm mov eax, endPaintSysCall
__asm push lpPaint
__asm push hWnd
__asm call endPaint
+#else
+ return _HEndPaint(hWnd, lpPaint);
#endif
}
@@ -184,6 +196,7 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE
pProc = reinterpret_cast<BYTE*>(reinterpret_cast<ptrdiff_t>(GetProcAddress(hMod, proc)));
+#if COMPILER(GCC) || defined(_M_IX86)
if (pProc[0] != 0xB8)
return;
@@ -199,6 +212,35 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE
*reinterpret_cast<unsigned*>(pProc + 1) = reinterpret_cast<intptr_t>(pNewProc) - reinterpret_cast<intptr_t>(pProc + 5);
pProc += 5;
+#else
+ /* Disassembly of BeginPaint()
+ 00000000779FC5B0 4C 8B D1 mov r10,rcx
+ 00000000779FC5B3 B8 17 10 00 00 mov eax,1017h
+ 00000000779FC5B8 0F 05 syscall
+ 00000000779FC5BA C3 ret
+ 00000000779FC5BB 90 nop
+ 00000000779FC5BC 90 nop
+ 00000000779FC5BD 90 nop
+ 00000000779FC5BE 90 nop
+ 00000000779FC5BF 90 nop
+ 00000000779FC5C0 90 nop
+ 00000000779FC5C1 90 nop
+ 00000000779FC5C2 90 nop
+ 00000000779FC5C3 90 nop
+ */
+ // Check for the signature as in the above disassembly
+ DWORD guard = 0xB8D18B4C;
+ if (*reinterpret_cast<DWORD*>(pProc) != guard)
+ return;
+
+ DWORD flOldProtect;
+ VirtualProtect(pProc, 12, PAGE_EXECUTE_READWRITE, & flOldProtect);
+ pProc[0] = 0x48; // mov rax, this
+ pProc[1] = 0xb8;
+ *(__int64*)(pProc+2) = (__int64)pNewProc;
+ pProc[10] = 0xff; // jmp rax
+ pProc[11] = 0xe0;
+#endif
}
static void setUpOffscreenPaintingHooks(HDC (WINAPI*hookedBeginPaint)(HWND, PAINTSTRUCT*), BOOL (WINAPI*hookedEndPaint)(HWND, const PAINTSTRUCT*))
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 1a45fe6..613a72f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -105,7 +105,7 @@ void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
Vector<String> paths;
- String qtPath(getenv("QTWEBKIT_PLUGIN_PATH"));
+ String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data());
qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths);
db->setPluginDirectories(paths);