From 55ff9f5ac537f2b11ae997f1029bdccb87008825 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Thu, 10 May 2012 18:03:49 -0700 Subject: Defer low res tile rendering to once/second bug:6434846 Change-Id: I5ba981e6a3e154a1e99873d8fd5317b8ce7bb73b --- .../graphics/android/rendering/TexturesGenerator.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Source/WebCore/platform/graphics/android/rendering/TexturesGenerator.h') 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 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 -- cgit v1.1