| 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 "core/fpdfapi/fpdf_page/cpdf_color.h" | 7 #include "core/fpdfapi/fpdf_page/cpdf_color.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
| 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" |
| 12 #include "core/fxcrt/include/fx_system.h" | 12 #include "core/fxcrt/include/fx_system.h" |
| 13 | 13 |
| 14 CPDF_Color::CPDF_Color() : m_pCS(nullptr), m_pBuffer(nullptr) {} | 14 CPDF_Color::CPDF_Color() : m_pCS(nullptr), m_pBuffer(nullptr) {} |
| 15 | 15 |
| 16 CPDF_Color::~CPDF_Color() { | 16 CPDF_Color::~CPDF_Color() { |
| 17 ReleaseBuffer(); | 17 ReleaseBuffer(); |
| 18 ReleaseColorSpace(); | 18 ReleaseColorSpace(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 bool CPDF_Color::IsPattern() const { | 21 bool CPDF_Color::IsPattern() const { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return TRUE; | 145 return TRUE; |
| 146 } | 146 } |
| 147 | 147 |
| 148 CPDF_Pattern* CPDF_Color::GetPattern() const { | 148 CPDF_Pattern* CPDF_Color::GetPattern() const { |
| 149 if (!m_pBuffer || m_pCS->GetFamily() != PDFCS_PATTERN) | 149 if (!m_pBuffer || m_pCS->GetFamily() != PDFCS_PATTERN) |
| 150 return nullptr; | 150 return nullptr; |
| 151 | 151 |
| 152 PatternValue* pvalue = (PatternValue*)m_pBuffer; | 152 PatternValue* pvalue = (PatternValue*)m_pBuffer; |
| 153 return pvalue->m_pPattern; | 153 return pvalue->m_pPattern; |
| 154 } | 154 } |
| OLD | NEW |