| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void onTimerFired() OVERRIDE; | 42 virtual void onTimerFired() OVERRIDE; |
| 43 | 43 |
| 44 // Virtual for testing. | 44 // Virtual for testing. |
| 45 virtual double monotonicTimeNow() const; | 45 virtual double monotonicTimeNow() const; |
| 46 virtual double updateMoreTexturesTime() const; | 46 virtual double updateMoreTexturesTime() const; |
| 47 virtual size_t updateMoreTexturesSize() const; | 47 virtual size_t updateMoreTexturesSize() const; |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 CCTextureUpdateController(CCTextureUpdateControllerClient*, CCThread*, PassO
wnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureCopier*, TextureUploade
r*); | 50 CCTextureUpdateController(CCTextureUpdateControllerClient*, CCThread*, PassO
wnPtr<CCTextureUpdateQueue>, CCResourceProvider*, TextureCopier*, TextureUploade
r*); |
| 51 | 51 |
| 52 static size_t maxFullUpdatesPerTick(TextureUploader*); |
| 53 |
| 52 // This returns true when there were textures left to update. | 54 // This returns true when there were textures left to update. |
| 53 bool updateMoreTexturesIfEnoughTimeRemaining(); | 55 bool updateMoreTexturesIfEnoughTimeRemaining(); |
| 54 void updateMoreTexturesNow(); | 56 void updateMoreTexturesNow(); |
| 55 | 57 |
| 56 CCTextureUpdateControllerClient* m_client; | 58 CCTextureUpdateControllerClient* m_client; |
| 57 OwnPtr<CCTimer> m_timer; | 59 OwnPtr<CCTimer> m_timer; |
| 58 OwnPtr<CCTextureUpdateQueue> m_queue; | 60 OwnPtr<CCTextureUpdateQueue> m_queue; |
| 59 bool m_contentsTexturesPurged; | 61 bool m_contentsTexturesPurged; |
| 60 CCResourceProvider* m_resourceProvider; | 62 CCResourceProvider* m_resourceProvider; |
| 61 TextureCopier* m_copier; | 63 TextureCopier* m_copier; |
| 62 TextureUploader* m_uploader; | 64 TextureUploader* m_uploader; |
| 63 double m_monotonicTimeLimit; | 65 double m_monotonicTimeLimit; |
| 66 size_t m_textureUpdatesPerTick; |
| 64 bool m_firstUpdateAttempt; | 67 bool m_firstUpdateAttempt; |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } | 70 } |
| 68 | 71 |
| 69 #endif // CCTextureUpdateController_h | 72 #endif // CCTextureUpdateController_h |
| OLD | NEW |