summaryrefslogtreecommitdiff
path: root/core/src/fxge/apple/fx_quartz_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxge/apple/fx_quartz_device.cpp')
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index f7faee15b3..6a97c7baf2 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -81,7 +81,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
CGPoint* glyphPositions,
- FX_INT32 charsCount,
+ int32_t charsCount,
FX_ARGB argb,
CFX_AffineMatrix* matrix )
{
@@ -102,7 +102,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
matrix->f));
CGContextSetTextMatrix(context, m);
}
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(context,
r / 255.f,
@@ -166,7 +166,7 @@ static CGContextRef createContextWithBitmap(CFX_DIBitmap* pBitmap)
CGColorSpaceRelease(colorSpace);
return context;
}
-CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass)
+CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass)
{
m_saveCount = 0;
_context = context;
@@ -438,7 +438,7 @@ FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
}
CGRect rect_fx = CGRectMake(rect->left, rect->top, rect->Width(), rect->Height());
CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(fillArgb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -470,7 +470,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
pt = CGPointApplyAffineTransform(CGPointMake(x2, y2), _foxitDevice2User);
x2 = pt.x;
y2 = pt.y;
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBStrokeColor(_context,
r / 255.f,
@@ -496,8 +496,8 @@ FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
return TRUE;
}
FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
- FX_INT32 left,
- FX_INT32 top,
+ int32_t left,
+ int32_t top,
void* pIccTransform,
FX_BOOL bDEdge)
{
@@ -656,9 +656,9 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f);
pScanline += 4;
}
}
@@ -781,9 +781,9 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f);
pScanline += 4;
}
}
@@ -844,7 +844,7 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars
CGContextSetTextMatrix(_context, matrix_cg);
CGContextSetFont(_context, (CGFontRef)pFont->m_pPlatformFont);
CGContextSetFontSize(_context, FXSYS_fabs(font_size));
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -897,7 +897,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
SaveState();
CGContextSetTextDrawingMode(_context, kCGTextFillClip);
FX_BOOL ret = FALSE;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < nChars) {
if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
if (i > 0) {
@@ -992,7 +992,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState,
delete[] dashArray;
#endif
}
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBStrokeColor(_context,
r / 255.f,
@@ -1002,7 +1002,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState,
}
void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
{
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -1012,10 +1012,10 @@ void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
}
void CFX_QuartzDeviceDriver::setPathToContext(const CFX_PathData* pathData)
{
- FX_INT32 count = pathData->GetPointCount();
+ int32_t count = pathData->GetPointCount();
FX_PATHPOINT* points = pathData->GetPoints();
CGContextBeginPath(_context);
- for (FX_INT32 i = 0; i < count; i ++) {
+ for (int32_t i = 0; i < count; i ++) {
switch (points[i].m_Flag & FXPT_TYPE) {
case FXPT_MOVETO:
CGContextMoveToPoint(_context, points[i].m_PointX, points[i].m_PointY);
@@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext()
{
return m_pContext;
}
-FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, FX_INT32 nDeviceClass)
+FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
{
if (m_pContext) {
CGContextRelease(m_pContext);
@@ -1112,9 +1112,9 @@ FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
SetDeviceDriver(pDriver);
return TRUE;
}
-FX_BOOL CFX_QuartzDevice::Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format)
+FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
{
- if ((FX_BYTE)format < 32) {
+ if ((uint8_t)format < 32) {
return FALSE;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;