summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp4
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.h2
-rw-r--r--WebCore/platform/graphics/android/android_graphics.cpp21
-rw-r--r--WebCore/platform/graphics/android/android_graphics.h1
-rw-r--r--WebKit/android/nav/WebView.cpp15
5 files changed, 28 insertions, 15 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index 5ba094b..53d5c5e 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -127,7 +127,7 @@ void GLWebViewState::unlockBaseLayerUpdate() {
}
void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture,
- const IntRect& rect)
+ const IntRect& rect, bool allowSame)
{
android::Mutex::Autolock lock(m_baseLayerLock);
if (!m_baseLayerUpdate)
@@ -135,7 +135,7 @@ void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture,
layer->setExtra(picture);
- if (m_lastInval == rect)
+ if (!allowSame && m_lastInval == rect)
return;
if (!rect.isEmpty())
diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h
index 2082f2c..d28c16a 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.h
+++ b/WebCore/platform/graphics/android/GLWebViewState.h
@@ -169,7 +169,7 @@ public:
unsigned int paintBaseLayerContent(SkCanvas* canvas);
void setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect);
- void setExtra(BaseLayerAndroid*, SkPicture&, const IntRect&);
+ void setExtra(BaseLayerAndroid*, SkPicture&, const IntRect&, bool allowSame);
void scheduleUpdate(const double& currentTime, const SkIRect& viewport, float scale);
TiledPage* sibling(TiledPage* page);
diff --git a/WebCore/platform/graphics/android/android_graphics.cpp b/WebCore/platform/graphics/android/android_graphics.cpp
index c046858..e50cfec 100644
--- a/WebCore/platform/graphics/android/android_graphics.cpp
+++ b/WebCore/platform/graphics/android/android_graphics.cpp
@@ -109,14 +109,8 @@ void CursorRing::draw(SkCanvas* canvas, LayerAndroid* layer, IntRect* inval)
inval->unite(m_lastBounds);
}
-bool CursorRing::setup()
+void CursorRing::setIsButton(const CachedNode* node)
{
- m_node->localCursorRings(m_frame, &m_rings);
- if (!m_rings.size()) {
- DBG_NAV_LOG("!rings.size()");
- m_viewImpl->m_hasCursorBounds = false;
- return false;
- }
m_isButton = false;
m_viewImpl->gButtonMutex.lock();
// If this is a button drawn by us (rather than webkit) do not draw the
@@ -124,7 +118,7 @@ bool CursorRing::setup()
// Should be in sync with recordButtons, since that will be called
// before this.
if (m_viewImpl->m_buttons.size() > 0) {
- WebCore::Node* cursorPointer = (WebCore::Node*) m_node->nodePointer();
+ WebCore::Node* cursorPointer = (WebCore::Node*) node->nodePointer();
Container* end = m_viewImpl->m_buttons.end();
for (Container* ptr = m_viewImpl->m_buttons.begin(); ptr != end; ptr++) {
if (ptr->matches(cursorPointer)) {
@@ -134,6 +128,17 @@ bool CursorRing::setup()
}
}
m_viewImpl->gButtonMutex.unlock();
+}
+
+bool CursorRing::setup()
+{
+ m_node->localCursorRings(m_frame, &m_rings);
+ if (!m_rings.size()) {
+ DBG_NAV_LOG("!rings.size()");
+ m_viewImpl->m_hasCursorBounds = false;
+ return false;
+ }
+ setIsButton(m_node);
m_bounds = m_node->localBounds(m_frame);
m_viewImpl->updateCursorBounds(m_root, m_frame, m_node);
diff --git a/WebCore/platform/graphics/android/android_graphics.h b/WebCore/platform/graphics/android/android_graphics.h
index 9f52a27..be309a6 100644
--- a/WebCore/platform/graphics/android/android_graphics.h
+++ b/WebCore/platform/graphics/android/android_graphics.h
@@ -54,6 +54,7 @@ public:
CursorRing(WebViewCore* core) : m_viewImpl(core) {}
virtual ~CursorRing() {}
virtual void draw(SkCanvas* , LayerAndroid* , IntRect* );
+ void setIsButton(const CachedNode* );
bool setup();
private:
friend class WebView;
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 948ea6b..deb2b28 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -303,10 +303,8 @@ void nativeRecordButtons(bool hasFocus, bool pressed, bool invalidate)
if (hasFocus) {
if (pressed || m_ring.m_isPressed)
state = RenderSkinAndroid::kPressed;
- else if (SkTime::GetMSecs() < m_ringAnimationEnd
- && m_ringAnimationEnd != UINT_MAX) {
+ else if (SkTime::GetMSecs() < m_ringAnimationEnd)
state = RenderSkinAndroid::kFocused;
- }
}
}
ptr->updateFocusState(state);
@@ -390,6 +388,7 @@ bool drawCursorPreamble(CachedRoot* root)
resetCursorRing();
return false;
}
+ m_ring.setIsButton(node);
if (node->isHidden()) {
DBG_NAV_LOG("node->isHidden()");
m_viewImpl->m_hasCursorBounds = false;
@@ -473,6 +472,7 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras)
SkPicture picture;
IntRect rect(0, 0, 0, 0);
+ bool allowSame = false;
if (extra) {
LayerAndroid mainPicture(m_navPictureUI);
PictureSet* content = m_baseLayer->content();
@@ -480,8 +480,15 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras)
content->height());
extra->draw(canvas, &mainPicture, &rect);
picture.endRecording();
+ } else if (extras == DrawExtrasCursorRing && m_ring.m_isButton) {
+ const CachedFrame* cachedFrame;
+ const CachedNode* cachedCursor = root->currentCursor(&cachedFrame);
+ if (cachedCursor) {
+ rect = cachedCursor->bounds(cachedFrame);
+ allowSame = true;
+ }
}
- m_glWebViewState->setExtra(m_baseLayer, picture, rect);
+ m_glWebViewState->setExtra(m_baseLayer, picture, rect, allowSame);
LayerAndroid* compositeLayer = compositeRoot();
if (compositeLayer)