| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "platform/graphics/skia/SkiaUtils.h" | 31 #include "platform/graphics/skia/SkiaUtils.h" |
| 32 | 32 |
| 33 #include "platform/graphics/GraphicsContext.h" | 33 #include "platform/graphics/GraphicsContext.h" |
| 34 #include "platform/graphics/paint/PaintFlags.h" | 34 #include "platform/graphics/paint/PaintFlags.h" |
| 35 #include "third_party/skia/include/effects/SkCornerPathEffect.h" | 35 #include "third_party/skia/include/effects/SkCornerPathEffect.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 static const struct CompositOpToXfermodeMode { | 39 static const struct CompositOpToXfermodeMode { |
| 40 CompositeOperator m_composit_op; | 40 CompositeOperator composit_op; |
| 41 SkBlendMode xfermode_mode_; | 41 SkBlendMode xfermode_mode; |
| 42 } kGMapCompositOpsToXfermodeModes[] = { | 42 } kGMapCompositOpsToXfermodeModes[] = { |
| 43 {kCompositeClear, SkBlendMode::kClear}, | 43 {kCompositeClear, SkBlendMode::kClear}, |
| 44 {kCompositeCopy, SkBlendMode::kSrc}, | 44 {kCompositeCopy, SkBlendMode::kSrc}, |
| 45 {kCompositeSourceOver, SkBlendMode::kSrcOver}, | 45 {kCompositeSourceOver, SkBlendMode::kSrcOver}, |
| 46 {kCompositeSourceIn, SkBlendMode::kSrcIn}, | 46 {kCompositeSourceIn, SkBlendMode::kSrcIn}, |
| 47 {kCompositeSourceOut, SkBlendMode::kSrcOut}, | 47 {kCompositeSourceOut, SkBlendMode::kSrcOut}, |
| 48 {kCompositeSourceAtop, SkBlendMode::kSrcATop}, | 48 {kCompositeSourceAtop, SkBlendMode::kSrcATop}, |
| 49 {kCompositeDestinationOver, SkBlendMode::kDstOver}, | 49 {kCompositeDestinationOver, SkBlendMode::kDstOver}, |
| 50 {kCompositeDestinationIn, SkBlendMode::kDstIn}, | 50 {kCompositeDestinationIn, SkBlendMode::kDstIn}, |
| 51 {kCompositeDestinationOut, SkBlendMode::kDstOut}, | 51 {kCompositeDestinationOut, SkBlendMode::kDstOut}, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 const CompositOpToXfermodeMode* table = kGMapCompositOpsToXfermodeModes; | 92 const CompositOpToXfermodeMode* table = kGMapCompositOpsToXfermodeModes; |
| 93 if (static_cast<uint8_t>(op) >= | 93 if (static_cast<uint8_t>(op) >= |
| 94 SK_ARRAY_COUNT(kGMapCompositOpsToXfermodeModes)) { | 94 SK_ARRAY_COUNT(kGMapCompositOpsToXfermodeModes)) { |
| 95 SkDEBUGF( | 95 SkDEBUGF( |
| 96 ("GraphicsContext::setPlatformCompositeOperation unknown " | 96 ("GraphicsContext::setPlatformCompositeOperation unknown " |
| 97 "CompositeOperator %d\n", | 97 "CompositeOperator %d\n", |
| 98 op)); | 98 op)); |
| 99 return SkBlendMode::kSrcOver; | 99 return SkBlendMode::kSrcOver; |
| 100 } | 100 } |
| 101 SkASSERT(table[static_cast<uint8_t>(op)].m_composit_op == op); | 101 SkASSERT(table[static_cast<uint8_t>(op)].composit_op == op); |
| 102 return table[static_cast<uint8_t>(op)].xfermode_mode_; | 102 return table[static_cast<uint8_t>(op)].xfermode_mode; |
| 103 } | 103 } |
| 104 | 104 |
| 105 CompositeOperator CompositeOperatorFromSkia(SkBlendMode xfer_mode) { | 105 CompositeOperator CompositeOperatorFromSkia(SkBlendMode xfer_mode) { |
| 106 switch (xfer_mode) { | 106 switch (xfer_mode) { |
| 107 case SkBlendMode::kClear: | 107 case SkBlendMode::kClear: |
| 108 return kCompositeClear; | 108 return kCompositeClear; |
| 109 case SkBlendMode::kSrc: | 109 case SkBlendMode::kSrc: |
| 110 return kCompositeCopy; | 110 return kCompositeCopy; |
| 111 case SkBlendMode::kSrcOver: | 111 case SkBlendMode::kSrcOver: |
| 112 return kCompositeSourceOver; | 112 return kCompositeSourceOver; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 template void PLATFORM_EXPORT DrawPlatformFocusRing<SkRect>(const SkRect&, | 367 template void PLATFORM_EXPORT DrawPlatformFocusRing<SkRect>(const SkRect&, |
| 368 PaintCanvas*, | 368 PaintCanvas*, |
| 369 SkColor, | 369 SkColor, |
| 370 float width); | 370 float width); |
| 371 template void PLATFORM_EXPORT DrawPlatformFocusRing<SkPath>(const SkPath&, | 371 template void PLATFORM_EXPORT DrawPlatformFocusRing<SkPath>(const SkPath&, |
| 372 PaintCanvas*, | 372 PaintCanvas*, |
| 373 SkColor, | 373 SkColor, |
| 374 float width); | 374 float width); |
| 375 | 375 |
| 376 } // namespace blink | 376 } // namespace blink |
| OLD | NEW |