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

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

Issue 1239313005: Merge to XFA - else after returns. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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
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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 switch (GetFormat()) { 1047 switch (GetFormat()) {
1048 case FXDIB_1bppMask: { 1048 case FXDIB_1bppMask: {
1049 if ((*pos) & (1 << (7 - x % 8))) { 1049 if ((*pos) & (1 << (7 - x % 8))) {
1050 return 0xff000000; 1050 return 0xff000000;
1051 } 1051 }
1052 return 0; 1052 return 0;
1053 } 1053 }
1054 case FXDIB_1bppRgb: { 1054 case FXDIB_1bppRgb: {
1055 if ((*pos) & (1 << (7 - x % 8))) { 1055 if ((*pos) & (1 << (7 - x % 8))) {
1056 return m_pPalette ? m_pPalette[1] : 0xffffffff; 1056 return m_pPalette ? m_pPalette[1] : 0xffffffff;
1057 } else {
1058 return m_pPalette ? m_pPalette[0] : 0xff000000;
1059 } 1057 }
1060 break; 1058 return m_pPalette ? m_pPalette[0] : 0xff000000;
1061 } 1059 }
1062 case FXDIB_8bppMask: 1060 case FXDIB_8bppMask:
1063 return (*pos) << 24; 1061 return (*pos) << 24;
1064 case FXDIB_8bppRgb: 1062 case FXDIB_8bppRgb:
1065 return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x101 01)); 1063 return m_pPalette ? m_pPalette[*pos] : (0xff000000 | ((*pos) * 0x101 01));
1066 case FXDIB_Rgb: 1064 case FXDIB_Rgb:
1067 case FXDIB_Rgba: 1065 case FXDIB_Rgba:
1068 case FXDIB_Rgb32: 1066 case FXDIB_Rgb32:
1069 return FXARGB_GETDIB(pos) | 0xff000000; 1067 return FXARGB_GETDIB(pos) | 0xff000000;
1070 case FXDIB_Argb: 1068 case FXDIB_Argb:
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, 1609 m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color,
1612 m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_fl ag, pIccTransform, m_BlendType); 1610 m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_fl ag, pIccTransform, m_BlendType);
1613 m_Status = 1; 1611 m_Status = 1;
1614 ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitma p_clip, dib_flags); 1612 ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitma p_clip, dib_flags);
1615 return ret; 1613 return ret;
1616 } 1614 }
1617 FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause) 1615 FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
1618 { 1616 {
1619 if (m_Status == 1) { 1617 if (m_Status == 1) {
1620 return m_Stretcher.Continue(pPause); 1618 return m_Stretcher.Continue(pPause);
1621 } else if (m_Status == 2) { 1619 }
1620 if (m_Status == 2) {
1622 if (m_pTransformer->Continue(pPause)) { 1621 if (m_pTransformer->Continue(pPause)) {
1623 return TRUE; 1622 return TRUE;
1624 } 1623 }
1625 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); 1624 CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach();
1626 if (pBitmap == NULL) { 1625 if (pBitmap == NULL) {
1627 return FALSE; 1626 return FALSE;
1628 } 1627 }
1629 if (pBitmap->GetBuffer() == NULL) { 1628 if (pBitmap->GetBuffer() == NULL) {
1630 delete pBitmap; 1629 delete pBitmap;
1631 return FALSE; 1630 return FALSE;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 if (!m_pBitmap->Create(width, height, src_format)) { 1692 if (!m_pBitmap->Create(width, height, src_format)) {
1694 delete m_pBitmap; 1693 delete m_pBitmap;
1695 m_pBitmap = NULL; 1694 m_pBitmap = NULL;
1696 return FALSE; 1695 return FALSE;
1697 } 1696 }
1698 if (pSrcPalette) { 1697 if (pSrcPalette) {
1699 m_pBitmap->CopyPalette(pSrcPalette); 1698 m_pBitmap->CopyPalette(pSrcPalette);
1700 } 1699 }
1701 return TRUE; 1700 return TRUE;
1702 } 1701 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698