| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 The Android Open Source Project | 2 * Copyright (C) 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
| 6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
| 7 * | 7 * |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 * | 9 * |
| 10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 kDstIn_Mode, //!< [Sa * Da, Sa * Dc] | 41 kDstIn_Mode, //!< [Sa * Da, Sa * Dc] |
| 42 kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)] | 42 kSrcOut_Mode, //!< [Sa * (1 - Da), Sc * (1 - Da)] |
| 43 kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)] | 43 kDstOut_Mode, //!< [Da * (1 - Sa), Dc * (1 - Sa)] |
| 44 kSrcATop_Mode, //!< [Da, Sc * Da + (1 - Sa) * Dc] | 44 kSrcATop_Mode, //!< [Da, Sc * Da + (1 - Sa) * Dc] |
| 45 kDstATop_Mode, //!< [Sa, Sa * Dc + Sc * (1 - Da)] | 45 kDstATop_Mode, //!< [Sa, Sa * Dc + Sc * (1 - Da)] |
| 46 kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) *
Dc] | 46 kXor_Mode, //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) *
Dc] |
| 47 kDarken_Mode, //!< [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(S
c, Dc)] | 47 kDarken_Mode, //!< [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(S
c, Dc)] |
| 48 kLighten_Mode, //!< [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(S
c, Dc)] | 48 kLighten_Mode, //!< [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(S
c, Dc)] |
| 49 kMultiply_Mode, //!< [Sa * Da, Sc * Dc] | 49 kMultiply_Mode, //!< [Sa * Da, Sc * Dc] |
| 50 kScreen_Mode, //!< [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] | 50 kScreen_Mode, //!< [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] |
| 51 kAdd_Mode, //!< Saturate(S + D) |
| 51 | 52 |
| 52 kModeCount | 53 kModeCount |
| 53 }; | 54 }; |
| 54 /** Return an SkXfermode object for the specified mode. | 55 /** Return an SkXfermode object for the specified mode. |
| 55 */ | 56 */ |
| 56 static SkXfermode* CreateXfermode(Mode mode); | 57 static SkXfermode* CreateXfermode(Mode mode); |
| 57 | 58 |
| 58 /** Return a function pointer to a routine that applies the specified | 59 /** Return a function pointer to a routine that applies the specified |
| 59 porter-duff transfer mode. | 60 porter-duff transfer mode. |
| 60 */ | 61 */ |
| 61 static SkXfermodeProc GetXfermodeProc(Mode mode); | 62 static SkXfermodeProc GetXfermodeProc(Mode mode); |
| 62 | 63 |
| 63 /** Return a function pointer to a routine that applies the specified | 64 /** Return a function pointer to a routine that applies the specified |
| 64 porter-duff transfer mode and srcColor to a 16bit device color. Note, | 65 porter-duff transfer mode and srcColor to a 16bit device color. Note, |
| 65 if the mode+srcColor might return a non-opaque color, then there is not | 66 if the mode+srcColor might return a non-opaque color, then there is not |
| 66 16bit proc, and this will return NULL. | 67 16bit proc, and this will return NULL. |
| 67 */ | 68 */ |
| 68 static SkXfermodeProc16 GetXfermodeProc16(Mode mode, SkColor srcColor); | 69 static SkXfermodeProc16 GetXfermodeProc16(Mode mode, SkColor srcColor); |
| 69 | 70 |
| 70 /** If the specified xfermode advertises itself as one of the porterduff | 71 /** If the specified xfermode advertises itself as one of the porterduff |
| 71 modes (via SkXfermode::Coeff), return true and if not null, set mode | 72 modes (via SkXfermode::Coeff), return true and if not null, set mode |
| 72 to the corresponding porterduff mode. If it is not recognized as a one, | 73 to the corresponding porterduff mode. If it is not recognized as a one, |
| 73 return false and ignore the mode parameter. | 74 return false and ignore the mode parameter. |
| 74 */ | 75 */ |
| 75 static bool IsMode(SkXfermode*, Mode* mode); | 76 static bool IsMode(SkXfermode*, Mode* mode); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 #endif | 79 #endif |
| 79 | 80 |
| OLD | NEW |