summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/fx/qfximage.cpp3
-rw-r--r--src/declarative/fx/qfxrect.cpp10
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp22
-rw-r--r--src/declarative/util/qfxperf.cpp18
-rw-r--r--src/declarative/util/qfxperf.h14
-rw-r--r--src/declarative/util/qmlscript.cpp6
-rw-r--r--src/opengl/qgl_x11egl.cpp14
-rw-r--r--tools/qmlviewer/main.cpp6
-rw-r--r--tools/qmlviewer/qmlviewer.cpp4
-rw-r--r--tools/qmlviewer/qmlviewer.h1
10 files changed, 67 insertions, 31 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 4197a80..064580e 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -863,6 +863,9 @@ QString QFxImage::source() const
void QFxImage::setSource(const QString &url)
{
+#ifdef Q_ENABLE_PERFORMANCE_LOG
+ QFxPerfTimer<QFxPerf::PixmapLoad> perf;
+#endif
Q_D(QFxImage);
if (url == d->source)
return;
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index f1cbb58..f81f9b3 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -55,7 +55,7 @@ QML_DEFINE_TYPE(QFxPen,Pen);
By default, the pen is invalid and nothing is drawn. You must either set a color (then the default
width is 0) or a width (then the default color is black).
- A width of 0 is a single-pixel line on the border of the item being painted.
+ A width of 0 indicates a cosmetic pen, a single-pixel line on the border of the item being painted.
Example:
\qml
@@ -401,7 +401,7 @@ void QFxRect::generateRoundedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->_radius*2 + 1 + pw*2, d->_radius*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ d->_rectImage = QImage(d->_radius*2 + 3 + pw*2, d->_radius*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
@@ -421,7 +421,7 @@ void QFxRect::generateBorderedRect()
Q_D(QFxRect);
if (d->_rectImage.isNull()) {
const int pw = d->_pen && d->_pen->isValid() ? d->_pen->width() : 0;
- d->_rectImage = QImage(d->pen()->width()*2 + 1 + pw*2, d->pen()->width()*2 + 1 + pw*2, QImage::Format_ARGB32_Premultiplied);
+ d->_rectImage = QImage(d->pen()->width()*2 + 3 + pw*2, d->pen()->width()*2 + 3 + pw*2, QImage::Format_ARGB32_Premultiplied);
d->_rectImage.fill(0);
QPainter p(&(d->_rectImage));
p.setRenderHint(QPainter::Antialiasing);
@@ -533,10 +533,10 @@ void QFxRect::drawRect(QPainter &p)
if (d->_radius > 0) {
generateRoundedRect();
//### implicit conversion to int
- offset = int(d->_radius+0.5+pw);
+ offset = int(d->_radius+1.5+pw);
} else {
generateBorderedRect();
- offset = pw;
+ offset = pw+1;
}
//basically same code as QFxImage uses to paint sci images
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index ead7ee5..01600b9 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -12,6 +12,8 @@
#include <QStack>
#include <QtDebug>
+#include <qfxperf.h>
+
QT_BEGIN_NAMESPACE
using namespace JavaScript;
@@ -203,7 +205,10 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
LocationSpan location,
AST::UiObjectInitializer *initializer)
{
- bool isType = !objectType.isEmpty() && objectType.at(0).isUpper() && !objectType.contains(QLatin1Char('.'));
+ int lastTypeDot = objectType.lastIndexOf(QLatin1Char('.'));
+ bool isType = !objectType.isEmpty() &&
+ (objectType.at(0).isUpper() |
+ lastTypeDot >= 0 && objectType.at(lastTypeDot+1).isUpper());
int propertyCount = 0;
for (; propertyName; propertyName = propertyName->next){
@@ -234,15 +239,21 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
return 0;
} else {
-
// Class
- const int typeId = _parser->findOrCreateTypeId(objectType);
+
+ QString resolvableObjectType = objectType;
+ if (lastTypeDot >= 0)
+ resolvableObjectType.replace(QLatin1Char('.'),QLatin1Char('/'));
+ const int typeId = _parser->findOrCreateTypeId(resolvableObjectType);
Object *obj = new Object;
obj->type = typeId;
- _scope.append(objectType);
+
+ // XXX this doesn't do anything (_scope never builds up)
+ _scope.append(resolvableObjectType);
obj->typeName = qualifiedNameId().toLatin1();
_scope.removeLast();
+
obj->location = location;
if (propertyCount) {
@@ -621,6 +632,9 @@ QmlScriptParser::~QmlScriptParser()
bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url)
{
+#ifdef Q_ENABLE_PERFORMANCE_LOG
+ QFxPerfTimer<QFxPerf::QmlParsing> pt;
+#endif
const QString fileName = url.toString();
QTextStream stream(data, QIODevice::ReadOnly);
diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp
index 5ce8646..01ac878 100644
--- a/src/declarative/util/qfxperf.cpp
+++ b/src/declarative/util/qfxperf.cpp
@@ -44,16 +44,20 @@
QT_BEGIN_NAMESPACE
Q_DEFINE_PERFORMANCE_LOG(QFxPerf, "QFx") {
- Q_DEFINE_PERFORMANCE_METRIC(XmlParsing, "XML Parsing");
- Q_DEFINE_PERFORMANCE_METRIC(Compile, "XML Compilation");
- Q_DEFINE_PERFORMANCE_METRIC(CompileRun, "XML Compilation Run");
- Q_DEFINE_PERFORMANCE_METRIC(CssParsing, "CSS Parsing");
+ Q_DEFINE_PERFORMANCE_METRIC(QmlParsing, "QML Parsing");
+ Q_DEFINE_PERFORMANCE_METRIC(Compile, "QML Compilation");
+ Q_DEFINE_PERFORMANCE_METRIC(CompileRun, "QML Compilation Run");
Q_DEFINE_PERFORMANCE_METRIC(CreateComponent, "Component creation");
Q_DEFINE_PERFORMANCE_METRIC(BindInit, "BindValue Initialization");
Q_DEFINE_PERFORMANCE_METRIC(BindCompile, "BindValue compile");
Q_DEFINE_PERFORMANCE_METRIC(BindValue, "BindValue execution");
Q_DEFINE_PERFORMANCE_METRIC(BindValueSSE, "BindValue execution SSE");
Q_DEFINE_PERFORMANCE_METRIC(BindValueQt, "BindValue execution QtScript");
+ Q_DEFINE_PERFORMANCE_METRIC(ContextQuery, "QtScript: Query Context");
+ Q_DEFINE_PERFORMANCE_METRIC(ContextProperty, "QtScript: Context Property");
+ Q_DEFINE_PERFORMANCE_METRIC(ObjectQuery, "QtScript: Query Object");
+ Q_DEFINE_PERFORMANCE_METRIC(ObjectProperty, "QtScript: Object Property");
+ Q_DEFINE_PERFORMANCE_METRIC(ObjectSetProperty, "QtScript: Set Object Property");
Q_DEFINE_PERFORMANCE_METRIC(BindableValueUpdate, "QmlBindableValue::update");
Q_DEFINE_PERFORMANCE_METRIC(PixmapLoad, "Pixmap loading");
Q_DEFINE_PERFORMANCE_METRIC(MetaProperty, "Meta property resolution");
@@ -65,11 +69,7 @@ Q_DEFINE_PERFORMANCE_LOG(QFxPerf, "QFx") {
Q_DEFINE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete, "QFxComponentInstance::componentComplete");
Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, "QFxBaseLayout::componentComplete");
Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, "QFxText::componentComplete");
- Q_DEFINE_PERFORMANCE_METRIC(ContextQuery, "QtScript: Query Context");
- Q_DEFINE_PERFORMANCE_METRIC(ContextProperty, "QtScript: Context Property");
- Q_DEFINE_PERFORMANCE_METRIC(ObjectQuery, "QtScript: Query Object");
- Q_DEFINE_PERFORMANCE_METRIC(ObjectProperty, "QtScript: Object Property");
- Q_DEFINE_PERFORMANCE_METRIC(ObjectSetProperty, "QtScript: Set Object Property");
Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, "QFxText::setText");
+ Q_DEFINE_PERFORMANCE_METRIC(AddScript, "QmlScript::addScriptToEngine");
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qfxperf.h b/src/declarative/util/qfxperf.h
index b1f9bd0..3430658 100644
--- a/src/declarative/util/qfxperf.h
+++ b/src/declarative/util/qfxperf.h
@@ -50,16 +50,20 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
Q_DECLARE_PERFORMANCE_LOG(QFxPerf) {
- Q_DECLARE_PERFORMANCE_METRIC(XmlParsing);
+ Q_DECLARE_PERFORMANCE_METRIC(QmlParsing);
Q_DECLARE_PERFORMANCE_METRIC(Compile);
Q_DECLARE_PERFORMANCE_METRIC(CompileRun);
- Q_DECLARE_PERFORMANCE_METRIC(CssParsing);
Q_DECLARE_PERFORMANCE_METRIC(CreateComponent);
Q_DECLARE_PERFORMANCE_METRIC(BindInit);
Q_DECLARE_PERFORMANCE_METRIC(BindCompile);
Q_DECLARE_PERFORMANCE_METRIC(BindValue);
Q_DECLARE_PERFORMANCE_METRIC(BindValueSSE);
Q_DECLARE_PERFORMANCE_METRIC(BindValueQt);
+ Q_DECLARE_PERFORMANCE_METRIC(ContextQuery);
+ Q_DECLARE_PERFORMANCE_METRIC(ContextProperty);
+ Q_DECLARE_PERFORMANCE_METRIC(ObjectQuery);
+ Q_DECLARE_PERFORMANCE_METRIC(ObjectProperty);
+ Q_DECLARE_PERFORMANCE_METRIC(ObjectSetProperty);
Q_DECLARE_PERFORMANCE_METRIC(BindableValueUpdate);
Q_DECLARE_PERFORMANCE_METRIC(PixmapLoad);
Q_DECLARE_PERFORMANCE_METRIC(MetaProperty);
@@ -71,12 +75,8 @@ Q_DECLARE_PERFORMANCE_LOG(QFxPerf) {
Q_DECLARE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete);
Q_DECLARE_PERFORMANCE_METRIC(BaseLayoutComponentComplete);
Q_DECLARE_PERFORMANCE_METRIC(TextComponentComplete);
- Q_DECLARE_PERFORMANCE_METRIC(ContextQuery);
- Q_DECLARE_PERFORMANCE_METRIC(ContextProperty);
- Q_DECLARE_PERFORMANCE_METRIC(ObjectQuery);
- Q_DECLARE_PERFORMANCE_METRIC(ObjectProperty);
- Q_DECLARE_PERFORMANCE_METRIC(ObjectSetProperty);
Q_DECLARE_PERFORMANCE_METRIC(QFxText_setText);
+ Q_DECLARE_PERFORMANCE_METRIC(AddScript);
}
#endif // _QFXPERF_H_
diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp
index d986b7a..d6d610a 100644
--- a/src/declarative/util/qmlscript.cpp
+++ b/src/declarative/util/qmlscript.cpp
@@ -55,11 +55,10 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QtDeclarative/qmlinfo.h>
+#include <qfxperf.h>
QT_BEGIN_NAMESPACE
-
-
class QmlScriptPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QmlScript);
@@ -183,6 +182,9 @@ void QmlScript::replyFinished()
void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &fileName)
{
+#ifdef Q_ENABLE_PERFORMANCE_LOG
+ QFxPerfTimer<QFxPerf::AddScript> pt;
+#endif
Q_Q(QmlScript);
QmlEngine *engine = qmlEngine(q);
QmlContext *context = qmlContext(q);
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 480a2dc..f8ea8de 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -268,10 +268,16 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext,
XVisualInfo vi;
- int err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), x11Info().depth(), TrueColor, &vi);
- if (err == 0) {
- qWarning("Error: Couldn't get a matching X visual for format");
- return;
+ if (parentWidget()) {
+ vi.depth = parentWidget()->x11Info().depth();
+ vi.screen = parentWidget()->x11Info().screen();
+ vi.visual = (Visual *)(parentWidget()->x11Info().visual());
+ } else {
+ int err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), x11Info().depth(), TrueColor, &vi);
+ if (err == 0) {
+ qWarning("Error: Couldn't get a matching X visual for format");
+ return;
+ }
}
XSetWindowAttributes a;
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp
index f59918f..38a00bb 100644
--- a/tools/qmlviewer/main.cpp
+++ b/tools/qmlviewer/main.cpp
@@ -41,6 +41,7 @@ void usage()
qWarning(" -recordtest <directory> .................. record an autotest");
qWarning(" -runtest <directory> ..................... run a previously recorded test");
qWarning(" -translation <translationfile> ........... set the language to run in");
+ qWarning(" -L <directory> ........................... prepend to the library search path");
qWarning(" ");
qWarning(" Press F1 for interactive help");
exit(1);
@@ -81,6 +82,7 @@ int main(int argc, char ** argv)
QString dither = "none";
QString recordfile;
QStringList recordargs;
+ QStringList libraries;
QString skin;
bool devkeys = false;
bool cache = false;
@@ -132,6 +134,8 @@ int main(int argc, char ** argv)
usage();
translationFile = newargv[i + 1];
++i;
+ } else if (arg == "-L") {
+ libraries << QString(argv[++i]);
} else if (arg[0] != '-') {
fileName = arg;
} else if (1 || arg == "-help") {
@@ -146,6 +150,8 @@ int main(int argc, char ** argv)
}
QmlViewer viewer(testMode, testDir, 0, frameless ? Qt::FramelessWindowHint : Qt::Widget);
+ foreach (QString lib, libraries)
+ viewer.addLibraryPath(lib);
viewer.setCacheEnabled(cache);
viewer.setRecordFile(recordfile);
if (period>0)
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index 97db22e..4b0a83a 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -314,6 +314,10 @@ void QmlViewer::toggleRecording()
setRecording(recording);
}
+void QmlViewer::addLibraryPath(const QString& lib)
+{
+ canvas->engine()->addNameSpacePath("",lib);
+}
void QmlViewer::reload()
{
diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h
index 09b2b5b..967af49 100644
--- a/tools/qmlviewer/qmlviewer.h
+++ b/tools/qmlviewer/qmlviewer.h
@@ -42,6 +42,7 @@ public:
void setAutoRecord(int from, int to);
void setDeviceKeys(bool);
void setCacheEnabled(bool);
+ void addLibraryPath(const QString& lib);
QSize sizeHint() const;