[BlackBerry] Syncing up left over bits in WebKitSupport from our local branch to...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 23:46:15 +0000 (23:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 23:46:15 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81118

Patch by Nima Ghanavatian <nghanavatian@rim.com> on 2012-03-16
Reviewed by Rob Buis.

This is a consolidation of various changes that are in our local dev branch
but do not appear in our upstreamed port.

* WebKitSupport/DumpRenderTreeSupport.cpp:
(DumpRenderTreeSupport::computedStyleIncludingVisitedInfo):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::isElementClickable):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::spannableTextInRange):
* WebKitSupport/SurfacePool.cpp:
(BlackBerry::WebKit::SurfacePool::createBuffers):
(BlackBerry::WebKit::SurfacePool::releaseBuffers):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
(BlackBerry::WebKit::TouchEventHandler::handleFatFingerPressed):
* WebKitSupport/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
* WebKitSupport/WebPageCompositor.h:
(WebPageCompositor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp
Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp
Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.cpp
Source/WebKit/blackberry/WebKitSupport/WebPageCompositor.h

index f5c3f39979a27bf7520bb67a22d0cc82ac7f893d..40d121edc033032a200218083d7256a5505a1d2b 100644 (file)
@@ -1,3 +1,30 @@
+2012-03-16  Nima Ghanavatian  <nghanavatian@rim.com>
+
+        [BlackBerry] Syncing up left over bits in WebKitSupport from our local branch to upstream
+        https://bugs.webkit.org/show_bug.cgi?id=81118
+
+        Reviewed by Rob Buis.
+
+        This is a consolidation of various changes that are in our local dev branch
+        but do not appear in our upstreamed port.
+
+        * WebKitSupport/DumpRenderTreeSupport.cpp:
+        (DumpRenderTreeSupport::computedStyleIncludingVisitedInfo):
+        * WebKitSupport/FatFingers.cpp:
+        (BlackBerry::WebKit::FatFingers::isElementClickable):
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::spannableTextInRange):
+        * WebKitSupport/SurfacePool.cpp:
+        (BlackBerry::WebKit::SurfacePool::createBuffers):
+        (BlackBerry::WebKit::SurfacePool::releaseBuffers):
+        * WebKitSupport/TouchEventHandler.cpp:
+        (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+        (BlackBerry::WebKit::TouchEventHandler::handleFatFingerPressed):
+        * WebKitSupport/WebPageCompositor.cpp:
+        (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
+        * WebKitSupport/WebPageCompositor.h:
+        (WebPageCompositor):
+
 2012-03-16  Nima Ghanavatian  <nghanavatian@rim.com>
 
         [BlackBerry] Syncing up left over bits in WebCoreSupport from our local branch to upstream
index 31f1dcf41e0ef205b435468518e1a95ed47c2ef6..8c7d2b8d27d222bd14ba6e43b81ce3f65a69f890 100644 (file)
@@ -150,7 +150,7 @@ JSValueRef DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(JSContextRef
         return JSValueMakeUndefined(context);
     JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
     Element* element = jsElement->impl();
-    RefPtr<CSSComputedStyleDeclaration> style = computedStyle(element, true);
+    RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
     return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
 }
 
index 016a4262035958db406893ee5f7302e61f8fc80c..b49e2485cd73194cc0d5f5cd89df3803087de476 100644 (file)
@@ -110,7 +110,7 @@ bool FatFingers::isElementClickable(Element* element) const
         // Notice, B is not a hyperlink, or form control, and does not register any mouse event handler. Then B cannot
         // be clicked. Suppose B specified the CSS property "cursor: pointer". Then, B will be considered as clickable.
         return hasMousePressListener(element)
-            || computedStyle(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer";
+            || CSSComputedStyleDeclaration::create(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer";
     default:
         ASSERT_NOT_REACHED();
     }
index 7c03da978adb4e3dff65472cace1cc254a9b1a5c..ef698a95445d4f3cac41f11ad2abdff310c6b3a3 100644 (file)
@@ -1306,6 +1306,7 @@ spannable_string_t* InputHandler::spannableTextInRange(int start, int end, int32
     pst->length = stringLength;
     pst->spans_count = 0;
     pst->spans = 0;
+
     return pst;
 }
 
index 5f0a2770acb83f2b4efecfe101b652e907086db0..bf2a58da1c1458c4ebf5c6af695ecf286397eb18 100644 (file)
@@ -155,7 +155,7 @@ std::string SurfacePool::sharedPixmapGroup() const
 
 void SurfacePool::createBuffers()
 {
-    if (!m_initialized || m_tilePool.isEmpty())
+    if (!m_initialized || m_tilePool.isEmpty() || !m_buffersSuspended)
         return;
 
     // Create the tile pool.
@@ -173,7 +173,7 @@ void SurfacePool::createBuffers()
 
 void SurfacePool::releaseBuffers()
 {
-    if (!m_initialized || m_tilePool.isEmpty())
+    if (!m_initialized || m_tilePool.isEmpty() || m_buffersSuspended)
         return;
 
     m_buffersSuspended = true;
@@ -181,16 +181,20 @@ void SurfacePool::releaseBuffers()
     // Release the tile pool.
     for (size_t i = 0; i < m_tilePool.size(); ++i) {
         m_tilePool[i]->frontBuffer()->clearRenderedRegion();
+        // Clear the buffer to prevent accidental leakage of (possibly sensitive) pixel data.
+        BlackBerry::Platform::Graphics::clearBuffer(m_tilePool[i]->frontBuffer()->nativeBuffer(), 0, 0, 0, 0);
         BlackBerry::Platform::Graphics::destroyPixmapBuffer(m_tilePool[i]->frontBuffer()->nativeBuffer());
     }
 
     if (m_visibleTileBuffer) {
         m_visibleTileBuffer->frontBuffer()->clearRenderedRegion();
+        BlackBerry::Platform::Graphics::clearBuffer(m_visibleTileBuffer->frontBuffer()->nativeBuffer(), 0, 0, 0, 0);
         BlackBerry::Platform::Graphics::destroyPixmapBuffer(m_visibleTileBuffer->frontBuffer()->nativeBuffer());
     }
 
     if (backBuffer()) {
         backBuffer()->clearRenderedRegion();
+        BlackBerry::Platform::Graphics::clearBuffer(backBuffer()->nativeBuffer(), 0, 0, 0, 0);
         BlackBerry::Platform::Graphics::destroyPixmapBuffer(backBuffer()->nativeBuffer());
     }
 }
index 6eea1321a72f7cb459fb8c39d6ac8f270538683b..e36eaf768ccd578371f4983e8db92c7755fc4501 100644 (file)
@@ -237,7 +237,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point)
             } else // Fat finger point in viewport coordinates.
                 adjustedPoint = m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition());
 
-            PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, MouseEventReleased, 1, LeftButton, TouchScreen);
+            PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, PlatformEvent::MouseReleased, 1, LeftButton, TouchScreen);
             m_webPage->handleMouseEvent(mouseEvent);
             m_lastFatFingersResult.reset(); // Reset the fat finger result as its no longer valid when a user's finger is not on the screen.
 
@@ -251,7 +251,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point)
         }
     case Platform::TouchPoint::TouchMoved:
         if (m_convertTouchToMouse) {
-            PlatformMouseEvent mouseEvent(point.m_pos, m_lastScreenPoint, MouseEventMoved, 1, LeftButton, TouchScreen);
+            PlatformMouseEvent mouseEvent(point.m_pos, m_lastScreenPoint, PlatformEvent::MouseMoved, 1, LeftButton, TouchScreen);
             m_lastScreenPoint = point.m_screenPos;
             if (!m_webPage->handleMouseEvent(mouseEvent)) {
                 m_convertTouchToMouse = false;
@@ -294,13 +294,12 @@ unsigned TouchEventHandler::spellCheck(Platform::TouchPoint& touchPoint)
 void TouchEventHandler::handleFatFingerPressed()
 {
     if (!m_didCancelTouch) {
-
         // First update the mouse position with a MouseMoved event.
-        PlatformMouseEvent mouseMoveEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, MouseEventMoved, 0, LeftButton, TouchScreen);
+        PlatformMouseEvent mouseMoveEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, PlatformEvent::MouseMoved, 0, LeftButton, TouchScreen);
         m_webPage->handleMouseEvent(mouseMoveEvent);
 
         // Then send the MousePressed event.
-        PlatformMouseEvent mousePressedEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, MouseEventPressed, 1, LeftButton, TouchScreen);
+        PlatformMouseEvent mousePressedEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, PlatformEvent::MousePressed, 1, LeftButton, TouchScreen);
         m_webPage->handleMouseEvent(mousePressedEvent);
     }
 }
index b147db5342f66e514fcd217c42768375e928c7f3..3825fd0fb9862620e8fa51b734436ec1258d9d99 100644 (file)
@@ -38,7 +38,8 @@ namespace WebKit {
 
 WebPageCompositor::WebPageCompositor(WebPagePrivate* page)
     : m_webPage(page)
-    , m_layerRenderer(LayerRenderer::create(page->m_page))
+    , m_context(GLES2Context::create(page))
+    , m_layerRenderer(LayerRenderer::create(m_context.get()))
     , m_generation(0)
     , m_compositedGeneration(-1)
     , m_backingStoreUsesOpenGL(false)
index 5f3debfe5c7c50034b5c0db465d70c24bac16068..70460e32c66647307814d0784235337d36c7c5ed 100644 (file)
@@ -21,6 +21,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
+#include "GLES2Context.h"
 #include "LayerCompositingThread.h"
 #include "LayerRenderer.h"
 
@@ -68,6 +69,8 @@ private:
     void animationTimerFired();
 
     WebPagePrivate* m_webPage;
+    // Please maintain this order since m_layerRenderer depends on m_context in initialization list.
+    OwnPtr<GLES2Context> m_context;
     OwnPtr<WebCore::LayerRenderer> m_layerRenderer;
     RefPtr<WebCore::LayerCompositingThread> m_rootLayer;
     WebCore::IntRect m_layoutRectForCompositing;