OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkDevice_DEFINED | 10 #ifndef SkDevice_DEFINED |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 * possibly from SkCanvas' dtor. | 171 * possibly from SkCanvas' dtor. |
172 */ | 172 */ |
173 virtual void onDetachFromCanvas() { | 173 virtual void onDetachFromCanvas() { |
174 SkASSERT(fAttachedToCanvas); | 174 SkASSERT(fAttachedToCanvas); |
175 this->unlockPixels(); | 175 this->unlockPixels(); |
176 #ifdef SK_DEBUG | 176 #ifdef SK_DEBUG |
177 fAttachedToCanvas = false; | 177 fAttachedToCanvas = false; |
178 #endif | 178 #endif |
179 }; | 179 }; |
180 | 180 |
| 181 /** |
| 182 * Construct an acceleration object and attach it to 'picture' |
| 183 */ |
| 184 virtual void optimize(SkPicture* picture); |
| 185 |
| 186 /** |
| 187 * Possibly use the results of an earlier 'optimize' call to render 'pictur
e'. |
| 188 * Return true if all rendering has been done; false if the caller |
| 189 * (i.e., SkCanvas) should render normally. |
| 190 */ |
| 191 virtual bool optimizedRender(SkPicture& picture); |
| 192 |
181 protected: | 193 protected: |
182 enum Usage { | 194 enum Usage { |
183 kGeneral_Usage, | 195 kGeneral_Usage, |
184 kSaveLayer_Usage // <! internal use only | 196 kSaveLayer_Usage // <! internal use only |
185 }; | 197 }; |
186 | 198 |
187 struct TextFlags { | 199 struct TextFlags { |
188 uint32_t fFlags; // SkPaint::getFlags() | 200 uint32_t fFlags; // SkPaint::getFlags() |
189 SkPaint::Hinting fHinting; | 201 SkPaint::Hinting fHinting; |
190 }; | 202 }; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 SkMetaData* fMetaData; | 465 SkMetaData* fMetaData; |
454 | 466 |
455 #ifdef SK_DEBUG | 467 #ifdef SK_DEBUG |
456 bool fAttachedToCanvas; | 468 bool fAttachedToCanvas; |
457 #endif | 469 #endif |
458 | 470 |
459 typedef SkRefCnt INHERITED; | 471 typedef SkRefCnt INHERITED; |
460 }; | 472 }; |
461 | 473 |
462 #endif | 474 #endif |
OLD | NEW |