Changeset 150893 in webkit
- Timestamp:
- May 29, 2013 7:34:19 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r150884 r150893 1 2013-05-29 Marcelo Lira <marcelo.lira@openbossa.org> 2 3 [WK2][CoordinatedGraphics][EFL] WKViewUserViewportToContents() function doesn't do what it says 4 https://bugs.webkit.org/show_bug.cgi?id=116683 5 6 Reviewed by Noam Rosenthal. 7 8 WKViewUserViewportToContents now converts WebView coordinates to 9 page contents coordinates, taking into account factors as content 10 scale and scroll, and also device scale. 11 12 The function WKViewUserViewportToScene was added to convert WebView 13 coordinates to the coordinates of the canvas/scene where the view 14 is drawn, and EwkView was fixed to use it, instead of 15 WKViewUserViewportToContents. 16 17 * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: 18 (WKViewUserViewportToScene): 19 * UIProcess/API/C/CoordinatedGraphics/WKView.h: 20 * UIProcess/API/efl/EwkView.cpp: 21 (EwkView::createGLSurface): 22 * UIProcess/CoordinatedGraphics/WebView.cpp: 23 (WebKit::WebView::userViewportToContents): 24 (WebKit): 25 (WebKit::WebView::userViewportToScene): 26 (WebKit::WebView::transformToScene): 27 * UIProcess/CoordinatedGraphics/WebView.h: 28 (WebView): 29 1 30 2013-05-29 Carlos Garcia Campos <cgarcia@igalia.com> 2 31 -
trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
r150012 r150893 107 107 } 108 108 109 WKPoint WKViewUserViewportToScene(WKViewRef viewRef, WKPoint point) 110 { 111 WebCore::IntPoint result = toImpl(viewRef)->userViewportToScene(toIntPoint(point)); 112 return WKPointMake(result.x(), result.y()); 113 } 114 109 115 void WKViewPaintToCurrentGLContext(WKViewRef viewRef) 110 116 { -
trunk/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h
r150012 r150893 80 80 WK_EXPORT void WKViewSetUserViewportTranslation(WKViewRef, double tx, double ty); 81 81 WK_EXPORT WKPoint WKViewUserViewportToContents(WKViewRef, WKPoint); 82 WK_EXPORT WKPoint WKViewUserViewportToScene(WKViewRef, WKPoint); 82 83 83 84 WK_EXPORT void WKViewPaintToCurrentGLContext(WKViewRef); -
trunk/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
r150332 r150893 775 775 Evas_GL_API* gl = evas_gl_api_get(m_evasGL.get()); 776 776 777 const WKPoint& boundsEnd = WKViewUserViewportToContents(wkView(), WKPointMake(deviceSize().width(), deviceSize().height()));777 WKPoint boundsEnd = WKViewUserViewportToScene(wkView(), WKPointMake(deviceSize().width(), deviceSize().height())); 778 778 gl->glViewport(0, 0, boundsEnd.x, boundsEnd.y); 779 779 gl->glClearColor(1.0, 1.0, 1.0, 0); -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
r150802 r150893 111 111 IntPoint WebView::userViewportToContents(const IntPoint& point) const 112 112 { 113 return transformFromScene().mapPoint(point); 114 } 115 116 IntPoint WebView::userViewportToScene(const WebCore::IntPoint& point) const 117 { 113 118 return m_userViewportTransform.mapPoint(point); 114 119 } … … 203 208 AffineTransform WebView::transformToScene() const 204 209 { 210 FloatPoint position = -m_contentPosition; 211 float effectiveScale = m_contentScaleFactor * m_page->deviceScaleFactor(); 212 position.scale(effectiveScale, effectiveScale); 213 205 214 TransformationMatrix transform = m_userViewportTransform; 206 207 const FloatPoint& position = contentPosition(); 208 transform.scale(m_page->deviceScaleFactor()); 209 transform.translate(-position.x(), -position.y()); 210 transform.scale(contentScaleFactor()); 215 transform.translate(position.x(), position.y()); 216 transform.scale(effectiveScale); 211 217 212 218 return transform.toAffineTransform(); -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
r150764 r150893 72 72 void setUserViewportTranslation(double tx, double ty); 73 73 WebCore::IntPoint userViewportToContents(const WebCore::IntPoint&) const; 74 WebCore::IntPoint userViewportToScene(const WebCore::IntPoint&) const; 74 75 75 76 void paintToCurrentGLContext(); -
trunk/Tools/ChangeLog
r150891 r150893 1 2013-05-29 Marcelo Lira <marcelo.lira@openbossa.org> 2 3 [WK2][CoordinatedGraphics][EFL] WKViewUserViewportToContents() function doesn't do what it says 4 https://bugs.webkit.org/show_bug.cgi?id=116683 5 6 Reviewed by Noam Rosenthal. 7 8 A coordinates conversion test for WKViewUserViewportToContents was 9 added to WebKit2 API tests. 10 11 * TestWebKitAPI/PlatformEfl.cmake: 12 * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp: Added. 13 (TestWebKitAPI): 14 (TestWebKitAPI::TEST): 15 1 16 2013-05-29 Yong Li <yong.li.webkit@outlook.com> 2 17 -
trunk/Tools/TestWebKitAPI/PlatformEfl.cmake
r149073 r150893 95 95 WKURL 96 96 WillSendSubmitEvent 97 CoordinatedGraphics/WKViewUserViewportToContents 97 98 efl/WKViewClientWebProcessCallbacks 98 99 )
Note: See TracChangeset
for help on using the changeset viewer.