| 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_shading.h" | 7 #include "xfa/fxgraphics/cfx_shading.h" |
| 8 | 8 |
| 9 CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, | 9 CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, |
| 10 const CFX_PointF& endPoint, | 10 const CFX_PointF& endPoint, |
| 11 FX_BOOL isExtendedBegin, | 11 bool isExtendedBegin, |
| 12 FX_BOOL isExtendedEnd, | 12 bool isExtendedEnd, |
| 13 const FX_ARGB beginArgb, | 13 const FX_ARGB beginArgb, |
| 14 const FX_ARGB endArgb) | 14 const FX_ARGB endArgb) |
| 15 : m_type(FX_SHADING_Axial), | 15 : m_type(FX_SHADING_Axial), |
| 16 m_beginPoint(beginPoint), | 16 m_beginPoint(beginPoint), |
| 17 m_endPoint(endPoint), | 17 m_endPoint(endPoint), |
| 18 m_beginRadius(0), | 18 m_beginRadius(0), |
| 19 m_endRadius(0), | 19 m_endRadius(0), |
| 20 m_isExtendedBegin(isExtendedBegin), | 20 m_isExtendedBegin(isExtendedBegin), |
| 21 m_isExtendedEnd(isExtendedEnd), | 21 m_isExtendedEnd(isExtendedEnd), |
| 22 m_beginArgb(beginArgb), | 22 m_beginArgb(beginArgb), |
| 23 m_endArgb(endArgb) { | 23 m_endArgb(endArgb) { |
| 24 InitArgbArray(); | 24 InitArgbArray(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, | 27 CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint, |
| 28 const CFX_PointF& endPoint, | 28 const CFX_PointF& endPoint, |
| 29 const FX_FLOAT beginRadius, | 29 const FX_FLOAT beginRadius, |
| 30 const FX_FLOAT endRadius, | 30 const FX_FLOAT endRadius, |
| 31 FX_BOOL isExtendedBegin, | 31 bool isExtendedBegin, |
| 32 FX_BOOL isExtendedEnd, | 32 bool isExtendedEnd, |
| 33 const FX_ARGB beginArgb, | 33 const FX_ARGB beginArgb, |
| 34 const FX_ARGB endArgb) | 34 const FX_ARGB endArgb) |
| 35 : m_type(FX_SHADING_Radial), | 35 : m_type(FX_SHADING_Radial), |
| 36 m_beginPoint(beginPoint), | 36 m_beginPoint(beginPoint), |
| 37 m_endPoint(endPoint), | 37 m_endPoint(endPoint), |
| 38 m_beginRadius(beginRadius), | 38 m_beginRadius(beginRadius), |
| 39 m_endRadius(endRadius), | 39 m_endRadius(endRadius), |
| 40 m_isExtendedBegin(isExtendedBegin), | 40 m_isExtendedBegin(isExtendedBegin), |
| 41 m_isExtendedEnd(isExtendedEnd), | 41 m_isExtendedEnd(isExtendedEnd), |
| 42 m_beginArgb(beginArgb), | 42 m_beginArgb(beginArgb), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 69 int32_t a3 = static_cast<int32_t>(i * aScale); | 69 int32_t a3 = static_cast<int32_t>(i * aScale); |
| 70 int32_t r3 = static_cast<int32_t>(i * rScale); | 70 int32_t r3 = static_cast<int32_t>(i * rScale); |
| 71 int32_t g3 = static_cast<int32_t>(i * gScale); | 71 int32_t g3 = static_cast<int32_t>(i * gScale); |
| 72 int32_t b3 = static_cast<int32_t>(i * bScale); | 72 int32_t b3 = static_cast<int32_t>(i * bScale); |
| 73 | 73 |
| 74 // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437 | 74 // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437 |
| 75 m_argbArray[i] = | 75 m_argbArray[i] = |
| 76 FXARGB_TODIB(FXARGB_MAKE(a1 + a3, r1 + r3, g1 + g3, b1 + b3)); | 76 FXARGB_TODIB(FXARGB_MAKE(a1 + a3, r1 + r3, g1 + g3, b1 + b3)); |
| 77 } | 77 } |
| 78 } | 78 } |
| OLD | NEW |