Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: cc/CCTextureUpdateController.h

Issue 10916292: Adaptively throttle texture uploads (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix platform specific compile errors. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/CCTextureUpdateController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/CCTextureUpdateController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698