summaryrefslogtreecommitdiffstats
path: root/skia/ext/image_operations.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 16:49:47 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 16:49:47 +0000
commitaade6db347f4965fbd62f95934fe5616d9e80f8b (patch)
treef700e931518729aa33cfbd84438e82f06430ae3a /skia/ext/image_operations.cc
parentd36519b5068d92f4e71b8d6fd51eda2c42e54e38 (diff)
downloadchromium_src-aade6db347f4965fbd62f95934fe5616d9e80f8b.zip
chromium_src-aade6db347f4965fbd62f95934fe5616d9e80f8b.tar.gz
chromium_src-aade6db347f4965fbd62f95934fe5616d9e80f8b.tar.bz2
Histogram the time we spend resampling images. We suspect this may be causing
performance problems, so it would be nice to see what average users are seeing. Review URL: http://codereview.chromium.org/113604 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/image_operations.cc')
-rw-r--r--skia/ext/image_operations.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/skia/ext/image_operations.cc b/skia/ext/image_operations.cc
index fa5194b..561bd4e 100644
--- a/skia/ext/image_operations.cc
+++ b/skia/ext/image_operations.cc
@@ -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 @@ SkBitmap ImageOperations::Resize(const SkBitmap& source,
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 @@ SkBitmap ImageOperations::Resize(const SkBitmap& source,
// 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;
}