| 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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fpdfview.h" | 8 #include "../include/fpdfview.h" |
| 9 #include "../include/fsdk_rendercontext.h" | 9 #include "../include/fsdk_rendercontext.h" |
| 10 #include "../include/fpdf_progressive.h" | 10 #include "../include/fpdf_progressive.h" |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 pBitmap->Clear(0x00ffffff); | 451 pBitmap->Clear(0x00ffffff); |
| 452 #ifdef _SKIA_SUPPORT_ | 452 #ifdef _SKIA_SUPPORT_ |
| 453 pContext->m_pDevice = FX_NEW CFX_SkiaDevice; | 453 pContext->m_pDevice = FX_NEW CFX_SkiaDevice; |
| 454 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pB
itmap); | 454 ((CFX_SkiaDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pB
itmap); |
| 455 #else | 455 #else |
| 456 pContext->m_pDevice = FX_NEW CFX_FxgeDevice; | 456 pContext->m_pDevice = FX_NEW CFX_FxgeDevice; |
| 457 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pB
itmap); | 457 ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)pB
itmap); |
| 458 #endif | 458 #endif |
| 459 } | 459 } |
| 460 else | 460 else |
| 461 » pContext->m_pDevice = FX_NEW CFX_WindowsDevice(dc); | 461 » pContext->m_pDevice = FX_NEW CFX_WindowsDevice(dc); |
| 462 if (flags & FPDF_NO_CATCH) | 462 if (flags & FPDF_NO_CATCH) |
| 463 Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y
, rotate, flags,TRUE,NULL); | 463 Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y
, rotate, flags,TRUE,NULL); |
| 464 else { | 464 else { |
| 465 try { | 465 try { |
| 466 Func_RenderPage(pContext, page, start_x, start_y, size_x
, size_y, rotate, flags,TRUE,NULL); | 466 Func_RenderPage(pContext, page, start_x, start_y, size_x
, size_y, rotate, flags,TRUE,NULL); |
| 467 } catch (...) { | 467 } catch (...) { |
| 468 } | 468 } |
| 469 } | 469 } |
| 470 if (bBackgroundAlphaNeeded) | 470 if (bBackgroundAlphaNeeded) |
| 471 { | 471 { |
| 472 if (pBitmap) | 472 if (pBitmap) |
| 473 { | 473 { |
| 474 CFX_WindowsDevice WinDC(dc); | 474 CFX_WindowsDevice WinDC(dc); |
| 475 | 475 |
| 476 if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINT
ER) | 476 if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINT
ER) |
| 477 { | 477 { |
| 478 CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap; | 478 CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap; |
| 479 pDst->Create(pBitmap->GetWidth(), pBitmap->GetHe
ight(),FXDIB_Rgb32); | 479 pDst->Create(pBitmap->GetWidth(), pBitmap->GetHe
ight(),FXDIB_Rgb32); |
| 480 FXSYS_memcpy(pDst->GetBuffer(), pBitmap->GetBuff
er(), pBitmap->GetPitch()*pBitmap->GetHeight()); | 480 FXSYS_memcpy(pDst->GetBuffer(), pBitmap->GetBuff
er(), pBitmap->GetPitch()*pBitmap->GetHeight()); |
| 481 // WinDC.SetDIBits(pDst,0,0); | 481 // WinDC.SetDIBits(pDst,0,0); |
| 482 » » » » WinDC.StretchDIBits(pDst,0,0,size_x*2,size_y*2); | 482 » » » » WinDC.StretchDIBits(pDst,0,0,size_x,size_y); |
| 483 delete pDst; | 483 delete pDst; |
| 484 } | 484 } |
| 485 else | 485 else |
| 486 WinDC.SetDIBits(pBitmap,0,0); | 486 WinDC.SetDIBits(pBitmap,0,0); |
| 487 | 487 |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 #else | 490 #else |
| 491 // get clip region | 491 // get clip region |
| 492 RECT rect, cliprect; | 492 RECT rect, cliprect; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 { | 894 { |
| 895 if (document == NULL) | 895 if (document == NULL) |
| 896 return NULL; | 896 return NULL; |
| 897 if (name == NULL || name[0] == 0) | 897 if (name == NULL || name[0] == 0) |
| 898 return NULL; | 898 return NULL; |
| 899 | 899 |
| 900 CPDF_Document* pDoc = (CPDF_Document*)document; | 900 CPDF_Document* pDoc = (CPDF_Document*)document; |
| 901 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); | 901 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); |
| 902 return name_tree.LookupNamedDest(pDoc, name); | 902 return name_tree.LookupNamedDest(pDoc, name); |
| 903 } | 903 } |
| OLD | NEW |