| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CCTextureUpdateController_h | 5 #ifndef CCTextureUpdateController_h |
| 6 #define CCTextureUpdateController_h | 6 #define CCTextureUpdateController_h |
| 7 | 7 |
| 8 #include "CCTextureUpdateQueue.h" | 8 #include "CCTextureUpdateQueue.h" |
| 9 #include "CCTimer.h" | 9 #include "CCTimer.h" |
| 10 #include <wtf/Noncopyable.h> | 10 #include <wtf/Noncopyable.h> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void onTimerFired() OVERRIDE; | 41 virtual void onTimerFired() OVERRIDE; |
| 42 | 42 |
| 43 // Virtual for testing. | 43 // Virtual for testing. |
| 44 virtual double monotonicTimeNow() const; | 44 virtual double monotonicTimeNow() const; |
| 45 virtual double updateMoreTexturesTime() const; | 45 virtual double updateMoreTexturesTime() const; |
| 46 virtual size_t updateMoreTexturesSize() const; | 46 virtual size_t updateMoreTexturesSize() const; |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 CCTextureUpdateController(CCTextureUpdateControllerClient*, CCThread*, PassO
wnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureUploader*); | 49 CCTextureUpdateController(CCTextureUpdateControllerClient*, CCThread*, PassO
wnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureUploader*); |
| 50 | 50 |
| 51 static size_t maxFullUpdatesPerTick(TextureUploader*); |
| 52 |
| 51 // This returns true when there were textures left to update. | 53 // This returns true when there were textures left to update. |
| 52 bool updateMoreTexturesIfEnoughTimeRemaining(); | 54 bool updateMoreTexturesIfEnoughTimeRemaining(); |
| 53 void updateMoreTexturesNow(); | 55 void updateMoreTexturesNow(); |
| 54 | 56 |
| 55 CCTextureUpdateControllerClient* m_client; | 57 CCTextureUpdateControllerClient* m_client; |
| 56 OwnPtr<CCTimer> m_timer; | 58 OwnPtr<CCTimer> m_timer; |
| 57 OwnPtr<CCTextureUpdateQueue> m_queue; | 59 OwnPtr<CCTextureUpdateQueue> m_queue; |
| 58 bool m_contentsTexturesPurged; | 60 bool m_contentsTexturesPurged; |
| 59 CCResourceProvider* m_resourceProvider; | 61 CCResourceProvider* m_resourceProvider; |
| 60 TextureUploader* m_uploader; | 62 TextureUploader* m_uploader; |
| 61 double m_monotonicTimeLimit; | 63 double m_monotonicTimeLimit; |
| 64 size_t m_textureUpdatesPerTick; |
| 62 bool m_firstUpdateAttempt; | 65 bool m_firstUpdateAttempt; |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 } | 68 } |
| 66 | 69 |
| 67 #endif // CCTextureUpdateController_h | 70 #endif // CCTextureUpdateController_h |
| OLD | NEW |