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

Side by Side Diff: core/src/fxge/ge/fx_ge_text.cpp

Issue 1409973003: Remove unused error variable from CFX_Font::AdjustMMParams (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxge/fx_freetype.h" 8 #include "../../../include/fxge/fx_freetype.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 #include "text_int.h" 10 #include "text_int.h"
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536; 1394 coords[0] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 0)) / 65536;
1395 } else { 1395 } else {
1396 coords[0] = weight; 1396 coords[0] = weight;
1397 } 1397 }
1398 if (dest_width == 0) { 1398 if (dest_width == 0) {
1399 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; 1399 coords[1] = FXFT_Get_MM_Axis_Def(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
1400 } else { 1400 } else {
1401 int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; 1401 int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
1402 int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536; 1402 int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
1403 coords[1] = min_param; 1403 coords[1] = min_param;
1404 int error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); 1404 (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
Lei Zhang 2015/10/22 18:53:40 Uh, we had plans to actually check |error|. See ht
Oliver Chang 2015/10/22 18:58:55 Sure, I wasn't sure if it was worth rewriting the
1405 error = FXFT_Load_Glyph( 1405 (void)FXFT_Load_Glyph(
1406 m_Face, glyph_index, 1406 m_Face, glyph_index,
1407 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); 1407 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
1408 int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / 1408 int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 /
1409 FXFT_Get_Face_UnitsPerEM(m_Face); 1409 FXFT_Get_Face_UnitsPerEM(m_Face);
1410 coords[1] = max_param; 1410 coords[1] = max_param;
1411 error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); 1411 (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
1412 error = FXFT_Load_Glyph( 1412 (void)FXFT_Load_Glyph(
1413 m_Face, glyph_index, 1413 m_Face, glyph_index,
1414 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH); 1414 FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
1415 int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 / 1415 int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 /
1416 FXFT_Get_Face_UnitsPerEM(m_Face); 1416 FXFT_Get_Face_UnitsPerEM(m_Face);
1417 if (max_width == min_width) { 1417 if (max_width == min_width) {
1418 FXFT_Free(m_Face, pMasters);
1418 return; 1419 return;
1419 } 1420 }
1420 int param = min_param + 1421 int param = min_param +
1421 (max_param - min_param) * (dest_width - min_width) / 1422 (max_param - min_param) * (dest_width - min_width) /
1422 (max_width - min_width); 1423 (max_width - min_width);
1423 coords[1] = param; 1424 coords[1] = param;
1424 } 1425 }
1425 FXFT_Free(m_Face, pMasters); 1426 FXFT_Free(m_Face, pMasters);
1426 FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords); 1427 FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
1427 } 1428 }
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 void _CFX_UniqueKeyGen::Generate(int count, ...) { 1871 void _CFX_UniqueKeyGen::Generate(int count, ...) {
1871 va_list argList; 1872 va_list argList;
1872 va_start(argList, count); 1873 va_start(argList, count);
1873 for (int i = 0; i < count; i++) { 1874 for (int i = 0; i < count; i++) {
1874 int p = va_arg(argList, int); 1875 int p = va_arg(argList, int);
1875 ((FX_DWORD*)m_Key)[i] = p; 1876 ((FX_DWORD*)m_Key)[i] = p;
1876 } 1877 }
1877 va_end(argList); 1878 va_end(argList);
1878 m_KeyLen = count * sizeof(FX_DWORD); 1879 m_KeyLen = count * sizeof(FX_DWORD);
1879 } 1880 }
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