| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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/src/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 m_pFuncs = pFuncs; | 166 m_pFuncs = pFuncs; |
| 167 m_nFuncs = nFuncs; | 167 m_nFuncs = nFuncs; |
| 168 m_pCS = pCS; | 168 m_pCS = pCS; |
| 169 CPDF_Dictionary* pDict = pShadingStream->GetDict(); | 169 CPDF_Dictionary* pDict = pShadingStream->GetDict(); |
| 170 m_nCoordBits = pDict->GetIntegerBy("BitsPerCoordinate"); | 170 m_nCoordBits = pDict->GetIntegerBy("BitsPerCoordinate"); |
| 171 m_nCompBits = pDict->GetIntegerBy("BitsPerComponent"); | 171 m_nCompBits = pDict->GetIntegerBy("BitsPerComponent"); |
| 172 m_nFlagBits = pDict->GetIntegerBy("BitsPerFlag"); | 172 m_nFlagBits = pDict->GetIntegerBy("BitsPerFlag"); |
| 173 if (!m_nCoordBits || !m_nCompBits) { | 173 if (!m_nCoordBits || !m_nCompBits) { |
| 174 return FALSE; | 174 return FALSE; |
| 175 } | 175 } |
| 176 int nComps = pCS->CountComponents(); | 176 FX_DWORD nComps = pCS->CountComponents(); |
| 177 if (nComps > 8) { | 177 if (nComps > 8) { |
| 178 return FALSE; | 178 return FALSE; |
| 179 } | 179 } |
| 180 m_nComps = nFuncs ? 1 : nComps; | 180 m_nComps = nFuncs ? 1 : nComps; |
| 181 if (((int)m_nComps < 0) || m_nComps > 8) { | 181 if (((int)m_nComps < 0) || m_nComps > 8) { |
| 182 return FALSE; | 182 return FALSE; |
| 183 } | 183 } |
| 184 m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1; | 184 m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1; |
| 185 m_CompMax = (1 << m_nCompBits) - 1; | 185 m_CompMax = (1 << m_nCompBits) - 1; |
| 186 CPDF_Array* pDecode = pDict->GetArrayBy("Decode"); | 186 CPDF_Array* pDecode = pDict->GetArrayBy("Decode"); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * | 311 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * |
| 312 color_count); | 312 color_count); |
| 313 if (bGouraud) | 313 if (bGouraud) |
| 314 stream.m_BitStream.ByteAlign(); | 314 stream.m_BitStream.ByteAlign(); |
| 315 } | 315 } |
| 316 rect.Transform(pMatrix); | 316 rect.Transform(pMatrix); |
| 317 return rect; | 317 return rect; |
| 318 } | 318 } |
| OLD | NEW |