summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/android/jni')
-rw-r--r--Source/WebKit/android/jni/WebCoreJniOnLoad.cpp2
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp59
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h9
3 files changed, 3 insertions, 67 deletions
diff --git a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
index e9d7bc3..bb71bf5 100644
--- a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
+++ b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp
@@ -304,7 +304,7 @@ EXPORT void benchmark(const char* url, int reloadCount, int width, int height) {
bmp.setConfig(SkBitmap::kARGB_8888_Config, width, height);
bmp.allocPixels();
SkCanvas canvas(bmp);
- PlatformGraphicsContext ctx(&canvas, NULL);
+ PlatformGraphicsContext ctx(&canvas);
GraphicsContext gc(&ctx);
frame->view()->paintContents(&gc, IntRect(0, 0, width, height));
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index d7a61aa..0708d5c 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;
}
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index ea57c11..acde590 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -595,21 +595,12 @@ namespace android {
IntPoint m_cursorLocation;
void* m_cursorNode;
static Mutex gCursorBoundsMutex;
- // These two fields go together: we use the mutex to protect access to
- // m_buttons, so that we, and webview.cpp can look/modify the m_buttons
- // field safely from our respective threads
- static Mutex gButtonMutex;
- WTF::Vector<Container> m_buttons;
// end of shared members
// internal functions
private:
CacheBuilder& cacheBuilder();
WebCore::Node* currentFocus();
- // Compare the new set of buttons to the old one. All of the new
- // buttons either replace our old ones or should be added to our list.
- // Then check the old buttons to see if any are no longer needed.
- void updateButtonList(WTF::Vector<Container>* buttons);
// Create a set of pictures to represent the drawn DOM, driven by
// the invalidated region and the time required to draw (used to draw)
void recordPictureSet(PictureSet* master);