OLD | NEW |
---|---|
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 <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 void* CGdiplusExt::GdiAddFontMemResourceEx(void* pFontdata, | 442 void* CGdiplusExt::GdiAddFontMemResourceEx(void* pFontdata, |
443 uint32_t size, | 443 uint32_t size, |
444 void* pdv, | 444 void* pdv, |
445 uint32_t* num_face) { | 445 uint32_t* num_face) { |
446 if (m_pGdiAddFontMemResourceEx) { | 446 if (m_pGdiAddFontMemResourceEx) { |
447 return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)( | 447 return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)( |
448 (PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face); | 448 (PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face); |
449 } | 449 } |
450 return nullptr; | 450 return nullptr; |
451 } | 451 } |
452 | |
452 FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle) { | 453 FX_BOOL CGdiplusExt::GdiRemoveFontMemResourceEx(void* handle) { |
453 if (m_pGdiRemoveFontMemResourseEx) { | 454 return m_pGdiRemoveFontMemResourseEx && |
454 return ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)( | 455 ((FuncType_GdiRemoveFontMemResourceEx)m_pGdiRemoveFontMemResourseEx)( |
Tom Sepez
2016/10/28 17:17:17
note: this cast scares me, but for another day.
Lei Zhang
2016/10/28 18:00:52
You may want to check to see if this actually gets
Tom Sepez
2016/10/28 18:06:27
Fixed in a follow-up CL.
| |
455 (HANDLE)handle); | 456 (HANDLE)handle); |
456 } | |
457 return FALSE; | |
458 } | 457 } |
458 | |
459 static GpBrush* _GdipCreateBrush(DWORD argb) { | 459 static GpBrush* _GdipCreateBrush(DWORD argb) { |
460 CGdiplusExt& GdiplusExt = | 460 CGdiplusExt& GdiplusExt = |
461 ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; | 461 ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; |
462 GpSolidFill* solidBrush = nullptr; | 462 GpSolidFill* solidBrush = nullptr; |
463 CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush); | 463 CallFunc(GdipCreateSolidFill)((ARGB)argb, &solidBrush); |
464 return solidBrush; | 464 return solidBrush; |
465 } | 465 } |
466 static CFX_DIBitmap* _StretchMonoToGray(int dest_width, | 466 static CFX_DIBitmap* _StretchMonoToGray(int dest_width, |
467 int dest_height, | 467 int dest_height, |
468 const CFX_DIBitmap* pSource, | 468 const CFX_DIBitmap* pSource, |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1517 FXSYS_memcpy(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, | 1517 FXSYS_memcpy(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride * i, |
1518 dest_pitch); | 1518 dest_pitch); |
1519 } | 1519 } |
1520 } | 1520 } |
1521 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( | 1521 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( |
1522 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); | 1522 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); |
1523 FX_Free(pData); | 1523 FX_Free(pData); |
1524 FreeDIBitmap(pInfo); | 1524 FreeDIBitmap(pInfo); |
1525 return pDIBitmap; | 1525 return pDIBitmap; |
1526 } | 1526 } |
OLD | NEW |