summaryrefslogtreecommitdiff
path: root/xfa/src/fxgraphics
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 13:24:12 -0700
commitbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch)
tree4cfbe682869d89900f33751c37f6a84865beeb0a /xfa/src/fxgraphics
parentb116136da234afcad018bb44a3ccb64b9ad2a554 (diff)
downloadpdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'xfa/src/fxgraphics')
-rw-r--r--xfa/src/fxgraphics/src/fx_graphics.cpp156
-rw-r--r--xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp68
-rw-r--r--xfa/src/fxgraphics/src/fx_metafile_interpreter.h44
-rw-r--r--xfa/src/fxgraphics/src/pre.h6
4 files changed, 137 insertions, 137 deletions
diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp
index 56f6cee026..ee746b7fce 100644
--- a/xfa/src/fxgraphics/src/fx_graphics.cpp
+++ b/xfa/src/fxgraphics/src/fx_graphics.cpp
@@ -11,8 +11,8 @@ class CAGG_Graphics
public:
CAGG_Graphics();
FX_ERR Create(CFX_Graphics * owner,
- FX_INT32 width,
- FX_INT32 height,
+ int32_t width,
+ int32_t height,
FXDIB_Format format);
virtual ~CAGG_Graphics();
private:
@@ -50,8 +50,8 @@ FX_ERR CFX_Graphics::Create(CFX_RenderDevice * renderDevice,
}
return FX_ERR_Indefinite;
}
-FX_ERR CFX_Graphics::Create(FX_INT32 width,
- FX_INT32 height,
+FX_ERR CFX_Graphics::Create(int32_t width,
+ int32_t height,
FXDIB_Format format,
FX_BOOL isNative ,
FX_BOOL isAntialiasing )
@@ -76,7 +76,7 @@ CFX_Graphics::~CFX_Graphics()
_info._graphState.SetDashCount(0);
_type = FX_CONTEXT_None;
}
-FX_ERR CFX_Graphics::GetDeviceCap(const FX_INT32 capID, FX_DeviceCap & capVal)
+FX_ERR CFX_Graphics::GetDeviceCap(const int32_t capID, FX_DeviceCap & capVal)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -94,7 +94,7 @@ FX_ERR CFX_Graphics::IsPrinterDevice(FX_BOOL & isPrinter)
switch (_type) {
case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
- FX_INT32 deviceClass = _renderDevice->GetDeviceClass();
+ int32_t deviceClass = _renderDevice->GetDeviceClass();
if (deviceClass == FXDC_PRINTER) {
isPrinter = TRUE;
} else {
@@ -152,11 +152,11 @@ FX_ERR CFX_Graphics::RestoreGraphState()
case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
_renderDevice->RestoreState();
- FX_INT32 size = _infoStack.GetSize();
+ int32_t size = _infoStack.GetSize();
if (size <= 0) {
return FX_ERR_Intermediate_Value_Invalid;
}
- FX_INT32 topIndex = size - 1;
+ int32_t topIndex = size - 1;
TInfo * info = (TInfo *) _infoStack.GetAt(topIndex);
_FX_RETURN_VALUE_IF_FAIL(info, FX_ERR_Intermediate_Value_Invalid);
_info._graphState.Copy(info->_graphState);
@@ -206,7 +206,7 @@ FX_ERR CFX_Graphics::SetLineCap(CFX_GraphStateData::LineCap lineCap)
}
}
}
-FX_ERR CFX_Graphics::GetDashCount(FX_INT32 & dashCount)
+FX_ERR CFX_Graphics::GetDashCount(int32_t & dashCount)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -238,7 +238,7 @@ FX_ERR CFX_Graphics::GetLineDash(FX_FLOAT & dashPhase, FX_FLOAT * dashArray)
}
FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
FX_FLOAT * dashArray,
- FX_INT32 dashCount)
+ int32_t dashCount)
{
if (dashCount > 0 && !dashArray) {
return FX_ERR_Parameter_Invalid;
@@ -253,7 +253,7 @@ FX_ERR CFX_Graphics::SetLineDash(FX_FLOAT dashPhase,
}
_info._graphState.m_DashPhase = dashPhase;
_info._graphState.SetDashCount(dashCount);
- for (FX_INT32 i = 0; i < dashCount; i++) {
+ for (int32_t i = 0; i < dashCount; i++) {
_info._graphState.m_DashArray[i] = dashArray[i] * scale;
}
return FX_ERR_Succeeded;
@@ -616,7 +616,7 @@ FX_ERR CFX_Graphics::SetCharSpacing(const FX_FLOAT spacing)
}
}
}
-FX_ERR CFX_Graphics::SetTextDrawingMode(const FX_INT32 mode)
+FX_ERR CFX_Graphics::SetTextDrawingMode(const int32_t mode)
{
switch (_type) {
case FX_CONTEXT_Device: {
@@ -650,7 +650,7 @@ FX_ERR CFX_Graphics::CalcTextRect(CFX_RectF & rect,
switch (_type) {
case FX_CONTEXT_Device: {
_FX_RETURN_VALUE_IF_FAIL(_renderDevice, FX_ERR_Property_Invalid);
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length);
FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS,
length * sizeof (FXTEXT_CHARPOS));
@@ -709,17 +709,17 @@ FX_ERR CFX_Graphics::Transfer(CFX_Graphics * graphics,
CFX_DIBitmap * bitmap = graphics->_renderDevice->GetBitmap();
FX_BOOL result = FX_ERR_Indefinite;
CFX_DIBitmap bmp;
- result = bmp.Create((FX_INT32) dstRect.width,
- (FX_INT32) dstRect.height,
+ result = bmp.Create((int32_t) dstRect.width,
+ (int32_t) dstRect.height,
bitmap->GetFormat());
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Intermediate_Value_Invalid);
result = graphics->_renderDevice->GetDIBits(&bmp,
- (FX_INT32) srcLeft,
- (FX_INT32) srcTop);
+ (int32_t) srcLeft,
+ (int32_t) srcTop);
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported);
result = _renderDevice->SetDIBits(&bmp,
- (FX_INT32) dstRect.left,
- (FX_INT32) dstRect.top);
+ (int32_t) dstRect.left,
+ (int32_t) dstRect.top);
_FX_RETURN_VALUE_IF_FAIL(result, FX_ERR_Method_Not_Supported);
return FX_ERR_Succeeded;
}
@@ -746,12 +746,12 @@ FX_ERR CFX_Graphics::InverseRect(const CFX_RectF & rect)
if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + FX_INT32(r.top) * bitmap->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pLine = pBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pBuf = (FX_ARGB*)(bitmap->GetBuffer() + int32_t(r.top) * bitmap->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pLine = pBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pLine;
*pLine ++ = (c & 0xFF000000) | (0xFFFFFF - (c & 0x00FFFFFF));
}
@@ -772,14 +772,14 @@ FX_ERR CFX_Graphics::XorDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF
if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch());
- FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left;
- FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch());
+ FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left;
+ FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pDstLine;
*pDstLine ++ = ArgbEncode(FXARGB_A(c), (c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF));
pSrcLine ++;
@@ -802,14 +802,14 @@ FX_ERR CFX_Graphics::EqvDIBitmap(const CFX_DIBitmap * srcBitmap, const CFX_RectF
if (r.IsEmpty()) {
return FX_ERR_Parameter_Invalid;
}
- FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + FX_INT32(r.top) * srcBitmap->GetPitch());
- FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + FX_INT32(r.top) * dst->GetPitch());
- FX_INT32 bottom = (FX_INT32)r.bottom();
- FX_INT32 right = (FX_INT32)r.right();
- for (FX_INT32 i = (FX_INT32)r.top; i < bottom; i ++) {
- FX_ARGB* pSrcLine = pSrcBuf + (FX_INT32)r.left;
- FX_ARGB* pDstLine = pDstBuf + (FX_INT32)r.left;
- for (FX_INT32 j = (FX_INT32)r.left; j < right; j ++) {
+ FX_ARGB* pSrcBuf = (FX_ARGB*)(srcBitmap->GetBuffer() + int32_t(r.top) * srcBitmap->GetPitch());
+ FX_ARGB* pDstBuf = (FX_ARGB*)(dst->GetBuffer() + int32_t(r.top) * dst->GetPitch());
+ int32_t bottom = (int32_t)r.bottom();
+ int32_t right = (int32_t)r.right();
+ for (int32_t i = (int32_t)r.top; i < bottom; i ++) {
+ FX_ARGB* pSrcLine = pSrcBuf + (int32_t)r.left;
+ FX_ARGB* pDstLine = pDstBuf + (int32_t)r.left;
+ for (int32_t j = (int32_t)r.left; j < right; j ++) {
FX_ARGB c = *pDstLine;
*pDstLine ++ = ArgbEncode(FXARGB_A(c), ~((c & 0xFFFFFF) ^ (*pSrcLine & 0xFFFFFF)));
pSrcLine ++;
@@ -934,7 +934,7 @@ FX_ERR CFX_Graphics::RenderDeviceDrawImage(CFX_DIBSource * source,
point.x,
point.y);
m2.Concat(m1);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m2, left, top);
CFX_RectF r;
@@ -974,12 +974,12 @@ FX_ERR CFX_Graphics::RenderDeviceStretchImage(CFX_DIBSource * source,
if (matrix) {
m1.Concat(*matrix);
}
- CFX_DIBitmap * bmp1 = source->StretchTo((FX_INT32) rect.Width(),
- (FX_INT32) rect.Height());
+ CFX_DIBitmap * bmp1 = source->StretchTo((int32_t) rect.Width(),
+ (int32_t) rect.Height());
CFX_Matrix m2;
m2.Set(rect.Width(), 0.0, 0.0, rect.Height(), rect.left, rect.top);
m2.Concat(m1);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp2 = bmp1->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp3 = bmp2->TransformTo((CFX_AffineMatrix *) &m2, left, top);
CFX_RectF r;
@@ -1014,7 +1014,7 @@ FX_ERR CFX_Graphics::RenderDeviceShowText(const CFX_PointF & point,
const CFX_WideString & text,
CFX_Matrix * matrix)
{
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_DWORD * charCodes = FX_Alloc(FX_DWORD, length);
FXTEXT_CHARPOS * charPos = FX_Alloc(FXTEXT_CHARPOS,
length * sizeof (FXTEXT_CHARPOS));
@@ -1054,19 +1054,19 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path,
{
CFX_Pattern * pattern = _info._fillColor->_pattern;
CFX_DIBitmap * bitmap = _renderDevice->GetBitmap();
- FX_INT32 width = bitmap->GetWidth();
- FX_INT32 height = bitmap->GetHeight();
+ int32_t width = bitmap->GetWidth();
+ int32_t height = bitmap->GetHeight();
CFX_DIBitmap bmp;
bmp.Create(width, height, FXDIB_Argb);
_renderDevice->GetDIBits(&bmp, 0, 0);
switch (pattern->_type) {
case FX_PATTERN_Bitmap: {
- FX_INT32 xStep = FXSYS_round(pattern->_x1Step);
- FX_INT32 yStep = FXSYS_round(pattern->_y1Step);
- FX_INT32 xCount = width / xStep + 1;
- FX_INT32 yCount = height / yStep + 1;
- for (FX_INT32 i = 0; i <= yCount; i++) {
- for (FX_INT32 j = 0; j <= xCount; j++) {
+ int32_t xStep = FXSYS_round(pattern->_x1Step);
+ int32_t yStep = FXSYS_round(pattern->_y1Step);
+ int32_t xCount = width / xStep + 1;
+ int32_t yCount = height / yStep + 1;
+ for (int32_t i = 0; i <= yCount; i++) {
+ for (int32_t j = 0; j <= xCount; j++) {
bmp.TransferBitmap(j * xStep,
i * yStep,
xStep,
@@ -1098,8 +1098,8 @@ FX_ERR CFX_Graphics::FillPathWithPattern(CFX_Path * path,
CFX_FxgeDevice device;
device.Attach(&bmp);
device.FillRect(&rect, _info._fillColor->_pattern->_backArgb);
- for (FX_INT32 j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
- for (FX_INT32 i = rect.left; i < rect.right; i += mask.GetWidth()) {
+ for (int32_t j = rect.bottom; j < rect.top; j += mask.GetHeight()) {
+ for (int32_t i = rect.left; i < rect.right; i += mask.GetWidth()) {
device.SetBitMask(&mask, i, j, _info._fillColor->_pattern->_foreArgb);
}
}
@@ -1119,8 +1119,8 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path,
CFX_Matrix * matrix)
{
CFX_DIBitmap * bitmap = _renderDevice->GetBitmap();
- FX_INT32 width = bitmap->GetWidth();
- FX_INT32 height = bitmap->GetHeight();
+ int32_t width = bitmap->GetWidth();
+ int32_t height = bitmap->GetHeight();
FX_FLOAT start_x = _info._fillColor->_shading->_beginPoint.x;
FX_FLOAT start_y = _info._fillColor->_shading->_beginPoint.y;
FX_FLOAT end_x = _info._fillColor->_shading->_endPoint.x;
@@ -1128,16 +1128,16 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path,
CFX_DIBitmap bmp;
bmp.Create(width, height, FXDIB_Argb);
_renderDevice->GetDIBits(&bmp, 0, 0);
- FX_INT32 pitch = bmp.GetPitch();
+ int32_t pitch = bmp.GetPitch();
FX_BOOL result = FALSE;
switch (_info._fillColor->_shading->_type) {
case FX_SHADING_Axial: {
FX_FLOAT x_span = end_x - start_x;
FX_FLOAT y_span = end_y - start_y;
FX_FLOAT axis_len_square = FXSYS_Mul(x_span, x_span) + FXSYS_Mul(y_span, y_span);
- for (FX_INT32 row = 0; row < height; row++) {
+ for (int32_t row = 0; row < height; row++) {
FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch);
- for (FX_INT32 column = 0; column < width; column++) {
+ for (int32_t column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)(column);
FX_FLOAT y = (FX_FLOAT)(row);
FX_FLOAT scale = FXSYS_Div(FXSYS_Mul(x - start_x, x_span) + FXSYS_Mul(y - start_y, y_span),
@@ -1153,7 +1153,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path,
}
scale = 1.0f;
}
- FX_INT32 index = (FX_INT32)(scale * (FX_SHADING_Steps - 1));
+ int32_t index = (int32_t)(scale * (FX_SHADING_Steps - 1));
dib_buf[column] = _info._fillColor->_shading->_argbArray[index];
}
}
@@ -1164,9 +1164,9 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path,
FX_FLOAT start_r = _info._fillColor->_shading->_beginRadius;
FX_FLOAT end_r = _info._fillColor->_shading->_endRadius;
FX_FLOAT a = FXSYS_Mul(start_x - end_x, start_x - end_x) + FXSYS_Mul(start_y - end_y, start_y - end_y) - FXSYS_Mul(start_r - end_r, start_r - end_r);
- for (FX_INT32 row = 0; row < height; row++) {
+ for (int32_t row = 0; row < height; row++) {
FX_DWORD * dib_buf = (FX_DWORD *) (bmp.GetBuffer() + row * pitch);
- for (FX_INT32 column = 0; column < width; column++) {
+ for (int32_t column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)(column);
FX_FLOAT y = (FX_FLOAT)(row);
FX_FLOAT b = -2 * (FXSYS_Mul(x - start_x, end_x - start_x) + FXSYS_Mul(y - start_y, end_y - start_y) +
@@ -1211,7 +1211,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path * path,
}
s = 1.0f;
}
- int index = (FX_INT32)(s * (FX_SHADING_Steps - 1));
+ int index = (int32_t)(s * (FX_SHADING_Steps - 1));
dib_buf[column] = _info._fillColor->_shading->_argbArray[index];
}
}
@@ -1240,7 +1240,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma
CFX_Matrix m;
m.Set((FX_FLOAT)source->GetWidth(), 0, 0, (FX_FLOAT)source->GetHeight(), 0, 0);
m.Concat(*matrix);
- FX_INT32 left, top;
+ int32_t left, top;
CFX_DIBitmap * bmp1 = source->FlipImage(FALSE, TRUE);
CFX_DIBitmap * bmp2 = bmp1->TransformTo((CFX_AffineMatrix *) &m, left, top);
_renderDevice->SetDIBits(bmp2, left, top);
@@ -1258,7 +1258,7 @@ FX_ERR CFX_Graphics::SetDIBitsWithMatrix(CFX_DIBSource * source, CFX_Matrix * ma
FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCodes, FXTEXT_CHARPOS * charPos, CFX_RectF & rect)
{
IFX_FontEncoding * encoding = FXGE_CreateUnicodeEncoding(_info._font);
- FX_INT32 length = text.GetLength();
+ int32_t length = text.GetLength();
FX_FLOAT penX = (FX_FLOAT) rect.left;
FX_FLOAT penY = (FX_FLOAT) rect.top;
FX_FLOAT left = (FX_FLOAT)(0);
@@ -1274,7 +1274,7 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString & text, FX_DWORD * charCo
charPos[0].m_AdjustMatrix[2] = 0;
charPos[0].m_AdjustMatrix[3] = 1;
penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * _info._fontSize / 1000 + _info._fontSpacing;
- for (FX_INT32 i = 1; i < length; i++) {
+ for (int32_t i = 1; i < length; i++) {
charCodes[i] = text.GetAt(i);
charPos[i].m_OriginX = penX + left;
charPos[i].m_OriginY = penY + top;
@@ -1298,8 +1298,8 @@ CAGG_Graphics::CAGG_Graphics()
_owner = NULL;
}
FX_ERR CAGG_Graphics::Create(CFX_Graphics * owner,
- FX_INT32 width,
- FX_INT32 height,
+ int32_t width,
+ int32_t height,
FXDIB_Format format)
{
if (owner->_renderDevice) {
@@ -1638,21 +1638,21 @@ CFX_Shading::~CFX_Shading()
}
FX_ERR CFX_Shading::InitArgbArray()
{
- FX_INT32 a1, r1, g1, b1;
+ int32_t a1, r1, g1, b1;
ArgbDecode(_beginArgb, a1, r1, g1, b1);
- FX_INT32 a2, r2, g2, b2;
+ int32_t a2, r2, g2, b2;
ArgbDecode(_endArgb, a2, r2, g2, b2);
FX_FLOAT f = (FX_FLOAT) (FX_SHADING_Steps - 1);
FX_FLOAT aScale = (FX_FLOAT) (1.0 * (a2 - a1) / f);
FX_FLOAT rScale = (FX_FLOAT) (1.0 * (r2 - r1) / f);
FX_FLOAT gScale = (FX_FLOAT) (1.0 * (g2 - g1) / f);
FX_FLOAT bScale = (FX_FLOAT) (1.0 * (b2 - b1) / f);
- FX_INT32 a3, r3, g3, b3;
- for (FX_INT32 i = 0; i < FX_SHADING_Steps; i++) {
- a3 = (FX_INT32) (i * aScale);
- r3 = (FX_INT32) (i * rScale);
- g3 = (FX_INT32) (i * gScale);
- b3 = (FX_INT32) (i * bScale);
+ int32_t a3, r3, g3, b3;
+ for (int32_t i = 0; i < FX_SHADING_Steps; i++) {
+ a3 = (int32_t) (i * aScale);
+ r3 = (int32_t) (i * rScale);
+ g3 = (int32_t) (i * gScale);
+ b3 = (int32_t) (i * bScale);
_argbArray[i] = FXARGB_TODIB(FXARGB_MAKE((a1 + a3),
(r1 + r3),
(g1 + g3),
diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp
index 388fbc5ad5..99d3519dc8 100644
--- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp
+++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.cpp
@@ -21,7 +21,7 @@ FX_BOOL CFX_MetafileInterpreter::SetCurrentElement(CXML_Element * element)
_element = element;
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(int32_t & lineCap)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineCapElement = _element->GetElement(0);
@@ -30,8 +30,8 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineCap(FX_INT32 & lineCap)
return TRUE;
}
FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase,
- FX_INT32 & dashArray,
- FX_INT32 & dashCount)
+ int32_t & dashArray,
+ int32_t & dashCount)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * dashPhaseElement = _element->GetElement(0);
@@ -42,10 +42,10 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_FLOAT & dashPhase,
dashArray = dashArrayElement->GetAttrInteger("FX_FLOAT *");
CXML_Element * dashCountElement = _element->GetElement(2);
_FX_RETURN_VALUE_IF_FAIL(dashCountElement, FALSE);
- dashCount = dashCountElement->GetAttrInteger("FX_INT32");
+ dashCount = dashCountElement->GetAttrInteger("int32_t");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(int32_t & dashStyle)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * dashStyleElement = _element->GetElement(0);
@@ -53,7 +53,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineDash(FX_INT32 & dashStyle)
dashStyle = dashStyleElement->GetAttrInteger("FX_DashStyle");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(FX_INT32 & lineJoin)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineJoin(int32_t & lineJoin)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineJoinElement = _element->GetElement(0);
@@ -70,7 +70,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetMiterLimit(FX_FLOAT & miterLimit)
return TRUE;
}
FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth,
- FX_INT32 & isActOnDash)
+ int32_t & isActOnDash)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * lineWidthElement = _element->GetElement(0);
@@ -81,7 +81,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetLineWidth(FX_FLOAT & lineWidth,
isActOnDash = isActOnDashElement->GetAttrInteger("FX_BOOL");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(int32_t & color)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * colorElement = _element->GetElement(0);
@@ -89,7 +89,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetStrokeColor(FX_INT32 & color)
color = colorElement->GetAttrInteger("CFX_Color *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(int32_t & color)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * colorElement = _element->GetElement(0);
@@ -97,7 +97,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFillColor(FX_INT32 & color)
color = colorElement->GetAttrInteger("CFX_Color *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(int32_t & path, int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -108,9 +108,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StrokePath(FX_INT32 & path, FX_INT32 &
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path,
- FX_INT32 & fillMode,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(int32_t & path,
+ int32_t & fillMode,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -124,9 +124,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_FillPath(FX_INT32 & path,
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path,
- FX_INT32 & fillMode,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(int32_t & path,
+ int32_t & fillMode,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pathElement = _element->GetElement(0);
@@ -140,9 +140,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ClipPath(FX_INT32 & path,
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source,
- FX_INT32 & point,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(int32_t & source,
+ int32_t & point,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * sourceElement = _element->GetElement(0);
@@ -156,9 +156,9 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_DrawImage(FX_INT32 & source,
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source,
- FX_INT32 & rect,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(int32_t & source,
+ int32_t & rect,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * sourceElement = _element->GetElement(0);
@@ -172,7 +172,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_StretchImage(FX_INT32 & source,
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * matrixElement = _element->GetElement(0);
@@ -180,7 +180,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_ConcatMatrix(FX_INT32 & matrix)
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(int32_t & rect)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * rectElement = _element->GetElement(0);
@@ -188,7 +188,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetClipRect(FX_INT32 & rect)
rect = rectElement->GetAttrInteger("CFX_RectF *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(FX_INT32 & font)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetFont(int32_t & font)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * fontElement = _element->GetElement(0);
@@ -220,17 +220,17 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetCharSpacing(FX_FLOAT & spacing)
spacing = spacingElement->GetAttrFloat("FX_FLOAT");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(FX_INT32 & mode)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetTextDrawingMode(int32_t & mode)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * modeElement = _element->GetElement(0);
_FX_RETURN_VALUE_IF_FAIL(modeElement, FALSE);
- mode = modeElement->GetAttrInteger("FX_INT32");
+ mode = modeElement->GetAttrInteger("int32_t");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point,
- FX_INT32 & text,
- FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(int32_t & point,
+ int32_t & text,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * pointElement = _element->GetElement(0);
@@ -244,7 +244,7 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_SetText(FX_INT32 & point,
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix)
+FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics, int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * graphicsElement = _element->GetElement(0);
@@ -255,11 +255,11 @@ FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics, FX_INT32
matrix = matrixElement->GetAttrInteger("CFX_Matrix *");
return TRUE;
}
-FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(FX_INT32 & graphics,
+FX_BOOL CFX_MetafileInterpreter::ParamOf_Transfer(int32_t & graphics,
FX_FLOAT & srcLeft,
FX_FLOAT & srcTop,
- FX_INT32 & dstRect,
- FX_INT32 & matrix)
+ int32_t & dstRect,
+ int32_t & matrix)
{
_FX_RETURN_VALUE_IF_FAIL(_element, FALSE);
CXML_Element * graphicsElement = _element->GetElement(0);
diff --git a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h
index 64b63852ac..f28aa66a34 100644
--- a/xfa/src/fxgraphics/src/fx_metafile_interpreter.h
+++ b/xfa/src/fxgraphics/src/fx_metafile_interpreter.h
@@ -14,39 +14,39 @@ public:
FX_BOOL SetCurrentElement(CXML_Element * element);
- FX_BOOL ParamOf_SetLineCap(FX_INT32 & lineCap);
+ FX_BOOL ParamOf_SetLineCap(int32_t & lineCap);
FX_BOOL ParamOf_SetLineDash(FX_FLOAT & dashPhase,
- FX_INT32 & dashArray,
- FX_INT32 & dashCount);
- FX_BOOL ParamOf_SetLineDash(FX_INT32 & dashStyle);
- FX_BOOL ParamOf_SetLineJoin(FX_INT32 & lineJoin);
+ int32_t & dashArray,
+ int32_t & dashCount);
+ FX_BOOL ParamOf_SetLineDash(int32_t & dashStyle);
+ FX_BOOL ParamOf_SetLineJoin(int32_t & lineJoin);
FX_BOOL ParamOf_SetMiterLimit(FX_FLOAT & miterLimit);
- FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, FX_INT32 & isActOnDash);
+ FX_BOOL ParamOf_SetLineWidth(FX_FLOAT & lineWidth, int32_t & isActOnDash);
- FX_BOOL ParamOf_SetStrokeColor(FX_INT32 & color);
- FX_BOOL ParamOf_SetFillColor(FX_INT32 & color);
+ FX_BOOL ParamOf_SetStrokeColor(int32_t & color);
+ FX_BOOL ParamOf_SetFillColor(int32_t & color);
- FX_BOOL ParamOf_StrokePath(FX_INT32 & path, FX_INT32 & matrix);
- FX_BOOL ParamOf_FillPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix);
- FX_BOOL ParamOf_ClipPath(FX_INT32 & path, FX_INT32 & fillMode, FX_INT32 & matrix);
+ FX_BOOL ParamOf_StrokePath(int32_t & path, int32_t & matrix);
+ FX_BOOL ParamOf_FillPath(int32_t & path, int32_t & fillMode, int32_t & matrix);
+ FX_BOOL ParamOf_ClipPath(int32_t & path, int32_t & fillMode, int32_t & matrix);
- FX_BOOL ParamOf_DrawImage(FX_INT32 & source, FX_INT32 & point, FX_INT32 & matrix);
- FX_BOOL ParamOf_StretchImage(FX_INT32 & source, FX_INT32 & rect, FX_INT32 & matrix);
+ FX_BOOL ParamOf_DrawImage(int32_t & source, int32_t & point, int32_t & matrix);
+ FX_BOOL ParamOf_StretchImage(int32_t & source, int32_t & rect, int32_t & matrix);
- FX_BOOL ParamOf_ConcatMatrix(FX_INT32 & matrix);
- FX_BOOL ParamOf_SetClipRect(FX_INT32 & rect);
- FX_BOOL ParamOf_SetFont(FX_INT32 & font);
+ FX_BOOL ParamOf_ConcatMatrix(int32_t & matrix);
+ FX_BOOL ParamOf_SetClipRect(int32_t & rect);
+ FX_BOOL ParamOf_SetFont(int32_t & font);
FX_BOOL ParamOf_SetFontSize(FX_FLOAT & size);
FX_BOOL ParamOf_SetFontHScale(FX_FLOAT & scale);
FX_BOOL ParamOf_SetCharSpacing(FX_FLOAT & spacing);
- FX_BOOL ParamOf_SetTextDrawingMode(FX_INT32 & mode);
- FX_BOOL ParamOf_SetText(FX_INT32 & point, FX_INT32 & text, FX_INT32 & matrix);
- FX_BOOL ParamOf_Transfer(FX_INT32 & graphics, FX_INT32 & matrix);
- FX_BOOL ParamOf_Transfer(FX_INT32 & graphics,
+ FX_BOOL ParamOf_SetTextDrawingMode(int32_t & mode);
+ FX_BOOL ParamOf_SetText(int32_t & point, int32_t & text, int32_t & matrix);
+ FX_BOOL ParamOf_Transfer(int32_t & graphics, int32_t & matrix);
+ FX_BOOL ParamOf_Transfer(int32_t & graphics,
FX_FLOAT & srcLeft,
FX_FLOAT & srcTop,
- FX_INT32 & dstRect,
- FX_INT32 & matrix);
+ int32_t & dstRect,
+ int32_t & matrix);
private:
CXML_Element * _element;
diff --git a/xfa/src/fxgraphics/src/pre.h b/xfa/src/fxgraphics/src/pre.h
index ab0df3d9ac..701a48d85d 100644
--- a/xfa/src/fxgraphics/src/pre.h
+++ b/xfa/src/fxgraphics/src/pre.h
@@ -33,9 +33,9 @@ enum {
};
#define FX_HATCHSTYLE_Total 53
struct FX_HATCHDATA {
- FX_INT32 width;
- FX_INT32 height;
- FX_BYTE maskBits[64];
+ int32_t width;
+ int32_t height;
+ uint8_t maskBits[64];
};
typedef FX_HATCHDATA const * FX_LPCHATCHDATA;
static const FX_HATCHDATA hatchBitmapData[FX_HATCHSTYLE_Total] = {