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

Unified Diff: skia/ext/image_operations.cc

Issue 113604: Histogram the time we spend resampling images. We suspect this may be causing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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: skia/ext/image_operations.cc
===================================================================
--- skia/ext/image_operations.cc (revision 16482)
+++ skia/ext/image_operations.cc (working copy)
@@ -11,8 +11,10 @@
#include "base/gfx/rect.h"
#include "base/gfx/size.h"
+#include "base/histogram.h"
#include "base/logging.h"
#include "base/stack_container.h"
+#include "base/time.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "skia/ext/convolver.h"
@@ -260,6 +262,9 @@
ResizeMethod method,
int dest_width, int dest_height,
const gfx::Rect& dest_subset) {
+ // Time how long this takes to see if it's a problem for users.
+ base::TimeTicks resize_start = base::TimeTicks::Now();
+
DCHECK(gfx::Rect(dest_width, dest_height).Contains(dest_subset)) <<
"The supplied subset does not fall within the destination image.";
@@ -292,6 +297,9 @@
// Preserve the "opaque" flag for use as an optimization later.
result.setIsOpaque(source.isOpaque());
+ base::TimeDelta delta = base::TimeTicks::Now() - resize_start;
+ UMA_HISTOGRAM_TIMES("Image.ResampleMS", delta);
+
return result;
}
« 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