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

Unified Diff: cc/resources/texture_uploader.cc

Issue 642993002: Fix unbounded allocation of GL queries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/texture_uploader.cc
diff --git a/cc/resources/texture_uploader.cc b/cc/resources/texture_uploader.cc
index eb4e6c097a43b0f4257318a2a1f90386e264c030..8c7010b5f487fee7db3ef466b5a940a180fca2b4 100644
--- a/cc/resources/texture_uploader.cc
+++ b/cc/resources/texture_uploader.cc
@@ -116,6 +116,12 @@ double TextureUploader::EstimatedTexturesPerSecond() {
}
void TextureUploader::BeginQuery() {
+ // Check to see if any of the pending queries are free before allocating a
+ // new one. If this is not done, queries may be allocated without bound.
+ // http://crbug.com/398072
+ if (available_queries_.empty())
+ ProcessQueries();
+
if (available_queries_.empty())
available_queries_.push_back(Query::Create(gl_));
« 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