• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "skia/ext/paint_simplifier.h"
6 #include "third_party/skia/include/core/SkPaint.h"
7 
8 namespace skia {
9 
PaintSimplifier()10 PaintSimplifier::PaintSimplifier()
11   : INHERITED() {
12 
13 }
14 
~PaintSimplifier()15 PaintSimplifier::~PaintSimplifier() {
16 
17 }
18 
filter(SkPaint * paint,Type type)19 bool PaintSimplifier::filter(SkPaint* paint, Type type) {
20 
21   // Preserve a modicum of text quality; black & white text is
22   // just too blocky, even during a fling.
23   if (type != kText_Type) {
24     paint->setAntiAlias(false);
25   }
26   paint->setSubpixelText(false);
27   paint->setLCDRenderText(false);
28 
29   paint->setFilterBitmap(false);
30   paint->setMaskFilter(NULL);
31 
32   // Uncomment this line to shade simplified tiles pink during debugging.
33   //paint->setColor(SkColorSetRGB(255, 127, 127));
34 
35   return true;
36 }
37 
38 
39 }  // namespace skia
40 
41 
42