halcanary | a681433 | 2015-05-27 08:53:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkXfermodeInterpretation_DEFINED |
| 9 | #define SkXfermodeInterpretation_DEFINED |
| 10 | |
| 11 | class SkPaint; |
| 12 | |
halcanary | 3098a75 | 2015-05-27 14:43:40 -0700 | [diff] [blame] | 13 | /** |
| 14 | * By analyzing the paint, we may decide we can take special |
| 15 | * action. This enum lists our possible actions. |
| 16 | */ |
halcanary | a681433 | 2015-05-27 08:53:36 -0700 | [diff] [blame] | 17 | enum SkXfermodeInterpretation { |
halcanary | 3098a75 | 2015-05-27 14:43:40 -0700 | [diff] [blame] | 18 | kNormal_SkXfermodeInterpretation, //< draw normally |
| 19 | kSrcOver_SkXfermodeInterpretation, //< draw as if in srcover mode |
| 20 | kSkipDrawing_SkXfermodeInterpretation //< draw nothing |
halcanary | a681433 | 2015-05-27 08:53:36 -0700 | [diff] [blame] | 21 | }; |
halcanary | 3098a75 | 2015-05-27 14:43:40 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Given a paint, determine whether the paint's transfer mode can be |
| 25 | * replaced with kSrcOver_Mode or not drawn at all. This is used by |
| 26 | * SkBlitter and SkPDFDevice. |
| 27 | */ |
halcanary | a681433 | 2015-05-27 08:53:36 -0700 | [diff] [blame] | 28 | SkXfermodeInterpretation SkInterpretXfermode(const SkPaint&, bool dstIsOpaque); |
| 29 | |
| 30 | #endif // SkXfermodeInterpretation_DEFINED |