OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_BLEND_MODE_H_ | 5 #ifndef CC_BLINK_WEB_BLEND_MODE_H_ |
6 #define CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_BLEND_MODE_H_ | 6 #define CC_BLINK_WEB_BLEND_MODE_H_ |
7 | 7 |
8 #include "third_party/WebKit/public/platform/WebBlendMode.h" | 8 #include "third_party/WebKit/public/platform/WebBlendMode.h" |
| 9 #include "third_party/skia/include/core/SkXfermode.h" |
9 | 10 |
10 namespace content { | 11 namespace cc_blink { |
11 | 12 |
12 inline SkXfermode::Mode BlendModeToSkia(blink::WebBlendMode blend_mode) { | 13 inline SkXfermode::Mode BlendModeToSkia(blink::WebBlendMode blend_mode) { |
13 switch (blend_mode) { | 14 switch (blend_mode) { |
14 case blink::WebBlendModeNormal: | 15 case blink::WebBlendModeNormal: |
15 return SkXfermode::kSrcOver_Mode; | 16 return SkXfermode::kSrcOver_Mode; |
16 case blink::WebBlendModeMultiply: | 17 case blink::WebBlendModeMultiply: |
17 return SkXfermode::kMultiply_Mode; | 18 return SkXfermode::kMultiply_Mode; |
18 case blink::WebBlendModeScreen: | 19 case blink::WebBlendModeScreen: |
19 return SkXfermode::kScreen_Mode; | 20 return SkXfermode::kScreen_Mode; |
20 case blink::WebBlendModeOverlay: | 21 case blink::WebBlendModeOverlay: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 case SkXfermode::kSrcATop_Mode: | 95 case SkXfermode::kSrcATop_Mode: |
95 case SkXfermode::kDstATop_Mode: | 96 case SkXfermode::kDstATop_Mode: |
96 case SkXfermode::kXor_Mode: | 97 case SkXfermode::kXor_Mode: |
97 case SkXfermode::kPlus_Mode: | 98 case SkXfermode::kPlus_Mode: |
98 case SkXfermode::kModulate_Mode: | 99 case SkXfermode::kModulate_Mode: |
99 NOTREACHED(); | 100 NOTREACHED(); |
100 } | 101 } |
101 return blink::WebBlendModeNormal; | 102 return blink::WebBlendModeNormal; |
102 } | 103 } |
103 | 104 |
104 } // namespace content | 105 } // namespace cc_blink |
105 | 106 |
106 #endif // CONTENT_RENDERER_COMPOSITOR_BINDINGS_WEB_BLEND_MODE_H_ | 107 #endif // CC_BLINK_WEB_BLEND_MODE_H_ |
107 | |
OLD | NEW |