summaryrefslogtreecommitdiffstats
path: root/skia/ext/paint_simplifier.cc
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 23:14:39 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 23:14:39 +0000
commitc4eae6b8bced71bab9703586cb2dad29143fb327 (patch)
treeaa376cf37bf3203b7cb02d1b5627f4e849aea895 /skia/ext/paint_simplifier.cc
parent62a2d508ba1b13b185c03a4fd60eaf326bd7ab9a (diff)
downloadchromium_src-c4eae6b8bced71bab9703586cb2dad29143fb327.zip
chromium_src-c4eae6b8bced71bab9703586cb2dad29143fb327.tar.gz
chromium_src-c4eae6b8bced71bab9703586cb2dad29143fb327.tar.bz2
skia: Use medium filter quality in PaintSimplifier.
Preventing all bitmap filtering in the paint simplifier is a bad idea as it's very cache unfriendly when down-sampling due to requiring both the full size decoded image and the high/medium quality image normally used to be cached for good performance. However, forcing medium quality filtering is worthwhile as it's faster than high quality and still provides caching benefits. BUG= Review URL: https://codereview.chromium.org/305623008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/paint_simplifier.cc')
-rw-r--r--skia/ext/paint_simplifier.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/skia/ext/paint_simplifier.cc b/skia/ext/paint_simplifier.cc
index 8df91a8..c868257 100644
--- a/skia/ext/paint_simplifier.cc
+++ b/skia/ext/paint_simplifier.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <limits>
+
#include "skia/ext/paint_simplifier.h"
#include "third_party/skia/include/core/SkPaint.h"
@@ -26,6 +28,12 @@ bool PaintSimplifier::filter(SkPaint* paint, Type type) {
paint->setSubpixelText(false);
paint->setLCDRenderText(false);
+ // Reduce filter level to medium or less. Note that reducing the filter to
+ // less than medium can have a negative effect on performance as the filtered
+ // image is not cached in this case.
+ paint->setFilterLevel(
+ std::min(paint->getFilterLevel(), SkPaint::kMedium_FilterLevel));
+
paint->setMaskFilter(NULL);
// Uncomment this line to shade simplified tiles pink during debugging.