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

Side by Side Diff: cc/texture_uploader.cc

Issue 12041015: Use proper histogram macros for Renderer4 histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « cc/overdraw_metrics.cc ('k') | no next file » | 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 #include "cc/texture_uploader.h" 5 #include "cc/texture_uploader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 m_context->unmapTexSubImage2DCHROMIUM(pixel_dest); 341 m_context->unmapTexSubImage2DCHROMIUM(pixel_dest);
342 } 342 }
343 343
344 void TextureUploader::processQueries() 344 void TextureUploader::processQueries()
345 { 345 {
346 while (!m_pendingQueries.empty()) { 346 while (!m_pendingQueries.empty()) {
347 if (m_pendingQueries.front()->isPending()) 347 if (m_pendingQueries.front()->isPending())
348 break; 348 break;
349 349
350 unsigned usElapsed = m_pendingQueries.front()->value(); 350 unsigned usElapsed = m_pendingQueries.front()->value();
351 HISTOGRAM_CUSTOM_COUNTS("Renderer4.TextureGpuUploadTimeUS", usElapsed, 0 , 100000, 50); 351 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.TextureGpuUploadTimeUS",
352 usElapsed, 0, 100000, 50);
352 353
353 // Clamp the queries to saner values in case the queries fail. 354 // Clamp the queries to saner values in case the queries fail.
354 usElapsed = std::max(1u, usElapsed); 355 usElapsed = std::max(1u, usElapsed);
355 usElapsed = std::min(15000u, usElapsed); 356 usElapsed = std::min(15000u, usElapsed);
356 357
357 if (!m_pendingQueries.front()->isNonBlocking()) 358 if (!m_pendingQueries.front()->isNonBlocking())
358 m_numBlockingTextureUploads--; 359 m_numBlockingTextureUploads--;
359 360
360 // Remove the min and max value from our history and insert the new one. 361 // Remove the min and max value from our history and insert the new one.
361 double texturesPerSecond = 1.0 / (usElapsed * 1e-6); 362 double texturesPerSecond = 1.0 / (usElapsed * 1e-6);
362 if (m_texturesPerSecondHistory.size() >= uploadHistorySizeMax) { 363 if (m_texturesPerSecondHistory.size() >= uploadHistorySizeMax) {
363 m_texturesPerSecondHistory.erase(m_texturesPerSecondHistory.begin()) ; 364 m_texturesPerSecondHistory.erase(m_texturesPerSecondHistory.begin()) ;
364 m_texturesPerSecondHistory.erase(--m_texturesPerSecondHistory.end()) ; 365 m_texturesPerSecondHistory.erase(--m_texturesPerSecondHistory.end()) ;
365 } 366 }
366 m_texturesPerSecondHistory.insert(texturesPerSecond); 367 m_texturesPerSecondHistory.insert(texturesPerSecond);
367 368
368 m_availableQueries.push_back(m_pendingQueries.take_front()); 369 m_availableQueries.push_back(m_pendingQueries.take_front());
369 } 370 }
370 } 371 }
371 372
372 } // namespace cc 373 } // namespace cc
OLDNEW
« no previous file with comments | « cc/overdraw_metrics.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698