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

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 826633002: In windows printing, convert src bitmap to dest bitmap using CompositeBitmap. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 12 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 | « no previous file | no next file » | 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/fsdk_define.h" 7 #include "../include/fsdk_define.h"
8 #include "../include/fsdk_mgr.h" 8 #include "../include/fsdk_mgr.h"
9 #include "../include/fpdfview.h" 9 #include "../include/fpdfview.h"
10 #include "../include/fsdk_rendercontext.h" 10 #include "../include/fsdk_rendercontext.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 if (bBackgroundAlphaNeeded) 377 if (bBackgroundAlphaNeeded)
378 { 378 {
379 if (pBitmap) 379 if (pBitmap)
380 { 380 {
381 CFX_WindowsDevice WinDC(dc); 381 CFX_WindowsDevice WinDC(dc);
382 382
383 if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINT ER) 383 if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINT ER)
384 { 384 {
385 CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap; 385 CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap;
386 » » » » pDst->Create(pBitmap->GetWidth(), pBitmap->GetHe ight(),FXDIB_Rgb32); 386 » » » » int pitch = pBitmap->GetPitch();
387 » » » » FXSYS_memcpy(pDst->GetBuffer(), pBitmap->GetBuff er(), pBitmap->GetPitch()*pBitmap->GetHeight()); 387 » » » » pDst->Create(size_x, size_y, FXDIB_Rgb32);
388 //» » » » WinDC.SetDIBits(pDst,0,0); 388 » » » » FXSYS_memset(pDst->GetBuffer(), -1, pitch*size_y );
389 » » » » pDst->CompositeBitmap(0, 0, size_x, size_y, pBit map, 0, 0, FXDIB_BLEND_NORMAL, NULL, FALSE, NULL);
389 WinDC.StretchDIBits(pDst,0,0,size_x,size_y); 390 WinDC.StretchDIBits(pDst,0,0,size_x,size_y);
390 delete pDst; 391 delete pDst;
391 } 392 }
392 else 393 else
393 WinDC.SetDIBits(pBitmap,0,0); 394 WinDC.SetDIBits(pBitmap,0,0);
394 395
395 } 396 }
396 } 397 }
397 #else 398 #else
398 // get clip region 399 // get clip region
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 { 793 {
793 if (document == NULL) 794 if (document == NULL)
794 return NULL; 795 return NULL;
795 if (name == NULL || name[0] == 0) 796 if (name == NULL || name[0] == 0)
796 return NULL; 797 return NULL;
797 798
798 CPDF_Document* pDoc = (CPDF_Document*)document; 799 CPDF_Document* pDoc = (CPDF_Document*)document;
799 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 800 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
800 return name_tree.LookupNamedDest(pDoc, name); 801 return name_tree.LookupNamedDest(pDoc, name);
801 } 802 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698