OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { | 48 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { |
49 const SkBitmap& bitmap = this->onAccessBitmap(); | 49 const SkBitmap& bitmap = this->onAccessBitmap(); |
50 if (changePixels) { | 50 if (changePixels) { |
51 bitmap.notifyPixelsChanged(); | 51 bitmap.notifyPixelsChanged(); |
52 } | 52 } |
53 return bitmap; | 53 return bitmap; |
54 } | 54 } |
55 | 55 |
56 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info
, | 56 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info
, |
57 TileUsage tileUsage, | 57 TileUsage tileUsage, |
58 SkPixelGeometry geo) { | 58 SkPixelGeometry geo, |
| 59 bool preserveLCDText) { |
59 switch (tileUsage) { | 60 switch (tileUsage) { |
60 case kPossible_TileUsage: | 61 case kPossible_TileUsage: |
61 // (we think) for compatibility with old clients, we assume this lay
er can support LCD | 62 // (we think) for compatibility with old clients, we assume this lay
er can support LCD |
62 // even though they may not have marked it as opaque... seems like w
e should update | 63 // even though they may not have marked it as opaque... seems like w
e should update |
63 // our callers (reed/robertphilips). | 64 // our callers (reed/robertphilips). |
64 break; | 65 break; |
65 case kNever_TileUsage: | 66 case kNever_TileUsage: |
66 if (info.alphaType() != kOpaque_SkAlphaType) { | 67 if (!preserveLCDText) { |
67 geo = kUnknown_SkPixelGeometry; | 68 geo = kUnknown_SkPixelGeometry; |
68 } | 69 } |
69 break; | 70 break; |
70 } | 71 } |
71 return geo; | 72 return geo; |
72 } | 73 } |
73 | 74 |
74 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 75 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
75 const SkRRect& inner, const SkPaint& paint) { | 76 const SkRRect& inner, const SkPaint& paint) { |
76 SkPath path; | 77 SkPath path; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() | 440 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() |
440 || this->onShouldDisableLCD(paint)) { | 441 || this->onShouldDisableLCD(paint)) { |
441 | 442 |
442 flags &= ~SkPaint::kLCDRenderText_Flag; | 443 flags &= ~SkPaint::kLCDRenderText_Flag; |
443 flags |= SkPaint::kGenA8FromLCD_Flag; | 444 flags |= SkPaint::kGenA8FromLCD_Flag; |
444 } | 445 } |
445 | 446 |
446 return flags; | 447 return flags; |
447 } | 448 } |
448 | 449 |
OLD | NEW |