summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwileyrya <wileyrr@gmail.com>2017-06-01 15:33:42 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-06-05 14:35:31 +0000
commit8a5983391252d282e27cc2478798fb056c7df68a (patch)
tree5cfb0a47cc8999df1136f63010536da66a6ba6db
parente98ba9dfa243d7c9cba248c39c38473c5b9d1a4e (diff)
downloadpdfium-chromium/3122.tar.xz
Add missing static asserts for line cap and line join values.chromium/3122chromium/3121
Change-Id: Idd04530986a78370459c4361197a5500ae5347f3 Reviewed-on: https://pdfium-review.googlesource.com/6210 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--fpdfsdk/fpdfeditpath.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index f58d1e18a9..3a0a296cdf 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -10,6 +10,22 @@
#include "fpdfsdk/fsdk_define.h"
#include "third_party/base/ptr_util.h"
+// These checks are here because core/ and public/ cannot depend on each other.
+static_assert(CFX_GraphStateData::LineCapButt == FPDF_LINECAP_BUTT,
+ "CFX_GraphStateData::LineCapButt value mismatch");
+static_assert(CFX_GraphStateData::LineCapRound == FPDF_LINECAP_ROUND,
+ "CFX_GraphStateData::LineCapRound value mismatch");
+static_assert(CFX_GraphStateData::LineCapSquare ==
+ FPDF_LINECAP_PROJECTING_SQUARE,
+ "CFX_GraphStateData::LineCapSquare value mismatch");
+
+static_assert(CFX_GraphStateData::LineJoinMiter == FPDF_LINEJOIN_MITER,
+ "CFX_GraphStateData::LineJoinMiter value mismatch");
+static_assert(CFX_GraphStateData::LineJoinRound == FPDF_LINEJOIN_ROUND,
+ "CFX_GraphStateData::LineJoinRound value mismatch");
+static_assert(CFX_GraphStateData::LineJoinBevel == FPDF_LINEJOIN_BEVEL,
+ "CFX_GraphStateData::LineJoinBevel value mismatch");
+
DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_CreateNewPath(float x, float y) {
auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>();
pPathObj->m_Path.AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo, false);