summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-10-24 18:39:29 -0700
committerNicolas Roard <nicolasroard@google.com>2011-11-04 16:50:05 -0700
commitececd484e5832707be4a73b70da37f862eb14c35 (patch)
treefc5102102edaebb52e8a6981e31e4f4236b4e340 /Source
parenta04354fb5e0e9ca42a4659611f57f274595129b2 (diff)
downloadexternal_webkit-ececd484e5832707be4a73b70da37f862eb14c35.zip
external_webkit-ececd484e5832707be4a73b70da37f862eb14c35.tar.gz
external_webkit-ececd484e5832707be4a73b70da37f862eb14c35.tar.bz2
Doesn't lock the entire drawing...
This caused us to potentially waiting on the completion of a tile painting. On sites where skia struggle with, this had a large impact on scrolling performances. This is only part one of the solution -- we need to also get rid of the global button lock. We also lower the priority of the texture gneeration thread. bug:5558699 Change-Id: I251354d6cabb2fd7ebfd665c30eff7fe90c3d316
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/TexturesGenerator.h2
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp2
3 files changed, 9 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index e53a1e1..a1766d0 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -236,12 +236,16 @@ void GLWebViewState::inval(const IntRect& rect)
unsigned int GLWebViewState::paintBaseLayerContent(SkCanvas* canvas)
{
- android::Mutex::Autolock lock(m_baseLayerLock);
- if (m_paintingBaseLayer) {
+ m_baseLayerLock.lock();
+ BaseLayerAndroid* base = m_paintingBaseLayer;
+ SkSafeRef(base);
+ m_baseLayerLock.unlock();
+ if (base) {
m_globalButtonMutex->lock();
- m_paintingBaseLayer->drawCanvas(canvas);
+ base->drawCanvas(canvas);
m_globalButtonMutex->unlock();
}
+ SkSafeUnref(base);
return m_currentPictureCounter;
}
diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.h b/Source/WebCore/platform/graphics/android/TexturesGenerator.h
index 19ab1af..2e3b6b4 100644
--- a/Source/WebCore/platform/graphics/android/TexturesGenerator.h
+++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.h
@@ -42,7 +42,7 @@ class LayerAndroid;
class TexturesGenerator : public Thread {
public:
- TexturesGenerator() : Thread()
+ TexturesGenerator() : Thread(false)
, m_waitForCompletion(false)
, m_currentOperation(0) { }
virtual ~TexturesGenerator() { }
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index dd2b169..d36017f 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -107,7 +107,7 @@ TilesManager::TilesManager()
m_tilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_availableTilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_pixmapsGenerationThread = new TexturesGenerator();
- m_pixmapsGenerationThread->run("TexturesGenerator");
+ m_pixmapsGenerationThread->run("TexturesGenerator", android::PRIORITY_BACKGROUND);
}
void TilesManager::allocateTiles()