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

Side by Side Diff: core/src/fxge/dib/fx_dib_main.cpp

Issue 294353002: Fix warnings in android build, fix font rendering issue, fix issue 357588: wrong characters represe… (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Patch Set after rebase Created 6 years, 7 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 | « core/src/fxge/dib/fx_dib_convert.cpp ('k') | core/src/fxge/dib/fx_dib_transform.cpp » ('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/fxge/fx_dib.h" 7 #include "../../../include/fxge/fx_dib.h"
8 #include "../../../include/fxge/fx_ge.h" 8 #include "../../../include/fxge/fx_ge.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 #include "dib_int.h" 10 #include "dib_int.h"
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 FX_BYTE b, g, r; 1319 FX_BYTE b, g, r;
1320 AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanli ne[3], 1320 AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanli ne[3],
1321 r, g, b); 1321 r, g, b);
1322 int gray = 255 - FXRGB2GRAY(r, g, b); 1322 int gray = 255 - FXRGB2GRAY(r, g, b);
1323 *scanline ++ = bc + (fc - bc) * gray / 255; 1323 *scanline ++ = bc + (fc - bc) * gray / 255;
1324 *scanline ++ = bm + (fm - bm) * gray / 255; 1324 *scanline ++ = bm + (fm - bm) * gray / 255;
1325 *scanline ++ = by + (fy - by) * gray / 255; 1325 *scanline ++ = by + (fy - by) * gray / 255;
1326 *scanline ++ = bk + (fk - bk) * gray / 255; 1326 *scanline ++ = bk + (fk - bk) * gray / 255;
1327 } 1327 }
1328 } 1328 }
1329 } else 1329 } else {
1330 for (int row = 0; row < m_Height; row ++) { 1330 for (int row = 0; row < m_Height; row ++) {
1331 FX_LPBYTE scanline = m_pBuffer + row * m_Pitch; 1331 FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
1332 int gap = m_bpp / 8 - 2; 1332 int gap = m_bpp / 8 - 2;
1333 for (int col = 0; col < m_Width; col ++) { 1333 for (int col = 0; col < m_Width; col ++) {
1334 int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]); 1334 int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
1335 *scanline ++ = bb + (fb - bb) * gray / 255; 1335 *scanline ++ = bb + (fb - bb) * gray / 255;
1336 *scanline ++ = bg + (fg - bg) * gray / 255; 1336 *scanline ++ = bg + (fg - bg) * gray / 255;
1337 *scanline = br + (fr - br) * gray / 255; 1337 *scanline = br + (fr - br) * gray / 255;
1338 scanline += gap; 1338 scanline += gap;
1339 } 1339 }
1340 } 1340 }
1341 }
1341 return TRUE; 1342 return TRUE;
1342 } 1343 }
1343 FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_ RECT* pRect) 1344 FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_ RECT* pRect)
1344 { 1345 {
1345 if (m_pBuffer == NULL) { 1346 if (m_pBuffer == NULL) {
1346 return FALSE; 1347 return FALSE;
1347 } 1348 }
1348 if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) { 1349 if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) {
1349 return FALSE; 1350 return FALSE;
1350 } 1351 }
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 if (!m_pBitmap->Create(width, height, src_format)) { 1726 if (!m_pBitmap->Create(width, height, src_format)) {
1726 delete m_pBitmap; 1727 delete m_pBitmap;
1727 m_pBitmap = NULL; 1728 m_pBitmap = NULL;
1728 return FALSE; 1729 return FALSE;
1729 } 1730 }
1730 if (pSrcPalette) { 1731 if (pSrcPalette) {
1731 m_pBitmap->CopyPalette(pSrcPalette); 1732 m_pBitmap->CopyPalette(pSrcPalette);
1732 } 1733 }
1733 return TRUE; 1734 return TRUE;
1734 } 1735 }
OLDNEW
« no previous file with comments | « core/src/fxge/dib/fx_dib_convert.cpp ('k') | core/src/fxge/dib/fx_dib_transform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698