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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 SkASSERT(fAttachedToCanvas); | 114 SkASSERT(fAttachedToCanvas); |
115 this->unlockPixels(); | 115 this->unlockPixels(); |
116 #ifdef SK_DEBUG | 116 #ifdef SK_DEBUG |
117 fAttachedToCanvas = false; | 117 fAttachedToCanvas = false; |
118 #endif | 118 #endif |
119 }; | 119 }; |
120 | 120 |
121 protected: | 121 protected: |
122 enum Usage { | 122 enum Usage { |
123 kGeneral_Usage, | 123 kGeneral_Usage, |
124 kSaveLayer_Usage // <! internal use only | 124 kSaveLayer_Usage, // <! internal use only |
| 125 kImageFilter_Usage // <! internal use only |
125 }; | 126 }; |
126 | 127 |
127 struct TextFlags { | 128 struct TextFlags { |
128 uint32_t fFlags; // SkPaint::getFlags() | 129 uint32_t fFlags; // SkPaint::getFlags() |
129 }; | 130 }; |
130 | 131 |
131 /** | 132 /** |
132 * Device may filter the text flags for drawing text here. If it wants to | 133 * Device may filter the text flags for drawing text here. If it wants to |
133 * make a change to the specified values, it should write them into the | 134 * make a change to the specified values, it should write them into the |
134 * textflags parameter (output) and return true. If the paint is fine as | 135 * textflags parameter (output) and return true. If the paint is fine as |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // any clip information. | 362 // any clip information. |
362 // TODO: move to SkBitmapDevice | 363 // TODO: move to SkBitmapDevice |
363 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} | 364 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} |
364 | 365 |
365 virtual bool forceConservativeRasterClip() const { return false; } | 366 virtual bool forceConservativeRasterClip() const { return false; } |
366 | 367 |
367 // just called by SkCanvas when built as a layer | 368 // just called by SkCanvas when built as a layer |
368 void setOrigin(int x, int y) { fOrigin.set(x, y); } | 369 void setOrigin(int x, int y) { fOrigin.set(x, y); } |
369 // just called by SkCanvas for saveLayer | 370 // just called by SkCanvas for saveLayer |
370 SkBaseDevice* createCompatibleDeviceForSaveLayer(const SkImageInfo&); | 371 SkBaseDevice* createCompatibleDeviceForSaveLayer(const SkImageInfo&); |
| 372 // just called by SkCanvas for imagefilter |
| 373 SkBaseDevice* createCompatibleDeviceForImageFilter(const SkImageInfo&); |
371 | 374 |
372 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) { | 375 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) { |
373 return NULL; | 376 return NULL; |
374 } | 377 } |
375 | 378 |
376 /** Causes any deferred drawing to the device to be completed. | 379 /** Causes any deferred drawing to the device to be completed. |
377 */ | 380 */ |
378 virtual void flush() {} | 381 virtual void flush() {} |
379 | 382 |
380 virtual SkImageFilter::Cache* getImageFilterCache() { return NULL; } | 383 virtual SkImageFilter::Cache* getImageFilterCache() { return NULL; } |
381 | 384 |
382 SkIPoint fOrigin; | 385 SkIPoint fOrigin; |
383 SkMetaData* fMetaData; | 386 SkMetaData* fMetaData; |
384 SkDeviceProperties* fLeakyProperties; // will always exist. | 387 SkDeviceProperties* fLeakyProperties; // will always exist. |
385 | 388 |
386 #ifdef SK_DEBUG | 389 #ifdef SK_DEBUG |
387 bool fAttachedToCanvas; | 390 bool fAttachedToCanvas; |
388 #endif | 391 #endif |
389 | 392 |
390 typedef SkRefCnt INHERITED; | 393 typedef SkRefCnt INHERITED; |
391 }; | 394 }; |
392 | 395 |
393 #endif | 396 #endif |
OLD | NEW |