OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxgraphics/cfx_color.h" | 7 #include "xfa/fxgraphics/cfx_color.h" |
8 | 8 |
9 CFX_Color::CFX_Color() : m_type(FX_COLOR_None) {} | 9 CFX_Color::CFX_Color() : m_type(FX_COLOR_None) {} |
10 | 10 |
11 CFX_Color::CFX_Color(const FX_ARGB argb) { | 11 CFX_Color::CFX_Color(const FX_ARGB argb) { |
12 Set(argb); | 12 Set(argb); |
13 } | 13 } |
14 | 14 |
15 CFX_Color::CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb) { | 15 CFX_Color::CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb) { |
16 Set(pattern, argb); | 16 Set(pattern, argb); |
17 } | 17 } |
18 | 18 |
19 CFX_Color::CFX_Color(CFX_Shading* shading) { | 19 CFX_Color::CFX_Color(CFX_Shading* shading) { |
20 Set(shading); | 20 Set(shading); |
21 } | 21 } |
22 | 22 |
23 CFX_Color::~CFX_Color() { | 23 CFX_Color::~CFX_Color() { |
24 m_type = FX_COLOR_None; | 24 m_type = FX_COLOR_None; |
25 } | 25 } |
26 | 26 |
27 FX_ERR CFX_Color::Set(const FX_ARGB argb) { | 27 FWL_Error CFX_Color::Set(const FX_ARGB argb) { |
28 m_type = FX_COLOR_Solid; | 28 m_type = FX_COLOR_Solid; |
29 m_info.argb = argb; | 29 m_info.argb = argb; |
30 m_info.pattern = nullptr; | 30 m_info.pattern = nullptr; |
31 return FX_ERR_Succeeded; | 31 return FWL_Error::Succeeded; |
32 } | 32 } |
33 | 33 |
34 FX_ERR CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { | 34 FWL_Error CFX_Color::Set(CFX_Pattern* pattern, const FX_ARGB argb) { |
35 if (!pattern) | 35 if (!pattern) |
36 return FX_ERR_Parameter_Invalid; | 36 return FWL_Error::ParameterInvalid; |
37 m_type = FX_COLOR_Pattern; | 37 m_type = FX_COLOR_Pattern; |
38 m_info.argb = argb; | 38 m_info.argb = argb; |
39 m_info.pattern = pattern; | 39 m_info.pattern = pattern; |
40 return FX_ERR_Succeeded; | 40 return FWL_Error::Succeeded; |
41 } | 41 } |
42 | 42 |
43 FX_ERR CFX_Color::Set(CFX_Shading* shading) { | 43 FWL_Error CFX_Color::Set(CFX_Shading* shading) { |
44 if (!shading) | 44 if (!shading) |
45 return FX_ERR_Parameter_Invalid; | 45 return FWL_Error::ParameterInvalid; |
46 m_type = FX_COLOR_Shading; | 46 m_type = FX_COLOR_Shading; |
47 m_shading = shading; | 47 m_shading = shading; |
48 return FX_ERR_Succeeded; | 48 return FWL_Error::Succeeded; |
49 } | 49 } |
OLD | NEW |