Permalink
Browse files

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
  • Loading branch information...
1 parent a04354f commit ececd484e5832707be4a73b70da37f862eb14c35 @ChrisCraik ChrisCraik committed with Nicolas Roard Oct 25, 2011
@@ -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;
}
@@ -42,7 +42,7 @@ class LayerAndroid;
class TexturesGenerator : public Thread {
public:
- TexturesGenerator() : Thread()
+ TexturesGenerator() : Thread(false)
, m_waitForCompletion(false)
, m_currentOperation(0) { }
virtual ~TexturesGenerator() { }
@@ -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()

0 comments on commit ececd48

Please sign in to comment.