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

Side by Side Diff: core/fpdfapi/fpdf_page/cpdf_colorstate.h

Issue 2310693002: Use safe bool conversion operators in fpdf_page/ (Closed)
Patch Set: 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 | « no previous file | core/fpdfapi/fpdf_page/cpdf_contentmark.h » ('j') | 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 CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_
9 9
10 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" 10 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void SetFillPattern(CPDF_Pattern* pattern, 44 void SetFillPattern(CPDF_Pattern* pattern,
45 FX_FLOAT* pValue, 45 FX_FLOAT* pValue,
46 uint32_t nValues); 46 uint32_t nValues);
47 void SetStrokePattern(CPDF_Pattern* pattern, 47 void SetStrokePattern(CPDF_Pattern* pattern,
48 FX_FLOAT* pValue, 48 FX_FLOAT* pValue,
49 uint32_t nValues); 49 uint32_t nValues);
50 50
51 // TODO(tsepez): Stop leaking ColorStateData outside this class. 51 // TODO(tsepez): Stop leaking ColorStateData outside this class.
52 const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); } 52 const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); }
53 53
54 operator bool() const { return !!m_Ref; } 54 explicit operator bool() const { return !!m_Ref; }
55 55
56 private: 56 private:
57 void SetColor(CPDF_Color& color, 57 void SetColor(CPDF_Color& color,
58 uint32_t& rgb, 58 uint32_t& rgb,
59 CPDF_ColorSpace* pCS, 59 CPDF_ColorSpace* pCS,
60 FX_FLOAT* pValue, 60 FX_FLOAT* pValue,
61 uint32_t nValues); 61 uint32_t nValues);
62 62
63 CFX_CountRef<CPDF_ColorStateData> m_Ref; 63 CFX_CountRef<CPDF_ColorStateData> m_Ref;
64 }; 64 };
65 65
66 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ 66 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_page/cpdf_contentmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698