aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar ericrk <ericrk@chromium.org>2016-02-25 22:15:29 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-25 22:15:29 -0800
commit82e26bf23923f20828c850d1a0e01d8bde69cfff (patch)
tree224b582fe4a41f5d8712c84911ba20ceda4f711d /src
parent7363e13a07f8b6a9d4ba82ff7b13526f0a89eaee (diff)
Revert of Skia Filter Quality and Scaling Metrics (patchset #3 id:60001 of https://codereview.chromium.org/1686203002/ )
Reason for revert: reverting this to address Ilya's comments. Original issue's description: > 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 TBR=bsalomon@google.com,isherman@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1735423002
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapDevice.cpp3
-rw-r--r--src/core/SkDevice.cpp54
-rw-r--r--src/gpu/SkGpuDevice.cpp3
-rw-r--r--src/gpu/SkGpuDevice_drawTexture.cpp3
4 files changed, 1 insertions, 62 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 97aed212db..8c3c562181 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -247,7 +247,6 @@ void SkBitmapDevice::drawPath(const SkDraw& draw, const SkPath& path,
void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
const SkMatrix& matrix, const SkPaint& paint) {
- LogDrawScaleFactor(SkMatrix::Concat(*draw.fMatrix, matrix), paint.getFilterQuality());
draw.drawBitmap(bitmap, matrix, nullptr, paint);
}
@@ -268,8 +267,6 @@ void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
}
matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit);
- LogDrawScaleFactor(SkMatrix::Concat(*draw.fMatrix, matrix), paint.getFilterQuality());
-
const SkRect* dstPtr = &dst;
const SkBitmap* bitmapPtr = &bitmap;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 6b481e8e1c..7adb0f4b3c 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -442,57 +442,3 @@ uint32_t SkBaseDevice::filterTextFlags(const SkPaint& paint) const {
return flags;
}
-//////////////////////////////////////////////////////////////////////////////////////////
-
-void SkBaseDevice::LogDrawScaleFactor(const SkMatrix& matrix, SkFilterQuality filterQuality) {
-#if SK_HISTOGRAMS_ENABLED
- enum ScaleFactor {
- kUpscale_ScaleFactor,
- kNoScale_ScaleFactor,
- kDownscale_ScaleFactor,
- kLargeDownscale_ScaleFactor,
- };
-
- SkASSERT(filterQuality != kNone_SkFilterQuality);
- enum { kScaleFactorCount = kLargeDownscale_ScaleFactor + 1 };
- float rawScaleFactor = matrix.getMinScale();
-
- ScaleFactor scaleFactor;
- if (rawScaleFactor < 0.5f) {
- scaleFactor = kLargeDownscale_ScaleFactor;
- } else if (rawScaleFactor < 1.0f) {
- scaleFactor = kDownscale_ScaleFactor;
- } else if (rawScaleFactor > 1.0f) {
- scaleFactor = kUpscale_ScaleFactor;
- } else {
- scaleFactor = kNoScale_ScaleFactor;
- }
-
- switch (filterQuality) {
- case kNone_SkFilterQuality:
- SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.NoneFilterQuality", scaleFactor,
- kScaleFactorCount);
- break;
- case kLow_SkFilterQuality:
- SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.LowFilterQuality", scaleFactor,
- kScaleFactorCount);
- break;
- case kMedium_SkFilterQuality:
- SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.MediumFilterQuality", scaleFactor,
- kScaleFactorCount);
- break;
- case kHigh_SkFilterQuality:
- SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.HighFilterQuality", scaleFactor,
- kScaleFactorCount);
- break;
- }
-
- // Also log filter quality independent scale factor.
- SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, kScaleFactorCount);
-
- // Also log an overall histogram of filter quality.
- enum { kFilterQualityCount = kHigh_SkFilterQuality + 1 };
- SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kFilterQualityCount);
-#endif
-}
-
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index db249b38f2..b3761e2d71 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -988,9 +988,8 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
bool bicubic) {
ASSERT_SINGLE_OWNER
- // This is the funnel for all paths that draw tiled bitmaps/images. Log histogram entries.
+ // This is the funnel for all paths that draw tiled bitmaps/images. Log histogram entry.
SK_HISTOGRAM_BOOLEAN("DrawTiled", true);
- LogDrawScaleFactor(viewMatrix, origPaint.getFilterQuality());
// The following pixel lock is technically redundant, but it is desirable
// to lock outside of the tile loop to prevent redecoding the whole image
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index f6a5847c5c..5c5fb12421 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -137,9 +137,6 @@ void SkGpuDevice::drawTextureProducer(GrTextureProducer* producer,
}
}
- // Now that we have both the view and srcToDst matrices, log our scale factor.
- LogDrawScaleFactor(SkMatrix::Concat(viewMatrix, srcToDstMatrix), paint.getFilterQuality());
-
this->drawTextureProducerImpl(producer, clippedSrcRect, clippedDstRect, constraint, viewMatrix,
srcToDstMatrix, clip, paint);
}