aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar ericrk <ericrk@chromium.org>2016-04-18 09:14:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-18 09:14:00 -0700
commit983294f78f11159a7def7fd2ea0c12f911d17688 (patch)
treed3f4ccff8dea05af4c6adf9a9a4bbf95fd3ef706 /include
parent7b8b237ef7d82c9985e4f3cec54562f953ae2ce7 (diff)
Skia Filter Quality and Scaling Metrics
Adds histogram metrics to log the filter quality and scale factor of each image draw. To make the data easier to consume, this is broken down into a number of individual histograms: - Filter quality across all draw calls - Scale amount across all draw calls - Scale amount per filter quality (4 histograms total) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686203002 Committed: https://skia.googlesource.com/skia/+/f57b3a6e4a002caf01378832cbd756c6c163a783 Review URL: https://codereview.chromium.org/1686203002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDevice.h3
-rw-r--r--include/core/SkFilterQuality.h4
-rw-r--r--include/core/SkPostConfig.h6
3 files changed, 12 insertions, 1 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index c15aeccf82..3a6d6ea5fc 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -387,6 +387,9 @@ protected:
virtual void drawSpriteWithFilter(const SkDraw&, const SkBitmap&,
int x, int y, const SkPaint&);
+ // A helper function used by derived classes to log the scale factor of a bitmap or image draw.
+ static void LogDrawScaleFactor(const SkMatrix&, SkFilterQuality);
+
private:
friend class SkCanvas;
friend struct DeviceCM; //for setMatrixClip
diff --git a/include/core/SkFilterQuality.h b/include/core/SkFilterQuality.h
index db0597e697..54fae51fe1 100644
--- a/include/core/SkFilterQuality.h
+++ b/include/core/SkFilterQuality.h
@@ -18,7 +18,9 @@ enum SkFilterQuality {
kNone_SkFilterQuality, //!< fastest but lowest quality, typically nearest-neighbor
kLow_SkFilterQuality, //!< typically bilerp
kMedium_SkFilterQuality, //!< typically bilerp + mipmaps for down-scaling
- kHigh_SkFilterQuality //!< slowest but highest quality, typically bicubic or better
+ kHigh_SkFilterQuality, //!< slowest but highest quality, typically bicubic or better
+
+ kLast_SkFilterQuality = kHigh_SkFilterQuality
};
#endif
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index a7fbba7c78..c3255b8768 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -346,6 +346,12 @@
//////////////////////////////////////////////////////////////////////
+#if defined(SK_HISTOGRAM_ENUMERATION) && defined(SK_HISTOGRAM_BOOLEAN)
+# define SK_HISTOGRAMS_ENABLED 1
+#else
+# define SK_HISTOGRAMS_ENABLED 0
+#endif
+
#ifndef SK_HISTOGRAM_BOOLEAN
# define SK_HISTOGRAM_BOOLEAN(name, value)
#endif