diff options
author | Chris Craik <ccraik@google.com> | 2012-05-10 18:03:49 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-05-14 18:24:01 -0700 |
commit | 55ff9f5ac537f2b11ae997f1029bdccb87008825 (patch) | |
tree | e51e6c7103d4fe46a0565cc53ed4815e245ef61d /Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h | |
parent | 4ef88beceb0e8d5b2df5bd4e30360ffcb8c2a65d (diff) | |
download | external_webkit-55ff9f5ac537f2b11ae997f1029bdccb87008825.zip external_webkit-55ff9f5ac537f2b11ae997f1029bdccb87008825.tar.gz external_webkit-55ff9f5ac537f2b11ae997f1029bdccb87008825.tar.bz2 |
Defer low res tile rendering to once/second
bug:6434846
Change-Id: I5ba981e6a3e154a1e99873d8fd5317b8ce7bb73b
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h b/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h index bc4fe1e..290ad08 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h +++ b/Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h @@ -44,8 +44,8 @@ class TilesManager; class TexturesGenerator : public Thread { public: TexturesGenerator(TilesManager* instance) : Thread(false) - , m_currentOperation(0) - , m_tilesManager(instance) { } + , m_tilesManager(instance) + , m_deferredMode(false) { } virtual ~TexturesGenerator() { } virtual status_t readyToRun(); @@ -55,6 +55,10 @@ public: void scheduleOperation(QueuedOperation* operation); + // low res tiles are put at or above this cutoff when not scrolling, + // signifying that they should be deferred + static const int gDeferPriorityCutoff = 500000000; + private: QueuedOperation* popNext(); virtual bool threadLoop(); @@ -62,8 +66,13 @@ private: WTF::HashMap<void*, QueuedOperation*> mRequestedOperationsHash; android::Mutex mRequestedOperationsLock; android::Condition mRequestedOperationsCond; - QueuedOperation* m_currentOperation; TilesManager* m_tilesManager; + + bool m_deferredMode; + + // defer painting for one second if best in queue has priority + // QueuedOperation::gDeferPriorityCutoff or higher + static const nsecs_t gDeferNsecs = 1000000000; }; } // namespace WebCore |