Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: core/src/fxge/win32/fx_win32_gdipext.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/win32/fx_win32_dwrite.cpp ('k') | core/src/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_
9 #include <windows.h> 9 #include <windows.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePalette)(GpImage *image, Colo rPalette *palette, INT size); 213 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePalette)(GpImage *image, Colo rPalette *palette, INT size);
214 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePaletteSize)(GpImage *image, INT *size); 214 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetImagePaletteSize)(GpImage *image, INT *size);
215 typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapUnlockBits)(GpBitmap* bitmap, B itmapData* lockedBitmapData); 215 typedef GpStatus (WINGDIPAPI *FuncType_GdipBitmapUnlockBits)(GpBitmap* bitmap, B itmapData* lockedBitmapData);
216 typedef GpStatus (WINGDIPAPI *FuncType_GdipDisposeImage)(GpImage *image); 216 typedef GpStatus (WINGDIPAPI *FuncType_GdipDisposeImage)(GpImage *image);
217 typedef GpStatus (WINGDIPAPI *FuncType_GdipFillRectangle)(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height); 217 typedef GpStatus (WINGDIPAPI *FuncType_GdipFillRectangle)(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height);
218 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromScan0)(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap); 218 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromScan0)(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap);
219 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIP CONST ColorPalette *palette); 219 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIP CONST ColorPalette *palette);
220 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *gra phics, InterpolationMode interpolationMode); 220 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *gra phics, InterpolationMode interpolationMode);
221 typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphic s, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count); 221 typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphic s, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count);
222 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BIT MAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap); 222 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BIT MAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap);
223 typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT FX_UINTPTR *token, const Gd iplusStartupInput *input, OUT GdiplusStartupOutput *output); 223 typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT uintptr_t *token, const Gdi plusStartupInput *input, OUT GdiplusStartupOutput *output);
224 typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPe n *pen, int x1, int y1, int x2, int y2); 224 typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPe n *pen, int x1, int y1, int x2, int y2);
225 typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics); 225 typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics);
226 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpP ath **path); 226 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpP ath **path);
227 typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathPath)(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect); 227 typedef GpStatus (WINGDIPAPI *FuncType_GdipAddPathPath)(GpPath *path, GDIPCONST GpPath* addingPath, BOOL connect);
228 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPathFillMode)(GpPath *path, GpFill Mode fillmode); 228 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetPathFillMode)(GpPath *path, GpFill Mode fillmode);
229 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipPath)(GpGraphics *graphics, Gp Path *path, CombineMode combineMode); 229 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipPath)(GpGraphics *graphics, Gp Path *path, CombineMode combineMode);
230 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClip)(GpGraphics *graphics, GpRegi on *region); 230 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClip)(GpGraphics *graphics, GpRegi on *region);
231 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegion)(GpRegion **region); 231 typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateRegion)(GpRegion **region);
232 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClipBoundsI)(GpGraphics *graphics, GpRect *rect); 232 typedef GpStatus (WINGDIPAPI *FuncType_GdipGetClipBoundsI)(GpGraphics *graphics, GpRect *rect);
233 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipRegion)(GpGraphics *graphics, GpRegion *region, CombineMode combineMode); 233 typedef GpStatus (WINGDIPAPI *FuncType_GdipSetClipRegion)(GpGraphics *graphics, GpRegion *region, CombineMode combineMode);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 if (m_hModule == NULL) { 502 if (m_hModule == NULL) {
503 return; 503 return;
504 } 504 }
505 for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) { 505 for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i ++) {
506 m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); 506 m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]);
507 if (m_Functions[i] == NULL) { 507 if (m_Functions[i] == NULL) {
508 m_hModule = NULL; 508 m_hModule = NULL;
509 return; 509 return;
510 } 510 }
511 } 511 }
512 FX_UINTPTR gdiplusToken; 512 uintptr_t gdiplusToken;
513 GdiplusStartupInput gdiplusStartupInput; 513 GdiplusStartupInput gdiplusStartupInput;
514 ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL); 514 ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL);
515 m_GdiModule = LoadLibraryA("GDI32.DLL"); 515 m_GdiModule = LoadLibraryA("GDI32.DLL");
516 if (m_GdiModule == NULL) { 516 if (m_GdiModule == NULL) {
517 return; 517 return;
518 } 518 }
519 m_pGdiAddFontMemResourceEx = GetProcAddress(m_GdiModule, "AddFontMemResource Ex"); 519 m_pGdiAddFontMemResourceEx = GetProcAddress(m_GdiModule, "AddFontMemResource Ex");
520 m_pGdiRemoveFontMemResourseEx = GetProcAddress(m_GdiModule, "RemoveFontMemRe sourceEx"); 520 m_pGdiRemoveFontMemResourseEx = GetProcAddress(m_GdiModule, "RemoveFontMemRe sourceEx");
521 } 521 }
522 CGdiplusExt::~CGdiplusExt() 522 CGdiplusExt::~CGdiplusExt()
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 size_t bytes_out; 1040 size_t bytes_out;
1041 if (pcbRead != NULL) { 1041 if (pcbRead != NULL) {
1042 *pcbRead = 0; 1042 *pcbRead = 0;
1043 } 1043 }
1044 if (m_ReadPos == m_InterStream.GetLength()) { 1044 if (m_ReadPos == m_InterStream.GetLength()) {
1045 return HRESULT_FROM_WIN32(ERROR_END_OF_MEDIA); 1045 return HRESULT_FROM_WIN32(ERROR_END_OF_MEDIA);
1046 } 1046 }
1047 bytes_left = m_InterStream.GetLength() - m_ReadPos; 1047 bytes_left = m_InterStream.GetLength() - m_ReadPos;
1048 bytes_out = FX_MIN(cb, bytes_left); 1048 bytes_out = FX_MIN(cb, bytes_left);
1049 FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out) ; 1049 FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out) ;
1050 m_ReadPos += (FX_INT32)bytes_out; 1050 m_ReadPos += (int32_t)bytes_out;
1051 if (pcbRead != NULL) { 1051 if (pcbRead != NULL) {
1052 *pcbRead = (ULONG)bytes_out; 1052 *pcbRead = (ULONG)bytes_out;
1053 } 1053 }
1054 return S_OK; 1054 return S_OK;
1055 } 1055 }
1056 virtual HRESULT STDMETHODCALLTYPE Write(void const* Input, ULONG cb, ULONG* pcbWritten) 1056 virtual HRESULT STDMETHODCALLTYPE Write(void const* Input, ULONG cb, ULONG* pcbWritten)
1057 { 1057 {
1058 if (cb <= 0) { 1058 if (cb <= 0) {
1059 if (pcbWritten != NULL) { 1059 if (pcbWritten != NULL) {
1060 *pcbWritten = 0; 1060 *pcbWritten = 0;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 for (int i = 0; i < height; i ++) { 1251 for (int i = 0; i < height; i ++) {
1252 FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, dest_pitch); 1252 FXSYS_memcpy32(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, dest_pitch);
1253 } 1253 }
1254 } 1254 }
1255 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn fo->pbmi->bmiHeader.biBitCount == 32); 1255 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn fo->pbmi->bmiHeader.biBitCount == 32);
1256 FX_Free(pData); 1256 FX_Free(pData);
1257 FreeDIBitmap(pInfo); 1257 FreeDIBitmap(pInfo);
1258 return pDIBitmap; 1258 return pDIBitmap;
1259 } 1259 }
1260 #endif 1260 #endif
OLDNEW
« no previous file with comments | « core/src/fxge/win32/fx_win32_dwrite.cpp ('k') | core/src/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698