summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics/cfx_shading.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-07-13 14:47:10 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-14 01:19:15 +0000
commit2b918c8d05c922287efbc8858f029026cee31442 (patch)
tree6a1b1585d88ef385576740e98457163bddb8347a /xfa/fxgraphics/cfx_shading.cpp
parent56fc9725f05b18573b06d8a422c5d9d6e626219d (diff)
downloadpdfium-2b918c8d05c922287efbc8858f029026cee31442.tar.xz
Fixup naming of XFA graphics classes
These files were originally renamed thinking they'd move with the colour class up to core/. It was decided that CPWL_Color was a better core colour class the the xfa colour so these are being renamed back to XFA based names to make it clear where they live. Change-Id: Ie89f2306be0609add29bd445e719567e7b439211 Reviewed-on: https://pdfium-review.googlesource.com/7754 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxgraphics/cfx_shading.cpp')
-rw-r--r--xfa/fxgraphics/cfx_shading.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/xfa/fxgraphics/cfx_shading.cpp b/xfa/fxgraphics/cfx_shading.cpp
deleted file mode 100644
index b099bb97b1..0000000000
--- a/xfa/fxgraphics/cfx_shading.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxgraphics/cfx_shading.h"
-
-CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint,
- const CFX_PointF& endPoint,
- bool isExtendedBegin,
- bool isExtendedEnd,
- const FX_ARGB beginArgb,
- const FX_ARGB endArgb)
- : m_type(FX_SHADING_Axial),
- m_beginPoint(beginPoint),
- m_endPoint(endPoint),
- m_beginRadius(0),
- m_endRadius(0),
- m_isExtendedBegin(isExtendedBegin),
- m_isExtendedEnd(isExtendedEnd),
- m_beginArgb(beginArgb),
- m_endArgb(endArgb) {
- InitArgbArray();
-}
-
-CFX_Shading::CFX_Shading(const CFX_PointF& beginPoint,
- const CFX_PointF& endPoint,
- const float beginRadius,
- const float endRadius,
- bool isExtendedBegin,
- bool isExtendedEnd,
- const FX_ARGB beginArgb,
- const FX_ARGB endArgb)
- : m_type(FX_SHADING_Radial),
- m_beginPoint(beginPoint),
- m_endPoint(endPoint),
- m_beginRadius(beginRadius),
- m_endRadius(endRadius),
- m_isExtendedBegin(isExtendedBegin),
- m_isExtendedEnd(isExtendedEnd),
- m_beginArgb(beginArgb),
- m_endArgb(endArgb) {
- InitArgbArray();
-}
-
-CFX_Shading::~CFX_Shading() {}
-
-void CFX_Shading::InitArgbArray() {
- int32_t a1;
- int32_t r1;
- int32_t g1;
- int32_t b1;
- std::tie(a1, r1, g1, b1) = ArgbDecode(m_beginArgb);
-
- int32_t a2;
- int32_t r2;
- int32_t g2;
- int32_t b2;
- std::tie(a2, r2, g2, b2) = ArgbDecode(m_endArgb);
-
- float f = static_cast<float>(FX_SHADING_Steps - 1);
- float aScale = 1.0 * (a2 - a1) / f;
- float rScale = 1.0 * (r2 - r1) / f;
- float gScale = 1.0 * (g2 - g1) / f;
- float bScale = 1.0 * (b2 - b1) / f;
-
- for (int32_t i = 0; i < FX_SHADING_Steps; i++) {
- int32_t a3 = static_cast<int32_t>(i * aScale);
- int32_t r3 = static_cast<int32_t>(i * rScale);
- int32_t g3 = static_cast<int32_t>(i * gScale);
- int32_t b3 = static_cast<int32_t>(i * bScale);
-
- // TODO(dsinclair): Add overloads for FX_ARGB. pdfium:437
- m_argbArray[i] =
- FXARGB_TODIB(FXARGB_MAKE(a1 + a3, r1 + r3, g1 + g3, b1 + b3));
- }
-}