canvas item refactors
authorCharles Yin <charles.yin@nokia.com>
Tue, 9 Aug 2011 06:44:38 +0000 (16:44 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 12 Sep 2011 15:04:03 +0000 (17:04 +0200)
commit82b21536e72a640699594b3e82a5a6182a95521c
treed641802de88c644e12b9cf3e2279f3aae084779b
parent6a15dae8c2f09c99bb124b4587ff8088b35a7273
canvas item refactors

1.Supports tiled canvas with canvasSize, tileSize and canvasWindow
2.Supports different rendering targets: Canvas.Image and
  Canvas.FrameBufferObject by renderTarget property
3.Supports thread rendering when possible by threadRendering property.
4.Refactors QSGContext2D code, move some logic to
  QSGContext2DCommandBuffer,QSGContext2DTexture,QSGContext2DTile, etc
5.Updates/adds some canvas examples
6.Some improvements for context2d API
   6.1 drawImage() now loads image asynchoronously and draw images
       automatically when they are ready
   6.2 adds fillRule supports
   6.3 add svg path supports
   6.4 Pixel operations (getImageData/putImageData/createImageData)
       now have better performance by using V8 indexed array accessors
   6.5 Uses QTransform instead of QMatrix
   6.6 Gradients/patterns now are V8 values, not QObjects
   6.7 Supports measureText and TextMetrics interface
   6.8 Gives not support warnings for unimplemented functions
       (drawFocusRing,setCaretSelectionRect,caretBlinkRate)
   6.9 Better error handling, throw standard DOM exceptions according
       to the HTML5 context2d spec.
   6.10 Adds shear, resetTransform to matrix operations
   6.11 Adds roundedRect, ellipse, text to path operations
   6.12 Adds new features to CanvasImageData interface
      1) adds mirror() function
      2) adds filter() function, include the following filters:
          Threshold
          GrayScale
          Brightness
          Invert
          Blur
          Blend
          Opaque
          Convolute
7. Adds documentations

Change-Id: Id19224260d6a3fdc589d1f9681c34a88a7e7b3e5
Reviewed-on: http://codereview.qt-project.org/3621
Reviewed-by: Charles Yin <charles.yin@nokia.com>
54 files changed:
examples/declarative/canvas/bezierCurve/bezierCurve.qml [new file with mode: 0644]
examples/declarative/canvas/clip/clip.qml [new file with mode: 0644]
examples/declarative/canvas/contents/Button.qml [moved from examples/declarative/canvas/stockchart/contents/Button.qml with 100% similarity]
examples/declarative/canvas/contents/ScrollBar.qml [moved from examples/declarative/canvas/stockchart/contents/ScrollBar.qml with 100% similarity]
examples/declarative/canvas/contents/Slider.qml [new file with mode: 0644]
examples/declarative/canvas/contents/Stocks.qml [moved from examples/declarative/canvas/stockchart/contents/Stocks.qml with 100% similarity]
examples/declarative/canvas/contents/TitleBar.qml [moved from examples/declarative/canvas/stockchart/contents/TitleBar.qml with 100% similarity]
examples/declarative/canvas/contents/ToolBar.qml [moved from examples/declarative/canvas/stockchart/contents/ToolBar.qml with 100% similarity]
examples/declarative/canvas/contents/images/button-pressed.png [moved from examples/declarative/canvas/stockchart/contents/images/button-pressed.png with 100% similarity]
examples/declarative/canvas/contents/images/button.png [moved from examples/declarative/canvas/stockchart/contents/images/button.png with 100% similarity]
examples/declarative/canvas/contents/images/default.svg [moved from examples/declarative/canvas/stockchart/contents/images/default.svg with 100% similarity]
examples/declarative/canvas/contents/images/gloss.png [moved from examples/declarative/canvas/stockchart/contents/images/gloss.png with 100% similarity]
examples/declarative/canvas/contents/images/lineedit.png [moved from examples/declarative/canvas/stockchart/contents/images/lineedit.png with 100% similarity]
examples/declarative/canvas/contents/images/lineedit.sci [moved from examples/declarative/canvas/stockchart/contents/images/lineedit.sci with 100% similarity]
examples/declarative/canvas/contents/images/quit.png [moved from examples/declarative/canvas/stockchart/contents/images/quit.png with 100% similarity]
examples/declarative/canvas/contents/images/stripes.png [moved from examples/declarative/canvas/stockchart/contents/images/stripes.png with 100% similarity]
examples/declarative/canvas/contents/images/titlebar.png [moved from examples/declarative/canvas/stockchart/contents/images/titlebar.png with 100% similarity]
examples/declarative/canvas/contents/images/titlebar.sci [moved from examples/declarative/canvas/stockchart/contents/images/titlebar.sci with 100% similarity]
examples/declarative/canvas/contents/images/toolbutton.png [moved from examples/declarative/canvas/stockchart/contents/images/toolbutton.png with 100% similarity]
examples/declarative/canvas/contents/images/toolbutton.sci [moved from examples/declarative/canvas/stockchart/contents/images/toolbutton.sci with 100% similarity]
examples/declarative/canvas/contents/qt-logo.png [new file with mode: 0644]
examples/declarative/canvas/pixels/pixels.qml [new file with mode: 0644]
examples/declarative/canvas/quadraticCurveTo/quadraticCurveTo.qml [new file with mode: 0644]
examples/declarative/canvas/roundedrect/roundedrect.qml [new file with mode: 0644]
examples/declarative/canvas/smile/smile.qml [new file with mode: 0644]
examples/declarative/canvas/squircle/squircle.png [new file with mode: 0644]
examples/declarative/canvas/squircle/squircle.qml [new file with mode: 0644]
examples/declarative/canvas/stockchart/README [new file with mode: 0644]
examples/declarative/canvas/stockchart/com/nokia/StockChartExample/qmldir [new file with mode: 0644]
examples/declarative/canvas/stockchart/plugin.cpp [moved from examples/declarative/canvas/stockchart/main.cpp with 78% similarity]
examples/declarative/canvas/stockchart/stock.qml
examples/declarative/canvas/stockchart/stockchart.pro
examples/declarative/canvas/stockchart/stockchart.qrc [deleted file]
examples/declarative/canvas/tiger/tiger.js [new file with mode: 0644]
examples/declarative/canvas/tiger/tiger.qml [new file with mode: 0644]
examples/declarative/canvas/twitterfriends/TwitterUser.qml [new file with mode: 0644]
examples/declarative/canvas/twitterfriends/cache.js [new file with mode: 0644]
examples/declarative/canvas/twitterfriends/twitter.qml [new file with mode: 0644]
src/declarative/items/context2d/context2d.pri
src/declarative/items/context2d/qsgcanvasitem.cpp
src/declarative/items/context2d/qsgcanvasitem_p.h
src/declarative/items/context2d/qsgcontext2d.cpp
src/declarative/items/context2d/qsgcontext2d_p.h
src/declarative/items/context2d/qsgcontext2d_p_p.h [deleted file]
src/declarative/items/context2d/qsgcontext2dcommandbuffer.cpp [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dcommandbuffer_p.h [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dnode.cpp [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dnode_p.h [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dtexture.cpp [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dtexture_p.h [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dtile.cpp [new file with mode: 0644]
src/declarative/items/context2d/qsgcontext2dtile_p.h [new file with mode: 0644]
src/declarative/items/qsgitemsmodule.cpp
src/declarative/qml/v8/qv8engine_p.h