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

Unified Diff: skia/ext/paint_simplifier.cc

Issue 12210081: Paint low-res tiles without expensive filters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix filter() return value bug, change low-res scale Created 7 years, 10 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
Index: skia/ext/paint_simplifier.cc
diff --git a/skia/ext/paint_simplifier.cc b/skia/ext/paint_simplifier.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6b697662458b10004099c3b4244fdb46345608c8
--- /dev/null
+++ b/skia/ext/paint_simplifier.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "skia/ext/paint_simplifier.h"
+#include "third_party/skia/include/core/SkPaint.h"
+
+namespace skia {
+
+PaintSimplifier::PaintSimplifier()
+ : INHERITED() {
+
+}
+
+PaintSimplifier::~PaintSimplifier() {
+
+}
+
+bool PaintSimplifier::filter(SkPaint* paint, Type type) {
+
+ // Preserve a modicum of text quality; black & white text is
+ // just too blocky, even during a fling.
+ if (type != kText_Type) {
+ paint->setAntiAlias(false);
+ }
+ paint->setSubpixelText(false);
+ paint->setLCDRenderText(false);
reed1 2013/02/08 15:07:10 Did no-lcd in fact help? In the abstract, it shoul
+
+ paint->setFilterBitmap(false);
+ paint->setMaskFilter(NULL);
+
+ // Uncomment this line to shade simplified tiles pink during debugging.
+ //paint->setColor(SkColorSetRGB(255, 127, 127));
+
+ return true;
+}
+
+
+} // namespace skia
+
+
« skia/ext/paint_simplifier.h ('K') | « skia/ext/paint_simplifier.h ('k') | skia/skia.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698