OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 { CompositeCopy, SkXfermode::kSrc_Mode }, | 47 { CompositeCopy, SkXfermode::kSrc_Mode }, |
48 { CompositeSourceOver, SkXfermode::kSrcOver_Mode }, | 48 { CompositeSourceOver, SkXfermode::kSrcOver_Mode }, |
49 { CompositeSourceIn, SkXfermode::kSrcIn_Mode }, | 49 { CompositeSourceIn, SkXfermode::kSrcIn_Mode }, |
50 { CompositeSourceOut, SkXfermode::kSrcOut_Mode }, | 50 { CompositeSourceOut, SkXfermode::kSrcOut_Mode }, |
51 { CompositeSourceAtop, SkXfermode::kSrcATop_Mode }, | 51 { CompositeSourceAtop, SkXfermode::kSrcATop_Mode }, |
52 { CompositeDestinationOver, SkXfermode::kDstOver_Mode }, | 52 { CompositeDestinationOver, SkXfermode::kDstOver_Mode }, |
53 { CompositeDestinationIn, SkXfermode::kDstIn_Mode }, | 53 { CompositeDestinationIn, SkXfermode::kDstIn_Mode }, |
54 { CompositeDestinationOut, SkXfermode::kDstOut_Mode }, | 54 { CompositeDestinationOut, SkXfermode::kDstOut_Mode }, |
55 { CompositeDestinationAtop, SkXfermode::kDstATop_Mode }, | 55 { CompositeDestinationAtop, SkXfermode::kDstATop_Mode }, |
56 { CompositeXOR, SkXfermode::kXor_Mode }, | 56 { CompositeXOR, SkXfermode::kXor_Mode }, |
57 { CompositePlusDarker, SkXfermode::kDarken_Mode }, | |
58 { CompositePlusLighter, SkXfermode::kPlus_Mode } | 57 { CompositePlusLighter, SkXfermode::kPlus_Mode } |
59 }; | 58 }; |
60 | 59 |
61 // keep this array in sync with WebBlendMode enum in public/platform/WebBlendMod
e.h | 60 // keep this array in sync with WebBlendMode enum in public/platform/WebBlendMod
e.h |
62 static const SkXfermode::Mode gMapBlendOpsToXfermodeModes[] = { | 61 static const SkXfermode::Mode gMapBlendOpsToXfermodeModes[] = { |
63 SkXfermode::kClear_Mode, // WebBlendModeNormal | 62 SkXfermode::kClear_Mode, // WebBlendModeNormal |
64 SkXfermode::kMultiply_Mode, // WebBlendModeMultiply | 63 SkXfermode::kMultiply_Mode, // WebBlendModeMultiply |
65 SkXfermode::kScreen_Mode, // WebBlendModeScreen | 64 SkXfermode::kScreen_Mode, // WebBlendModeScreen |
66 SkXfermode::kOverlay_Mode, // WebBlendModeOverlay | 65 SkXfermode::kOverlay_Mode, // WebBlendModeOverlay |
67 SkXfermode::kDarken_Mode, // WebBlendModeDarken | 66 SkXfermode::kDarken_Mode, // WebBlendModeDarken |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // though - that's why it's not always on. | 286 // though - that's why it's not always on. |
288 SkScalar widthExpansion, heightExpansion; | 287 SkScalar widthExpansion, heightExpansion; |
289 if (totalMatrix.getType() & SkMatrix::kAffine_Mask) | 288 if (totalMatrix.getType() & SkMatrix::kAffine_Mask) |
290 widthExpansion = totalMatrix[SkMatrix::kMSkewY], heightExpansion = total
Matrix[SkMatrix::kMSkewX]; | 289 widthExpansion = totalMatrix[SkMatrix::kMSkewY], heightExpansion = total
Matrix[SkMatrix::kMSkewX]; |
291 else | 290 else |
292 widthExpansion = totalMatrix[SkMatrix::kMScaleX], heightExpansion = tota
lMatrix[SkMatrix::kMScaleY]; | 291 widthExpansion = totalMatrix[SkMatrix::kMScaleX], heightExpansion = tota
lMatrix[SkMatrix::kMScaleY]; |
293 return destRect.width() * fabs(widthExpansion) < 1 || destRect.height() * fa
bs(heightExpansion) < 1; | 292 return destRect.width() * fabs(widthExpansion) < 1 || destRect.height() * fa
bs(heightExpansion) < 1; |
294 } | 293 } |
295 | 294 |
296 } // namespace blink | 295 } // namespace blink |
OLD | NEW |