summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-06-19 18:07:29 -0700
committerChris Craik <ccraik@google.com>2012-06-19 18:20:19 -0700
commitec90800d68fd500bb07f052c81fda0f54a794b1f (patch)
tree842f4f66af2b6f653db51713e5ef63670b72a5c1 /Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp
parentcfad1b4c7cfa8eb502d1263c81f43e37e28ee928 (diff)
downloadexternal_webkit-ec90800d68fd500bb07f052c81fda0f54a794b1f.zip
external_webkit-ec90800d68fd500bb07f052c81fda0f54a794b1f.tar.gz
external_webkit-ec90800d68fd500bb07f052c81fda0f54a794b1f.tar.bz2
Pin renderers to threads instead of tiles
Move thread local bitmaps to renderers, so the renderers own them, and can perform optimizations. Change-Id: I60d604759f4ce2ec9981990d1613eaf23cd1e625
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp
index 4b71b1c..74e663a 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.cpp
@@ -32,6 +32,7 @@
#if USE(ACCELERATED_COMPOSITING)
#include "AndroidLog.h"
+#include "BaseRenderer.h"
#include "GLUtils.h"
#include "PaintTileOperation.h"
#include "TilesManager.h"
@@ -43,9 +44,15 @@ TexturesGenerator::TexturesGenerator(TilesManager* instance)
: Thread(false)
, m_tilesManager(instance)
, m_deferredMode(false)
+ , m_renderer(0)
{
}
+TexturesGenerator::~TexturesGenerator()
+{
+ delete m_renderer;
+}
+
bool TexturesGenerator::tryUpdateOperationWithPainter(Tile* tile, TilePainter* painter)
{
android::Mutex::Autolock lock(mRequestedOperationsLock);
@@ -94,11 +101,7 @@ void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter)
status_t TexturesGenerator::readyToRun()
{
- m_bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- TilesManager::instance()->tileWidth(),
- TilesManager::instance()->tileHeight());
- m_bitmap.allocPixels();
- m_localTid = androidGetTid();
+ m_renderer = BaseRenderer::createRenderer();
return NO_ERROR;
}
@@ -175,7 +178,9 @@ bool TexturesGenerator::threadLoop()
if (currentOperation) {
ALOGV("threadLoop, painting the request with priority %d",
currentOperation->priority());
- currentOperation->run();
+ // swap out the renderer if necessary
+ BaseRenderer::swapRendererIfNeeded(m_renderer);
+ currentOperation->run(m_renderer);
}
mRequestedOperationsLock.lock();