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

Unified Diff: cc/texture_uploader.cc

Issue 11434111: Clamp texture queries to sane values. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Increase upper limit of a query Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_uploader.cc
diff --git a/cc/texture_uploader.cc b/cc/texture_uploader.cc
index f25764bb837cc795937927cc412b1e8179b6ff4e..6ff13c70a614336a3aaa705b80e6b4949ca918bb 100644
--- a/cc/texture_uploader.cc
+++ b/cc/texture_uploader.cc
@@ -353,6 +353,10 @@ void TextureUploader::processQueries()
unsigned usElapsed = m_pendingQueries.first()->value();
HISTOGRAM_CUSTOM_COUNTS("Renderer4.TextureGpuUploadTimeUS", usElapsed, 0, 100000, 50);
+ // Clamp the queries to saner values in case the queries fail.
+ usElapsed = std::max(1u, usElapsed);
+ usElapsed = std::min(15000u, usElapsed);
+
if (!m_pendingQueries.first()->isNonBlocking())
m_numBlockingTextureUploads--;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698