Chromium Code Reviews| 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> |
| 11 #include <wtf/OwnPtr.h> | 11 #include <wtf/OwnPtr.h> |
| 12 | 12 |
| 13 namespace WebCore { | 13 namespace WebCore { |
| 14 | 14 |
| 15 class TextureCopier; | 15 class TextureCopier; |
| 16 class TextureUploader; | 16 class TextureUploader; |
| 17 | 17 |
| 18 class CCTextureUpdateController : public CCTimerClient { | 18 class CCTextureUpdateController : public CCTimerClient { |
| 19 WTF_MAKE_NONCOPYABLE(CCTextureUpdateController); | 19 WTF_MAKE_NONCOPYABLE(CCTextureUpdateController); |
| 20 public: | 20 public: |
| 21 static PassOwnPtr<CCTextureUpdateController> create(CCThread* thread, PassOw nPtr<CCTextureUpdateQueue> queue, CCResourceProvider* resourceProvider, TextureC opier* copier, TextureUploader* uploader) | 21 static PassOwnPtr<CCTextureUpdateController> create(CCThread*, PassOwnPtr<CC TextureUpdateQueue>, CCResourceProvider*, TextureCopier*, TextureUploader*, size _t maxTextureUpdates); |
| 22 { | |
| 23 return adoptPtr(new CCTextureUpdateController(thread, queue, resourcePro vider, copier, uploader)); | |
| 24 } | |
| 25 static size_t maxPartialTextureUpdates(); | |
| 26 static void updateTextures(CCResourceProvider*, TextureCopier*, TextureUploa der*, CCTextureUpdateQueue*, size_t count); | 22 static void updateTextures(CCResourceProvider*, TextureCopier*, TextureUploa der*, CCTextureUpdateQueue*, size_t count); |
| 23 static size_t maxTextureUpdatesDefault(); | |
| 24 static size_t maxTextureUpdates(TextureUploader*); | |
|
reveman
2012/09/15 17:26:19
why are we removing partial from the name? maxText
brianderson
2012/09/17 22:48:27
Renaming back to partial texture updates. Will use
| |
| 27 | 25 |
| 28 virtual ~CCTextureUpdateController(); | 26 virtual ~CCTextureUpdateController(); |
| 29 | 27 |
| 28 | |
|
reveman
2012/09/15 17:26:19
nit: unnecessary newline.
brianderson
2012/09/17 22:48:27
Done.
| |
| 30 bool hasMoreUpdates() const; | 29 bool hasMoreUpdates() const; |
| 31 void updateMoreTextures(double monotonicTimeLimit); | 30 void updateMoreTextures(double monotonicTimeLimit); |
| 32 | 31 |
| 33 // CCTimerClient implementation. | 32 // CCTimerClient implementation. |
| 34 virtual void onTimerFired() OVERRIDE; | 33 virtual void onTimerFired() OVERRIDE; |
| 35 | 34 |
| 36 // Virtual for testing. | 35 // Virtual for testing. |
| 37 virtual double monotonicTimeNow() const; | 36 virtual double monotonicTimeNow() const; |
| 38 virtual double updateMoreTexturesTime() const; | 37 virtual double updateMoreTexturesTime() const; |
| 39 virtual size_t updateMoreTexturesSize() const; | 38 virtual size_t updateMoreTexturesSize() const; |
| 40 | 39 |
| 41 protected: | 40 protected: |
| 42 CCTextureUpdateController(CCThread*, PassOwnPtr<CCTextureUpdateQueue>, CCRes ourceProvider*, TextureCopier*, TextureUploader*); | 41 CCTextureUpdateController(CCThread*, PassOwnPtr<CCTextureUpdateQueue>, CCRes ourceProvider*, TextureCopier*, TextureUploader*, size_t maxTextureUpdates); |
| 43 | 42 |
| 44 void updateMoreTexturesIfEnoughTimeRemaining(); | 43 void updateMoreTexturesIfEnoughTimeRemaining(); |
| 45 void updateMoreTexturesNow(); | 44 void updateMoreTexturesNow(); |
| 46 | 45 |
| 47 OwnPtr<CCTimer> m_timer; | 46 OwnPtr<CCTimer> m_timer; |
| 48 OwnPtr<CCTextureUpdateQueue> m_queue; | 47 OwnPtr<CCTextureUpdateQueue> m_queue; |
| 49 bool m_contentsTexturesPurged; | 48 bool m_contentsTexturesPurged; |
| 50 CCResourceProvider* m_resourceProvider; | 49 CCResourceProvider* m_resourceProvider; |
| 51 TextureCopier* m_copier; | 50 TextureCopier* m_copier; |
| 52 TextureUploader* m_uploader; | 51 TextureUploader* m_uploader; |
| 53 double m_monotonicTimeLimit; | 52 double m_monotonicTimeLimit; |
| 53 size_t m_textureUpdatesPerTick; | |
| 54 bool m_firstUpdateAttempt; | 54 bool m_firstUpdateAttempt; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } | 57 } |
| 58 | 58 |
| 59 #endif // CCTextureUpdateController_h | 59 #endif // CCTextureUpdateController_h |
| OLD | NEW |