| 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 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 static PassOwnPtr<CCTextureUpdateController> create(CCTextureUpdateControlle
rClient* client, CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCRes
ourceProvider* resourceProvider, TextureUploader* uploader) | 28 static PassOwnPtr<CCTextureUpdateController> create(CCTextureUpdateControlle
rClient* client, CCThread* thread, PassOwnPtr<CCTextureUpdateQueue> queue, CCRes
ourceProvider* resourceProvider, TextureUploader* uploader) |
| 29 { | 29 { |
| 30 return adoptPtr(new CCTextureUpdateController(client, thread, queue, res
ourceProvider, uploader)); | 30 return adoptPtr(new CCTextureUpdateController(client, thread, queue, res
ourceProvider, uploader)); |
| 31 } | 31 } |
| 32 static size_t maxPartialTextureUpdates(); | 32 static size_t maxPartialTextureUpdates(); |
| 33 static void updateTextures(CCResourceProvider*, TextureUploader*, CCTextureU
pdateQueue*); | 33 static void updateTextures(CCResourceProvider*, TextureUploader*, CCTextureU
pdateQueue*); |
| 34 | 34 |
| 35 virtual ~CCTextureUpdateController(); | 35 virtual ~CCTextureUpdateController(); |
| 36 | 36 |
| 37 // Discard uploads to textures that were evicted on the impl thread. |
| 38 void discardUploadsToEvictedResources(); |
| 39 |
| 37 void performMoreUpdates(double monotonicTimeLimit); | 40 void performMoreUpdates(double monotonicTimeLimit); |
| 38 void finalize(); | 41 void finalize(); |
| 39 | 42 |
| 40 // CCTimerClient implementation. | 43 // CCTimerClient implementation. |
| 41 virtual void onTimerFired() OVERRIDE; | 44 virtual void onTimerFired() OVERRIDE; |
| 42 | 45 |
| 43 // Virtual for testing. | 46 // Virtual for testing. |
| 44 virtual double monotonicTimeNow() const; | 47 virtual double monotonicTimeNow() const; |
| 45 virtual double updateMoreTexturesTime() const; | 48 virtual double updateMoreTexturesTime() const; |
| 46 virtual size_t updateMoreTexturesSize() const; | 49 virtual size_t updateMoreTexturesSize() const; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 bool m_contentsTexturesPurged; | 61 bool m_contentsTexturesPurged; |
| 59 CCResourceProvider* m_resourceProvider; | 62 CCResourceProvider* m_resourceProvider; |
| 60 TextureUploader* m_uploader; | 63 TextureUploader* m_uploader; |
| 61 double m_monotonicTimeLimit; | 64 double m_monotonicTimeLimit; |
| 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 |