diff options
author | John Reck <jreck@google.com> | 2011-11-07 23:25:15 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-07 23:25:15 +0000 |
commit | d7abaddf5e1d8a8e5caf8c2af18699d98be8b8bf (patch) | |
tree | 57a1657112eb5d7cd596050b52c3b3ab2f9bf8cf /Source/WebKit/android/jni/WebViewCore.cpp | |
parent | 557336db0d2cffe6f0e9213da1cb34676a02f178 (diff) | |
parent | 82ccbd8ce95211b4b5afad6a653462fd3beb771b (diff) | |
download | external_webkit-d7abaddf5e1d8a8e5caf8c2af18699d98be8b8bf.zip external_webkit-d7abaddf5e1d8a8e5caf8c2af18699d98be8b8bf.tar.gz external_webkit-d7abaddf5e1d8a8e5caf8c2af18699d98be8b8bf.tar.bz2 |
am 82ccbd8c: Remove the global button lock
* commit '82ccbd8ce95211b4b5afad6a653462fd3beb771b':
Remove the global button lock
Diffstat (limited to 'Source/WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 59 |
1 files changed, 2 insertions, 57 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index f3eac89..491a58c 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -336,7 +336,6 @@ static jmethodID GetJMethod(JNIEnv* env, jclass clazz, const char name[], const } Mutex WebViewCore::gFrameCacheMutex; -Mutex WebViewCore::gButtonMutex; Mutex WebViewCore::gCursorBoundsMutex; WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* mainframe) @@ -560,19 +559,10 @@ void WebViewCore::recordPicture(SkPicture* picture) view->contentsHeight(), PICT_RECORD_FLAGS); SkAutoMemoryUsageProbe mup(__FUNCTION__); - // Copy m_buttons so we can pass it to our graphics context. - gButtonMutex.lock(); - WTF::Vector<Container> buttons(m_buttons); - gButtonMutex.unlock(); - - WebCore::PlatformGraphicsContext pgc(arp.getRecordingCanvas(), &buttons); + WebCore::PlatformGraphicsContext pgc(arp.getRecordingCanvas()); WebCore::GraphicsContext gc(&pgc); view->platformWidget()->draw(&gc, WebCore::IntRect(0, 0, view->contentsWidth(), view->contentsHeight())); - - gButtonMutex.lock(); - updateButtonList(&buttons); - gButtonMutex.unlock(); } void WebViewCore::recordPictureSet(PictureSet* content) @@ -786,43 +776,6 @@ void WebViewCore::recordPictureSet(PictureSet* content) } } -void WebViewCore::updateButtonList(WTF::Vector<Container>* buttons) -{ - // All the entries in buttons are either updates of previous entries in - // m_buttons or they need to be added to it. - Container* end = buttons->end(); - for (Container* updatedContainer = buttons->begin(); - updatedContainer != end; updatedContainer++) { - bool updated = false; - // Search for a previous entry that references the same node as our new - // data - Container* lastPossibleMatch = m_buttons.end(); - for (Container* possibleMatch = m_buttons.begin(); - possibleMatch != lastPossibleMatch; possibleMatch++) { - if (updatedContainer->matches(possibleMatch->node())) { - // Update our record, and skip to the next one. - possibleMatch->setRect(updatedContainer->rect()); - updated = true; - break; - } - } - if (!updated) { - // This is a brand new button, so append it to m_buttons - m_buttons.append(*updatedContainer); - } - } - size_t i = 0; - // count will decrease each time one is removed, so check count each time. - while (i < m_buttons.size()) { - if (m_buttons[i].canBeRemoved()) { - m_buttons[i] = m_buttons.last(); - m_buttons.removeLast(); - } else { - i++; - } - } -} - // note: updateCursorBounds is called directly by the WebView thread // This needs to be called each time we call CachedRoot::setCursor() with // non-null CachedNode/CachedFrame, since otherwise the WebViewCore's data @@ -877,11 +830,7 @@ SkPicture* WebViewCore::rebuildPicture(const SkIRect& inval) SkAutoMemoryUsageProbe mup(__FUNCTION__); SkCanvas* recordingCanvas = arp.getRecordingCanvas(); - gButtonMutex.lock(); - WTF::Vector<Container> buttons(m_buttons); - gButtonMutex.unlock(); - - WebCore::PlatformGraphicsContext pgc(recordingCanvas, &buttons); + WebCore::PlatformGraphicsContext pgc(recordingCanvas); WebCore::GraphicsContext gc(&pgc); recordingCanvas->translate(-inval.fLeft, -inval.fTop); recordingCanvas->save(); @@ -892,10 +841,6 @@ SkPicture* WebViewCore::rebuildPicture(const SkIRect& inval) m_rebuildInval.getBounds().fLeft, m_rebuildInval.getBounds().fTop, m_rebuildInval.getBounds().fRight, m_rebuildInval.getBounds().fBottom); - gButtonMutex.lock(); - updateButtonList(&buttons); - gButtonMutex.unlock(); - return picture; } |