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 |
11 #define SkDevice_DEFINED | 11 #define SkDevice_DEFINED |
12 | 12 |
13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
14 #include "SkBitmap.h" | 14 #include "SkBitmap.h" |
15 #include "SkCanvas.h" | 15 #include "SkCanvas.h" |
16 #include "SkColor.h" | 16 #include "SkColor.h" |
17 #include "SkDeviceProperties.h" | 17 #include "SkDeviceProperties.h" |
| 18 #include "SkImageFilter.h" |
18 | 19 |
19 // getDeviceCapabilities() is not called by skia, but this flag keeps it around | 20 // getDeviceCapabilities() is not called by skia, but this flag keeps it around |
20 // for clients that have "override" annotations on their subclass. These overrid
es | 21 // for clients that have "override" annotations on their subclass. These overrid
es |
21 // should be deleted. | 22 // should be deleted. |
22 //#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES | 23 //#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES |
23 | 24 |
24 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG | 25 //#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG |
25 | 26 |
26 class SkClipStack; | 27 class SkClipStack; |
27 class SkDraw; | 28 class SkDraw; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 */ | 366 */ |
366 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; | 367 virtual bool canHandleImageFilter(const SkImageFilter*) = 0; |
367 | 368 |
368 /** | 369 /** |
369 * Related (but not required) to canHandleImageFilter, this method returns | 370 * Related (but not required) to canHandleImageFilter, this method returns |
370 * true if the device could apply the filter to the src bitmap and return | 371 * true if the device could apply the filter to the src bitmap and return |
371 * the result (and updates offset as needed). | 372 * the result (and updates offset as needed). |
372 * If the device does not recognize or support this filter, | 373 * If the device does not recognize or support this filter, |
373 * it just returns false and leaves result and offset unchanged. | 374 * it just returns false and leaves result and offset unchanged. |
374 */ | 375 */ |
375 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatr
ix&, | 376 virtual bool filterImage(const SkImageFilter*, const SkBitmap&, |
| 377 const SkImageFilter::Context& ctx, |
376 SkBitmap* result, SkIPoint* offset) = 0; | 378 SkBitmap* result, SkIPoint* offset) = 0; |
377 | 379 |
378 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if | 380 // This is equal kBGRA_Premul_Config8888 or kRGBA_Premul_Config8888 if |
379 // either is identical to kNative_Premul_Config8888. Otherwise, -1. | 381 // either is identical to kNative_Premul_Config8888. Otherwise, -1. |
380 static const SkCanvas::Config8888 kPMColorAlias; | 382 static const SkCanvas::Config8888 kPMColorAlias; |
381 | 383 |
382 protected: | 384 protected: |
383 // default impl returns NULL | 385 // default impl returns NULL |
384 virtual SkSurface* newSurface(const SkImageInfo&); | 386 virtual SkSurface* newSurface(const SkImageInfo&); |
385 | 387 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 SkMetaData* fMetaData; | 466 SkMetaData* fMetaData; |
465 | 467 |
466 #ifdef SK_DEBUG | 468 #ifdef SK_DEBUG |
467 bool fAttachedToCanvas; | 469 bool fAttachedToCanvas; |
468 #endif | 470 #endif |
469 | 471 |
470 typedef SkRefCnt INHERITED; | 472 typedef SkRefCnt INHERITED; |
471 }; | 473 }; |
472 | 474 |
473 #endif | 475 #endif |
OLD | NEW |