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

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

Issue 376043003: Revert commit 95c018e2d15ecc3a5bd2a9aab18638316a6d3d46 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 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 | « fpdfsdk/include/fpdfview.h ('k') | samples/pdfium_test.cc » ('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/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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 fx_format = FXDIB_Argb; 718 fx_format = FXDIB_Argb;
719 break; 719 break;
720 default: 720 default:
721 return NULL; 721 return NULL;
722 } 722 }
723 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; 723 CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
724 pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride) ; 724 pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride) ;
725 return pBitmap; 725 return pBitmap;
726 } 726 }
727 727
728 DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top , int width, int height, FPDF_DWORD color) 728 DLLEXPORT void STDCALL FPDFBitmap_FillRect(FPDF_BITMAP bitmap, int left, int top , int width, int height,
729 » » » » » » » » » int red, int green, int blue, int alpha)
729 { 730 {
730 if (bitmap == NULL) return; 731 if (bitmap == NULL) return;
731 #ifdef _SKIA_SUPPORT_ 732 #ifdef _SKIA_SUPPORT_
732 CFX_SkiaDevice device; 733 CFX_SkiaDevice device;
733 #else 734 #else
734 CFX_FxgeDevice device; 735 CFX_FxgeDevice device;
735 #endif 736 #endif
736 device.Attach((CFX_DIBitmap*)bitmap); 737 device.Attach((CFX_DIBitmap*)bitmap);
737 » if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) color |= 0xFF000000; 738 » if (!((CFX_DIBitmap*)bitmap)->HasAlpha()) alpha = 255;
738 FX_RECT rect(left, top, left+width, top+height); 739 FX_RECT rect(left, top, left+width, top+height);
739 » device.FillRect(&rect, color); 740 » device.FillRect(&rect, FXARGB_MAKE(alpha, red, green, blue));
740 } 741 }
741 742
742 DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap) 743 DLLEXPORT void* STDCALL FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
743 { 744 {
744 if (bitmap == NULL) return NULL; 745 if (bitmap == NULL) return NULL;
745 return ((CFX_DIBitmap*)bitmap)->GetBuffer(); 746 return ((CFX_DIBitmap*)bitmap)->GetBuffer();
746 } 747 }
747 748
748 DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap) 749 DLLEXPORT int STDCALL FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
749 { 750 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 { 864 {
864 if (document == NULL) 865 if (document == NULL)
865 return NULL; 866 return NULL;
866 if (name == NULL || name[0] == 0) 867 if (name == NULL || name[0] == 0)
867 return NULL; 868 return NULL;
868 869
869 CPDF_Document* pDoc = (CPDF_Document*)document; 870 CPDF_Document* pDoc = (CPDF_Document*)document;
870 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 871 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
871 return name_tree.LookupNamedDest(pDoc, name); 872 return name_tree.LookupNamedDest(pDoc, name);
872 } 873 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/fpdfview.h ('k') | samples/pdfium_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698