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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 */ | 334 */ |
335 virtual void lockPixels() = 0; | 335 virtual void lockPixels() = 0; |
336 virtual void unlockPixels() = 0; | 336 virtual void unlockPixels() = 0; |
337 | 337 |
338 /** | 338 /** |
339 * Returns true if the device allows processing of this imagefilter. If | 339 * Returns true if the device allows processing of this imagefilter. If |
340 * false is returned, then the filter is ignored. This may happen for | 340 * false is returned, then the filter is ignored. This may happen for |
341 * some subclasses that do not support pixel manipulations after drawing | 341 * some subclasses that do not support pixel manipulations after drawing |
342 * has occurred (e.g. printing). The default implementation returns true. | 342 * has occurred (e.g. printing). The default implementation returns true. |
343 */ | 343 */ |
344 virtual bool allowImageFilter(SkImageFilter*) = 0; | 344 virtual bool allowImageFilter(const SkImageFilter*) = 0; |
345 | 345 |
346 /** | 346 /** |
347 * Override and return true for filters that the device can handle | 347 * Override and return true for filters that the device can handle |
348 * intrinsically. Doing so means that SkCanvas will pass-through this | 348 * intrinsically. Doing so means that SkCanvas will pass-through this |
349 * filter to drawSprite and drawDevice (and potentially filterImage). | 349 * filter to drawSprite and drawDevice (and potentially filterImage). |
350 * Returning false means the SkCanvas will have apply the filter itself, | 350 * Returning false means the SkCanvas will have apply the filter itself, |
351 * and just pass the resulting image to the device. | 351 * and just pass the resulting image to the device. |
352 */ | 352 */ |
353 virtual bool canHandleImageFilter(SkImageFilter*) = 0; | 353 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; |
354 | 354 |
355 /** | 355 /** |
356 * Related (but not required) to canHandleImageFilter, this method returns | 356 * Related (but not required) to canHandleImageFilter, this method returns |
357 * true if the device could apply the filter to the src bitmap and return | 357 * true if the device could apply the filter to the src bitmap and return |
358 * the result (and updates offset as needed). | 358 * the result (and updates offset as needed). |
359 * If the device does not recognize or support this filter, | 359 * If the device does not recognize or support this filter, |
360 * it just returns false and leaves result and offset unchanged. | 360 * it just returns false and leaves result and offset unchanged. |
361 */ | 361 */ |
362 virtual bool filterImage(SkImageFilter*, const SkBitmap&, const SkMatrix&, | 362 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatr
ix&, |
363 SkBitmap* result, SkIPoint* offset) = 0; | 363 SkBitmap* result, SkIPoint* offset) = 0; |
364 | 364 |
365 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if | 365 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if |
366 // either is identical to kNative_Premul_Config8888. Otherwise, -1. | 366 // either is identical to kNative_Premul_Config8888. Otherwise, -1. |
367 static const SkCanvas::Config8888 kPMColorAlias; | 367 static const SkCanvas::Config8888 kPMColorAlias; |
368 | 368 |
369 protected: | 369 protected: |
370 // default impl returns NULL | 370 // default impl returns NULL |
371 virtual SkSurface* newSurface(const SkImageInfo&); | 371 virtual SkSurface* newSurface(const SkImageInfo&); |
372 | 372 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 SkMetaData* fMetaData; | 418 SkMetaData* fMetaData; |
419 | 419 |
420 #ifdef SK_DEBUG | 420 #ifdef SK_DEBUG |
421 bool fAttachedToCanvas; | 421 bool fAttachedToCanvas; |
422 #endif | 422 #endif |
423 | 423 |
424 typedef SkRefCnt INHERITED; | 424 typedef SkRefCnt INHERITED; |
425 }; | 425 }; |
426 | 426 |
427 #endif | 427 #endif |
OLD | NEW |