Changeset 109664 in webkit
- Timestamp:
- Mar 3, 2012 11:26:39 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r109663 r109664 1 2012-03-03 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 [Qt] Use the existing inheritedOpacity/matrix properties of QSGNode 4 https://bugs.webkit.org/show_bug.cgi?id=79543 5 6 Use QSGNode::inheritedOpacity() and QSGNode::matrix(). 7 Also, remove flags from changedStates() that we don't actually touch. 8 This is covered by existing API tests. 9 10 Reviewed by Kenneth Rohde Christiansen. 11 12 * UIProcess/API/qt/qquickwebpage.cpp: 13 (QQuickWebPagePrivate::paintToCurrentGLContext): 14 (PageProxyNode::changedStates): 15 (PageProxyNode::render): 16 * UIProcess/API/qt/qquickwebpage_p_p.h: 17 (QQuickWebPagePrivate): 18 1 19 2012-03-03 Anders Carlsson <andersca@apple.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
r108915 r109664 64 64 } 65 65 66 static float computeEffectiveOpacity(const QQuickItem* item)67 {68 if (!item)69 return 1;70 71 float opacity = item->opacity();72 if (opacity < 0.01)73 return 0;74 75 return opacity * computeEffectiveOpacity(item->parentItem());76 }77 78 66 void QQuickWebPagePrivate::setDrawingAreaSize(const QSize& size) 79 67 { … … 90 78 } 91 79 92 void QQuickWebPagePrivate::paintToCurrentGLContext( )80 void QQuickWebPagePrivate::paintToCurrentGLContext(const QTransform& transform, float opacity) 93 81 { 94 82 if (!q->isVisible()) 95 83 return; 96 84 97 QTransform transform = q->itemTransform(0, 0);98 transform.scale(contentsScale, contentsScale);99 100 float opacity = computeEffectiveOpacity(q);101 85 QRectF clipRect = viewportItem->mapRectToScene(viewportItem->boundingRect()); 102 86 … … 108 92 return; 109 93 110 drawingArea->paintToCurrentGLContext( transform, opacity, clipRect);94 drawingArea->paintToCurrentGLContext(QTransform(transform).scale(contentsScale, contentsScale), opacity, clipRect); 111 95 } 112 96 … … 119 103 virtual StateFlags changedStates() 120 104 { 121 return StateFlags(DepthState) | StencilState | ScissorState | ColorState | BlendState 122 | CullState | ViewportState; 123 } 124 125 virtual void render(const RenderState &) 126 { 127 if (m_pagePrivate) 128 m_pagePrivate->paintToCurrentGLContext(); 105 return StateFlags(StencilState) | ColorState | BlendState; 106 } 107 108 virtual void render(const RenderState&) 109 { 110 if (!m_pagePrivate) 111 return; 112 QTransform transform = matrix() ? matrix()->toTransform() : QTransform(); 113 m_pagePrivate->paintToCurrentGLContext(transform, inheritedOpacity()); 129 114 } 130 115 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
r108915 r109664 42 42 void updateSize(); 43 43 44 void paintToCurrentGLContext( );44 void paintToCurrentGLContext(const QTransform&, float opacity); 45 45 void paint(QPainter*); 46 46 void resetPaintNode();
Note: See TracChangeset
for help on using the changeset viewer.