summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-03-27 07:52:39 -0700
committerJean-Baptiste Queru <jbq@google.com>2012-03-27 07:52:39 -0700
commit6724577b4f05455bc7bf6e4caa5f29361b7c898b (patch)
tree5cc813c45b428b81abf0bee666360aa558847b31
parentff1fac5a46092b3224b789b10a0989d50f0f1746 (diff)
parent4c0d3b517cc129d70fd51a2010ab839c088d7db6 (diff)
downloadexternal_webkit-6724577b4f05455bc7bf6e4caa5f29361b7c898b.zip
external_webkit-6724577b4f05455bc7bf6e4caa5f29361b7c898b.tar.gz
external_webkit-6724577b4f05455bc7bf6e4caa5f29361b7c898b.tar.bz2
Merge 4c0d3b51
Change-Id: I11384be619b8147cc0a335ee134eb6e91a495398
-rw-r--r--Source/WebCore/platform/graphics/android/TexturesGenerator.cpp5
-rw-r--r--Source/WebCore/platform/graphics/android/TexturesGenerator.h7
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.h19
4 files changed, 9 insertions, 28 deletions
diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
index bccb99b..ff41689 100644
--- a/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
+++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.cpp
@@ -104,7 +104,7 @@ void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter, bool
// The solution is use this as a flag to tell Tex Gen thread that
// UI thread is waiting now, Tex Gen thread should not wait for the
// queue any more.
- TilesManager::instance()->transferQueue()->interruptTransferQueue(true);
+ m_tilesManager->transferQueue()->interruptTransferQueue(true);
}
delete filter;
@@ -122,7 +122,6 @@ void TexturesGenerator::removeOperationsForFilter(OperationFilter* filter, bool
status_t TexturesGenerator::readyToRun()
{
- TilesManager::instance()->markGeneratorAsReady();
XLOG("Thread ready to run");
return NO_ERROR;
}
@@ -192,7 +191,7 @@ bool TexturesGenerator::threadLoop()
stop = true;
if (m_waitForCompletion) {
m_waitForCompletion = false;
- TilesManager::instance()->transferQueue()->interruptTransferQueue(false);
+ m_tilesManager->transferQueue()->interruptTransferQueue(false);
mRequestedOperationsCond.signal();
}
mRequestedOperationsLock.unlock();
diff --git a/Source/WebCore/platform/graphics/android/TexturesGenerator.h b/Source/WebCore/platform/graphics/android/TexturesGenerator.h
index 2e3b6b4..9299e87 100644
--- a/Source/WebCore/platform/graphics/android/TexturesGenerator.h
+++ b/Source/WebCore/platform/graphics/android/TexturesGenerator.h
@@ -39,12 +39,14 @@ using namespace android;
class BaseLayerAndroid;
class LayerAndroid;
+class TilesManager;
class TexturesGenerator : public Thread {
public:
- TexturesGenerator() : Thread(false)
+ TexturesGenerator(TilesManager* instance) : Thread(false)
, m_waitForCompletion(false)
- , m_currentOperation(0) { }
+ , m_currentOperation(0)
+ , m_tilesManager(instance) { }
virtual ~TexturesGenerator() { }
virtual status_t readyToRun();
@@ -63,6 +65,7 @@ private:
android::Condition mRequestedOperationsCond;
bool m_waitForCompletion;
QueuedOperation* m_currentOperation;
+ TilesManager* m_tilesManager;
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index 62324d7..e329524 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -112,7 +112,7 @@ TilesManager::TilesManager()
m_availableTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_tilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_availableTilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
- m_pixmapsGenerationThread = new TexturesGenerator();
+ m_pixmapsGenerationThread = new TexturesGenerator(this);
m_pixmapsGenerationThread->run("TexturesGenerator");
}
@@ -411,7 +411,6 @@ void TilesManager::setMaxLayerTextureCount(int max)
m_hasLayerTextures = true;
}
-
float TilesManager::tileWidth()
{
return TILE_WIDTH;
@@ -488,9 +487,6 @@ TilesManager* TilesManager::instance()
if (!gInstance) {
gInstance = new TilesManager();
XLOG("instance(), new gInstance is %x", gInstance);
- XLOG("Waiting for the generator...");
- gInstance->waitForGenerator();
- XLOG("Generator ready!");
}
return gInstance;
}
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h
index 9782fbb..9493855 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.h
+++ b/Source/WebCore/platform/graphics/android/TilesManager.h
@@ -49,6 +49,7 @@ class PaintedSurface;
class TilesManager {
public:
+ // May only be called from the UI thread
static TilesManager* instance();
static GLint getMaxTextureSize();
static int getMaxTextureAllocation();
@@ -93,15 +94,6 @@ public:
BaseTileTexture* getAvailableTexture(BaseTile* owner);
- void markGeneratorAsReady()
- {
- {
- android::Mutex::Autolock lock(m_generatorLock);
- m_generatorReady = true;
- }
- m_generatorReadyCond.signal();
- }
-
void printTextures();
void resetTextureUsage(TiledPage* page);
@@ -202,13 +194,6 @@ public:
private:
TilesManager();
- void waitForGenerator()
- {
- android::Mutex::Autolock lock(m_generatorLock);
- while (!m_generatorReady)
- m_generatorReadyCond.wait(m_generatorLock);
- }
-
void deallocateTexturesVector(unsigned long long sparedDrawCount,
WTF::Vector<BaseTileTexture*>& textures);
@@ -235,8 +220,6 @@ private:
sp<TexturesGenerator> m_pixmapsGenerationThread;
android::Mutex m_texturesLock;
- android::Mutex m_generatorLock;
- android::Condition m_generatorReadyCond;
static TilesManager* gInstance;