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