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 "SkDevice.h" | 8 #include "SkDevice.h" |
9 #include "SkDeviceProperties.h" | 9 #include "SkDeviceProperties.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bitmap.notifyPixelsChanged(); | 61 bitmap.notifyPixelsChanged(); |
62 } | 62 } |
63 return bitmap; | 63 return bitmap; |
64 } | 64 } |
65 | 65 |
66 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info
, | 66 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info
, |
67 TileUsage tileUsage, | 67 TileUsage tileUsage, |
68 SkPixelGeometry geo) { | 68 SkPixelGeometry geo) { |
69 switch (tileUsage) { | 69 switch (tileUsage) { |
70 case kPossible_TileUsage: | 70 case kPossible_TileUsage: |
| 71 // (we think) for compatibility with old clients, we assume this lay
er can support LCD |
| 72 // even though they may not have marked it as opaque... seems like w
e should update |
| 73 // our callers (reed/robertphilips). |
71 break; | 74 break; |
72 case kNever_TileUsage: | 75 case kNever_TileUsage: |
73 if (info.alphaType() != kOpaque_SkAlphaType) { | 76 if (info.alphaType() != kOpaque_SkAlphaType) { |
74 geo = kUnknown_SkPixelGeometry; | 77 geo = kUnknown_SkPixelGeometry; |
75 } | 78 } |
76 break; | 79 break; |
77 } | 80 } |
78 return geo; | 81 return geo; |
79 } | 82 } |
80 | 83 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry() | 359 if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry() |
357 || this->onShouldDisableLCD(paint)) { | 360 || this->onShouldDisableLCD(paint)) { |
358 | 361 |
359 flags &= ~SkPaint::kLCDRenderText_Flag; | 362 flags &= ~SkPaint::kLCDRenderText_Flag; |
360 flags |= SkPaint::kGenA8FromLCD_Flag; | 363 flags |= SkPaint::kGenA8FromLCD_Flag; |
361 } | 364 } |
362 | 365 |
363 return flags; | 366 return flags; |
364 } | 367 } |
365 | 368 |
OLD | NEW |