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

Side by Side Diff: xfa/fxfa/app/xfa_ffwidget.cpp

Issue 1814233005: Make a few more const tables smaller. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: format Created 4 years, 9 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 | « xfa/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp ('k') | 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 "xfa/fxfa/app/xfa_ffwidget.h" 7 #include "xfa/fxfa/app/xfa_ffwidget.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 ((FX_DWORD)g_inv_base64[pBuffer[i + 3]]); 897 ((FX_DWORD)g_inv_base64[pBuffer[i + 3]]);
898 pOutBuffer[j] = (uint8_t)(dwLimb >> 16) & 0xff; 898 pOutBuffer[j] = (uint8_t)(dwLimb >> 16) & 0xff;
899 pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 8) & 0xff; 899 pOutBuffer[j + 1] = (uint8_t)(dwLimb >> 8) & 0xff;
900 pOutBuffer[j + 2] = (uint8_t)(dwLimb)&0xff; 900 pOutBuffer[j + 2] = (uint8_t)(dwLimb)&0xff;
901 j += 3; 901 j += 3;
902 } 902 }
903 } 903 }
904 FX_Free(pBuffer); 904 FX_Free(pBuffer);
905 return j; 905 return j;
906 } 906 }
907 static FX_CHAR g_base64_chars[] = 907
908 static const FX_CHAR g_base64_chars[] =
908 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 909 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
910
909 FX_CHAR* XFA_Base64Encode(const uint8_t* buf, int32_t buf_len) { 911 FX_CHAR* XFA_Base64Encode(const uint8_t* buf, int32_t buf_len) {
910 FX_CHAR* out = NULL; 912 FX_CHAR* out = NULL;
911 int i, j; 913 int i, j;
912 FX_DWORD limb; 914 FX_DWORD limb;
913 out = FX_Alloc(FX_CHAR, ((buf_len * 8 + 5) / 6) + 5); 915 out = FX_Alloc(FX_CHAR, ((buf_len * 8 + 5) / 6) + 5);
914 for (i = 0, j = 0, limb = 0; i + 2 < buf_len; i += 3, j += 4) { 916 for (i = 0, j = 0, limb = 0; i + 2 < buf_len; i += 3, j += 4) {
915 limb = ((FX_DWORD)buf[i] << 16) | ((FX_DWORD)buf[i + 1] << 8) | 917 limb = ((FX_DWORD)buf[i] << 16) | ((FX_DWORD)buf[i + 1] << 8) |
916 ((FX_DWORD)buf[i + 2]); 918 ((FX_DWORD)buf[i + 2]);
917 out[j] = g_base64_chars[(limb >> 18) & 63]; 919 out[j] = g_base64_chars[(limb >> 18) & 63];
918 out[j + 1] = g_base64_chars[(limb >> 12) & 63]; 920 out[j + 1] = g_base64_chars[(limb >> 12) & 63];
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 iType != XFA_ELEMENT_Rectangle) { 1956 iType != XFA_ELEMENT_Rectangle) {
1955 return; 1957 return;
1956 } 1958 }
1957 CXFA_StrokeArray strokes; 1959 CXFA_StrokeArray strokes;
1958 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { 1960 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) {
1959 box.GetStrokes(strokes); 1961 box.GetStrokes(strokes);
1960 } 1962 }
1961 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1963 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1962 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1964 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1963 } 1965 }
OLDNEW
« no previous file with comments | « xfa/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698