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

Unified Diff: cc/ThrottledTextureUploader.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/TextureUploader.h ('k') | cc/ThrottledTextureUploader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ThrottledTextureUploader.h
diff --git a/cc/ThrottledTextureUploader.h b/cc/ThrottledTextureUploader.h
index b462e07a05c5ad4a5c6717ef031322e45abef875..0b5acc493a256d222c5997adb5c2f83cd040749a 100644
--- a/cc/ThrottledTextureUploader.h
+++ b/cc/ThrottledTextureUploader.h
@@ -7,6 +7,7 @@
#include "TextureUploader.h"
+#include <deque>
#include <wtf/Deque.h>
namespace WebKit {
@@ -29,6 +30,7 @@ public:
virtual ~ThrottledTextureUploader();
virtual bool isBusy() OVERRIDE;
+ virtual double estimatedTexturesPerSecond() OVERRIDE;
virtual void beginUploads() OVERRIDE;
virtual void endUploads() OVERRIDE;
virtual void uploadTexture(CCResourceProvider*, Parameters) OVERRIDE;
@@ -41,15 +43,20 @@ private:
virtual ~Query();
void begin();
- void end();
+ void end(double texturesUploaded);
bool isPending();
void wait();
+ unsigned value();
+ double texturesUploaded();
private:
explicit Query(WebKit::WebGraphicsContext3D*);
WebKit::WebGraphicsContext3D* m_context;
unsigned m_queryId;
+ unsigned m_value;
+ bool m_hasValue;
+ double m_texturesUploaded;
};
ThrottledTextureUploader(WebKit::WebGraphicsContext3D*);
@@ -61,6 +68,8 @@ private:
size_t m_maxPendingQueries;
Deque<OwnPtr<Query> > m_pendingQueries;
Deque<OwnPtr<Query> > m_availableQueries;
+ std::deque<double> m_texturesPerSecondHistory;
+ double m_texturesUploaded;
};
}
« no previous file with comments | « cc/TextureUploader.h ('k') | cc/ThrottledTextureUploader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698