Title: [121049] trunk/Source/WebKit/blackberry
- Revision
- 121049
- Author
- [email protected]
- Date
- 2012-06-22 12:16:28 -0700 (Fri, 22 Jun 2012)
Log Message
[BlackBerry] Tap highlight fade animations are added to overlay continuously during pinch zoom.
https://bugs.webkit.org/show_bug.cgi?id=89772
Patch by Andrew Lo <[email protected]> on 2012-06-22
Reviewed by Antonio Gomes.
When pinch zooming, DefaultTapHighlight::hide is continuously
called from the UI thread. This resulted in fade animations being
created and added to the override overlay continuously.
This patch moves the m_visible check so that it applies for both
threads.
Internal PR164183
* WebKitSupport/DefaultTapHighlight.cpp:
(BlackBerry::WebKit::DefaultTapHighlight::draw):
(BlackBerry::WebKit::DefaultTapHighlight::hide):
* WebKitSupport/DefaultTapHighlight.h:
(DefaultTapHighlight):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/ChangeLog (121048 => 121049)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-06-22 19:10:20 UTC (rev 121048)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-06-22 19:16:28 UTC (rev 121049)
@@ -1,3 +1,25 @@
+2012-06-22 Andrew Lo <[email protected]>
+
+ [BlackBerry] Tap highlight fade animations are added to overlay continuously during pinch zoom.
+ https://bugs.webkit.org/show_bug.cgi?id=89772
+
+ Reviewed by Antonio Gomes.
+
+ When pinch zooming, DefaultTapHighlight::hide is continuously
+ called from the UI thread. This resulted in fade animations being
+ created and added to the override overlay continuously.
+
+ This patch moves the m_visible check so that it applies for both
+ threads.
+
+ Internal PR164183
+
+ * WebKitSupport/DefaultTapHighlight.cpp:
+ (BlackBerry::WebKit::DefaultTapHighlight::draw):
+ (BlackBerry::WebKit::DefaultTapHighlight::hide):
+ * WebKitSupport/DefaultTapHighlight.h:
+ (DefaultTapHighlight):
+
2012-06-22 Yong Li <[email protected]>
[BlackBerry] Set WebSecurityEnabled flag accordingly.
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp (121048 => 121049)
--- trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp 2012-06-22 19:10:20 UTC (rev 121048)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp 2012-06-22 19:16:28 UTC (rev 121049)
@@ -61,7 +61,10 @@
if (rect.isEmpty())
return;
- m_visible = true;
+ {
+ MutexLocker lock(m_mutex);
+ m_visible = true;
+ }
if (!m_overlay) {
m_overlay = adoptPtr(new WebOverlay(this));
@@ -82,18 +85,22 @@
if (!m_overlay)
return;
+ {
+ MutexLocker lock(m_mutex);
+ if (!m_visible)
+ return;
+ m_visible = false;
+ }
+
// Since WebAnimation is not thread safe, we create a new one each time instead of reusing the same object on different
// threads (that would introduce race conditions).
WebAnimation fadeAnimation = WebAnimation::fadeAnimation(fadeAnimationName(), 1.0, 0.0, ActiveTextFadeAnimationDuration);
// Normally, this method is called on the WebKit thread, but it can also be
// called from the compositing thread.
- if (BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread()) {
- if (!m_visible)
- return;
- m_visible = false;
+ if (BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread())
m_overlay->addAnimation(fadeAnimation);
- } else if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread())
+ else if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread())
m_overlay->override()->addAnimation(fadeAnimation);
}
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h (121048 => 121049)
--- trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h 2012-06-22 19:10:20 UTC (rev 121048)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h 2012-06-22 19:16:28 UTC (rev 121049)
@@ -31,6 +31,7 @@
#include <BlackBerryPlatformIntRectRegion.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/Threading.h>
namespace BlackBerry {
namespace WebKit {
@@ -69,6 +70,7 @@
WebCore::Color m_color;
bool m_visible;
bool m_shouldHideAfterScroll;
+ Mutex m_mutex;
};
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes