Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: xfa/fxgraphics/cfx_color.h

Issue 2263923003: Make CFX_Color constructor explicit (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidget.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef XFA_FXGRAPHICS_CFX_COLOR_H_ 7 #ifndef XFA_FXGRAPHICS_CFX_COLOR_H_
8 #define XFA_FXGRAPHICS_CFX_COLOR_H_ 8 #define XFA_FXGRAPHICS_CFX_COLOR_H_
9 9
10 #include "core/fxge/include/fx_dib.h" 10 #include "core/fxge/include/fx_dib.h"
11 #include "xfa/fxgraphics/include/cfx_graphics.h" 11 #include "xfa/fxgraphics/include/cfx_graphics.h"
12 12
13 class CFX_Pattern; 13 class CFX_Pattern;
14 class CFX_Shading; 14 class CFX_Shading;
15 15
16 enum { FX_COLOR_None = 0, FX_COLOR_Solid, FX_COLOR_Pattern, FX_COLOR_Shading }; 16 enum { FX_COLOR_None = 0, FX_COLOR_Solid, FX_COLOR_Pattern, FX_COLOR_Shading };
17 17
18 class CFX_Color { 18 class CFX_Color {
19 public: 19 public:
20 CFX_Color(); 20 CFX_Color();
21 // TODO(weili): Remove implicit conversions. Make this explicit. 21 explicit CFX_Color(const FX_ARGB argb);
22 CFX_Color(const FX_ARGB argb);
23
24 explicit CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb = 0x0);
25 explicit CFX_Color(CFX_Shading* shading); 22 explicit CFX_Color(CFX_Shading* shading);
23 CFX_Color(CFX_Pattern* pattern, const FX_ARGB argb);
26 virtual ~CFX_Color(); 24 virtual ~CFX_Color();
27 25
28 FWL_Error Set(const FX_ARGB argb); 26 FWL_Error Set(const FX_ARGB argb);
29 FWL_Error Set(CFX_Pattern* pattern, const FX_ARGB argb = 0x0); 27 FWL_Error Set(CFX_Pattern* pattern, const FX_ARGB argb);
30 FWL_Error Set(CFX_Shading* shading); 28 FWL_Error Set(CFX_Shading* shading);
31 29
32 private: 30 private:
33 friend class CFX_Graphics; 31 friend class CFX_Graphics;
34 32
35 int32_t m_type; 33 int32_t m_type;
36 union { 34 union {
37 struct { 35 struct {
38 FX_ARGB argb; 36 FX_ARGB argb;
39 CFX_Pattern* pattern; 37 CFX_Pattern* pattern;
40 } m_info; 38 } m_info;
41 CFX_Shading* m_shading; 39 CFX_Shading* m_shading;
42 }; 40 };
43 }; 41 };
44 42
45 #endif // XFA_FXGRAPHICS_CFX_COLOR_H_ 43 #endif // XFA_FXGRAPHICS_CFX_COLOR_H_
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidget.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698