summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-07-19 05:26:37 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-07-19 05:26:37 (GMT)
commit75131b7a1bfeeb033ea5b8bf62d50cc3d82d757e (patch)
treef674bb8ff88068887605655bc61b2d5a78956c71 /demos
parent8668f245b69da455ac7fe1d0a599226c1d6b9580 (diff)
downloadQt-75131b7a1bfeeb033ea5b8bf62d50cc3d82d757e.zip
Qt-75131b7a1bfeeb033ea5b8bf62d50cc3d82d757e.tar.gz
Qt-75131b7a1bfeeb033ea5b8bf62d50cc3d82d757e.tar.bz2
Remove the -use-blur option from qtdemo
It relied on the now missing pixmap property. Since it isn't used, it doesn't seem worth the effort to update it to use a declarative image provider instead.
Diffstat (limited to 'demos')
-rw-r--r--demos/qtdemo/colors.cpp6
-rw-r--r--demos/qtdemo/colors.h1
-rw-r--r--demos/qtdemo/mainwindow.cpp8
-rw-r--r--demos/qtdemo/menumanager.cpp20
-rw-r--r--demos/qtdemo/qmlShell.qml22
5 files changed, 1 insertions, 56 deletions
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index b352e3d..802d77d 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -81,7 +81,6 @@ bool Colors::noRescale = false;
bool Colors::noAnimations = false;
bool Colors::noBlending = false;
bool Colors::noScreenSync = false;
-bool Colors::noBlur = true;
bool Colors::fullscreen = false;
bool Colors::usePixmaps = false;
bool Colors::useLoop = false;
@@ -233,8 +232,6 @@ void Colors::parseArgs(int argc, char *argv[])
Colors::showFps = true;
else if (s == "-no-blending")
Colors::noBlending = true;
- else if (s == "-use-blur")
- Colors::noBlur = false;
else if (s == "-no-sync")
Colors::noScreenSync = true;
else if (s.startsWith("-menu"))
@@ -270,7 +267,7 @@ void Colors::parseArgs(int argc, char *argv[])
else if (s.startsWith("-h") || s.startsWith("-help")){
QMessageBox::warning(0, "Arguments",
QString("Usage: qtdemo [-verbose] [-no-adapt] [-opengl] [-software] [-fullscreen] [-ticker[0|1]] ")
- + "[-animations[0|1]] [-no-blending] [-use-blur] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] "
+ + "[-animations[0|1]] [-no-blending] [-no-sync] [-use-timer-update[0|1]] [-pause[0|1]] "
+ "[-use-window-mask] [-no-rescale] "
+ "[-use-pixmaps] [-show-fps] [-show-br] [-8bit[0|1]] [-menu<int>] [-use-loop] [-use-balls] "
+ "[-animation-speed<float>] [-fps<int>] "
@@ -298,7 +295,6 @@ void Colors::setLowSettings()
Colors::usePixmaps = true;
Colors::noAnimations = true;
Colors::noBlending = true;
- Colors::noBlur = true;
}
void Colors::detectSystemResources()
diff --git a/demos/qtdemo/colors.h b/demos/qtdemo/colors.h
index 2d58058..1e0b795 100644
--- a/demos/qtdemo/colors.h
+++ b/demos/qtdemo/colors.h
@@ -91,7 +91,6 @@ public:
static bool noAnimations;
static bool noBlending;
static bool noScreenSync;
- static bool noBlur;
static bool useLoop;
static bool noWindowMask;
static bool usePixmaps;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 753014a..16c5bf3 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -310,14 +310,6 @@ void MainWindow::checkAdapt()
qDebug() << "- benchmark adaption: removed ticker (fps < 30)";
}
- //Note: Because we don't adapt later in the program, if blur makes FPS plummet then we won't catch it
- if (!Colors::noBlur && MenuManager::instance()->declarativeEngine && this->mainSceneRoot){
- Colors::noBlur = true;
- MenuManager::instance()->declarativeEngine->rootContext()->setContextProperty("useBlur", false);
- if (Colors::verbose)
- qDebug() << "- benchmark adaption: removed blur (fps < 30)";
- }
-
if (this->fpsMedian < 20){
Colors::noAnimations = true;
if (Colors::verbose)
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index 15561ab..7168b57 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -378,17 +378,6 @@ void MenuManager::launchQmlExample(const QString &name)
return;
}
}
- if(!Colors::noBlur){
- QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
- QPainter painter(&qmlBgImage);
- if(Colors::showFps)
- this->window->fpsLabel->setOpacity(0);
- this->window->render(&painter);
- if(Colors::showFps)
- this->window->fpsLabel->setOpacity(1.0);
- Qt::ImageConversionFlags convFlags = Qt::AvoidDither | Qt::NoOpaqueDetection;
- this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage, convFlags)));
- }
qmlRoot->setProperty("qmlFile", QVariant(""));//unload component
qmlRoot->setProperty("show", QVariant(true));
@@ -439,17 +428,8 @@ void MenuManager::init(MainWindow *window)
}
// Create QML Loader
- qmlRegisterType<QGraphicsBlurEffect>("Effects", 1, 0, "Blur");
- qmlRegisterType<QGraphicsDropShadowEffect>("Effects", 1, 0, "DropShadow");
declarativeEngine = new QDeclarativeEngine(this);
- // Note that we paint the background into a static image for a theorized performance improvement when blurring
- // It has not yet been determined what, if any, speed up this gives (but is left in 'cause the QML expects it now)
- declarativeEngine->rootContext()->setContextProperty("useBlur", !Colors::noBlur);
- QImage qmlBgImage(this->window->rect().size(), QImage::Format_ARGB32_Premultiplied);
- qmlBgImage.fill(0);
- this->declarativeEngine->rootContext()->setContextProperty("bgAppPixmap", QVariant(QPixmap::fromImage(qmlBgImage)));
-
QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this);
qmlRoot = 0;
if(component.isReady())
diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index e9d8d56..b5fdf39 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -40,28 +40,13 @@
****************************************************************************/
import Qt 4.7
-import Effects 1.0
-/* Vars exposed from C++
- pixmap bgAppPixmap
- bool useBlur (to turn on, pass -use-blur on the cmd line. Off by default 'cause it's too slow)
-*/
Item {
id: main
//height and width set by program to fill window
//below properties are sometimes set from C++
property url qmlFile: ''
property bool show: false
- /*
- Image{
- id: bg
- opacity: 0
- anchors.fill: parent
- z: -1
- pixmap: bgAppPixmap
- effect: Blur { id: blurEffect; enabled: useBlur; blurRadius: 8;}
- }
- */
Item{ id:embeddedViewer
width: parent.width
@@ -114,13 +99,6 @@ Item {
anchors.fill:parent
}
- effect: DropShadow {
- enabled: useBlur;
- blurRadius: 9;
- color: "#88000000";
- xOffset:0
- yOffset:0
- }
}
Text{