Skip to content

Commit

Permalink
Change the default renderTarget and renderStrategy
Browse files Browse the repository at this point in the history
As we always use OpenGL and scenegraph render thread now, the best default
render target should be FBO and the best render strategy should be
cooperative mode (use the render thread).

Task-number:QTBUG-23956
Change-Id: I64b070dec566e359d27c84680fef1c691d6ce411
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
  • Loading branch information
yinyunqiao authored and Qt by Nokia committed Mar 7, 2012
1 parent cc6556c commit 2df64d0
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/quick/items/context2d/qquickcanvasitem.cpp
Expand Up @@ -86,8 +86,8 @@ QQuickCanvasItemPrivate::QQuickCanvasItemPrivate()
, hasCanvasWindow(false)
, available(false)
, contextInitialized(false)
, renderTarget(QQuickCanvasItem::Image)
, renderStrategy(QQuickCanvasItem::Threaded)
, renderTarget(QQuickCanvasItem::FramebufferObject)
, renderStrategy(QQuickCanvasItem::Cooperative)
{
}

Expand Down Expand Up @@ -379,7 +379,7 @@ void QQuickCanvasItem::setCanvasWindow(const QRectF& rect)
context will choose appropriate options and Canvas will signal the change
to the properties.
The default render target is \c Canvas.Image.
The default render target is \c Canvas.FramebufferObject.
*/
QQuickCanvasItem::RenderTarget QQuickCanvasItem::renderTarget() const
{
Expand Down Expand Up @@ -419,7 +419,7 @@ void QQuickCanvasItem::setRenderTarget(QQuickCanvasItem::RenderTarget target)
the GUI thread. Selecting \c Canvas.Cooperative, does not guarantee
rendering will occur on a thread separate from the GUI thread.
The default value is \c Canvas.Threaded.
The default value is \c Canvas.Cooperative.
\sa QtQuick2::Canvas::renderTarget
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_arc.qml
Expand Up @@ -3,7 +3,7 @@ import QtTest 1.0
import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "arc"; when: windowShown
function test_angle_1() {
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_arcto.qml
Expand Up @@ -3,7 +3,7 @@ import QtTest 1.0
import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "arcTo"; when: windowShown
function test_coincide() {
Expand Down
2 changes: 2 additions & 0 deletions tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
Expand Up @@ -15,6 +15,8 @@ Rectangle {
context.fillStyle = "red";
context.fillRect(0, 0, 100, 100);
}
renderTarget:Canvas.Image
renderStrategy:Canvas.Threaded
property int paintCount:spyPaint.count
property int paintedCount:spyPainted.count
property int canvasSizeChangedCount:spyCanvasSizeChanged.count
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/quick/qquickcanvasitem/data/tst_composite.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget:Canvas.Image
id:canvas; width:100;height:50; renderTarget:Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "composite"; when: windowShown
function test_clearRect() {
Expand Down Expand Up @@ -377,4 +377,4 @@ Canvas {
}

}
}
}
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_drawimage.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
Component.onCompleted: {
canvas.loadImage('green.png');
canvas.loadImage('red.png');
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_fillStyle.qml
Expand Up @@ -3,7 +3,7 @@ import QtTest 1.0
import "testhelper.js" as Helper

Canvas {
id:canvas; width:1;height:1;renderTarget:Canvas.Image
id:canvas; width:1;height:1;renderTarget:Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "fillStyle"; when: windowShown
function test_default() {
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_gradient.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "gradient"; when: windowShown
function test_basic() {
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/quick/qquickcanvasitem/data/tst_line.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import"testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50;renderTarget: Canvas.Image
id:canvas; width:100;height:50;renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "line"; when: windowShown
function test_default() {
Expand Down Expand Up @@ -828,4 +828,4 @@ Canvas {

}
}
}
}
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_path.qml
Expand Up @@ -3,7 +3,7 @@ import QtTest 1.0
import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "path"; when: windowShown

Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_pattern.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
//TODO
name: "pattern"; when: windowShown
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
//TODO
name: "pixel"; when: windowShown
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_shadow.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
//TODO

Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_state.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
id:testCase
name: "state"; when: windowShown
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_strokeStyle.qml
Expand Up @@ -3,7 +3,7 @@ import QtTest 1.0
import "testhelper.js" as Helper

Canvas {
id:canvas; width:100;height:50; renderTarget:Canvas.Image
id:canvas; width:100;height:50; renderTarget:Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "strokeStyle"; when: windowShown
function test_default() {
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_text.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
//TODO
name: "text"; when: windowShown
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/quick/qquickcanvasitem/data/tst_transform.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import QtTest 1.0
import "testhelper.js" as Helper
Canvas {
id:canvas; width:100;height:50; renderTarget: Canvas.Image
id:canvas; width:100;height:50; renderTarget: Canvas.Image; renderStrategy:Canvas.Threaded
TestCase {
name: "transform"; when: windowShown
function test_order() {
Expand Down

0 comments on commit 2df64d0

Please sign in to comment.