From bb17868d736f698d5217c30d52c5bbfed62c5936 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 11:30:25 -0700 Subject: Use stdint.h types throughout PDFium. It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002 --- core/src/fxge/apple/apple_int.h | 26 +++++++++---------- core/src/fxge/apple/fx_quartz_device.cpp | 44 ++++++++++++++++---------------- 2 files changed, 35 insertions(+), 35 deletions(-) (limited to 'core/src/fxge/apple') diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h index 2466ecbc9a..6cd880603a 100644 --- a/core/src/fxge/apple/apple_int.h +++ b/core/src/fxge/apple/apple_int.h @@ -56,7 +56,7 @@ public: FX_FLOAT fontSize, FX_WORD* glyphIndices, CGPoint* glyphPositions, - FX_INT32 chars, + int32_t chars, FX_ARGB argb, CFX_AffineMatrix* matrix = NULL); void saveGraphicsState(void* graphics); @@ -81,7 +81,7 @@ public: class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver { public: - CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass); + CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass); virtual ~CFX_QuartzDeviceDriver(); virtual int GetDeviceCaps(int caps_id); @@ -176,15 +176,15 @@ protected: CGContextRef _context; CGAffineTransform _foxitDevice2User; CGAffineTransform _user2FoxitDevice; - FX_INT32 m_saveCount; + int32_t m_saveCount; - FX_INT32 _width; - FX_INT32 _height; - FX_INT32 _bitsPerPixel; - FX_INT32 _deviceClass; - FX_INT32 _renderCaps; - FX_INT32 _horzSize; - FX_INT32 _vertSize; + int32_t _width; + int32_t _height; + int32_t _bitsPerPixel; + int32_t _deviceClass; + int32_t _renderCaps; + int32_t _horzSize; + int32_t _vertSize; }; class CFX_FontProvider final : public IFX_FileRead { @@ -239,10 +239,10 @@ private: int _tableCount; int _totalSize; }; -FX_UINT32 FX_GetHashCode( FX_LPCSTR pStr); +uint32_t FX_GetHashCode( FX_LPCSTR pStr); FX_DWORD FX_IOSGetMatchFamilyNameHashcode(FX_LPCSTR pFontName); -FX_UINT32 FX_IOSGetFamilyNamesCount(); -FX_LPCSTR FX_IOSGetFamilyName( FX_UINT32 uIndex); +uint32_t FX_IOSGetFamilyNamesCount(); +FX_LPCSTR FX_IOSGetFamilyName( uint32_t uIndex); #endif #endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_ 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; -- cgit v1.2.3