OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
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 #ifndef SkDevice_DEFINED | 8 #ifndef SkDevice_DEFINED |
9 #define SkDevice_DEFINED | 9 #define SkDevice_DEFINED |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 * possibly from SkCanvas' dtor. | 110 * possibly from SkCanvas' dtor. |
111 */ | 111 */ |
112 virtual void onDetachFromCanvas() { | 112 virtual void onDetachFromCanvas() { |
113 SkASSERT(fAttachedToCanvas); | 113 SkASSERT(fAttachedToCanvas); |
114 this->unlockPixels(); | 114 this->unlockPixels(); |
115 #ifdef SK_DEBUG | 115 #ifdef SK_DEBUG |
116 fAttachedToCanvas = false; | 116 fAttachedToCanvas = false; |
117 #endif | 117 #endif |
118 }; | 118 }; |
119 | 119 |
120 bool shouldDisableLCD(const SkPaint&) const; | |
121 | |
122 protected: | 120 protected: |
123 enum Usage { | 121 enum Usage { |
124 kGeneral_Usage, | 122 kGeneral_Usage, |
125 kSaveLayer_Usage, // <! internal use only | 123 kSaveLayer_Usage, // <! internal use only |
126 kImageFilter_Usage // <! internal use only | 124 kImageFilter_Usage // <! internal use only |
127 }; | 125 }; |
128 | 126 |
129 struct TextFlags { | 127 struct TextFlags { |
130 uint32_t fFlags; // SkPaint::getFlags() | 128 uint32_t fFlags; // SkPaint::getFlags() |
131 }; | 129 }; |
132 | 130 |
| 131 /** |
| 132 * Returns the text-related flags, possibly modified based on the state of t
he |
| 133 * device (e.g. support for LCD). |
| 134 */ |
| 135 uint32_t filterTextFlags(const SkPaint&) const; |
| 136 |
133 virtual bool onShouldDisableLCD(const SkPaint&) const { return false; } | 137 virtual bool onShouldDisableLCD(const SkPaint&) const { return false; } |
134 | 138 |
135 /** | 139 /** |
136 * | 140 * |
137 * DEPRECATED: This will be removed in a future change. Device subclasses | 141 * DEPRECATED: This will be removed in a future change. Device subclasses |
138 * should use the matrix and clip from the SkDraw passed to draw functions. | 142 * should use the matrix and clip from the SkDraw passed to draw functions. |
139 * | 143 * |
140 * Called with the correct matrix and clip before this device is drawn | 144 * Called with the correct matrix and clip before this device is drawn |
141 * to using those settings. If your subclass overrides this, be sure to | 145 * to using those settings. If your subclass overrides this, be sure to |
142 * call through to the base class as well. | 146 * call through to the base class as well. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 SkDeviceProperties* fLeakyProperties; // will always exist. | 391 SkDeviceProperties* fLeakyProperties; // will always exist. |
388 | 392 |
389 #ifdef SK_DEBUG | 393 #ifdef SK_DEBUG |
390 bool fAttachedToCanvas; | 394 bool fAttachedToCanvas; |
391 #endif | 395 #endif |
392 | 396 |
393 typedef SkRefCnt INHERITED; | 397 typedef SkRefCnt INHERITED; |
394 }; | 398 }; |
395 | 399 |
396 #endif | 400 #endif |
OLD | NEW |