| OLD | NEW |
| 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 "core/fxge/agg/fx_agg_driver.h" | 7 #include "core/fxge/agg/fx_agg_driver.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 FX_RECT dest_rect(dest_left, dest_top, dest_left + dest_width, | 1747 FX_RECT dest_rect(dest_left, dest_top, dest_left + dest_width, |
| 1748 dest_top + dest_height); | 1748 dest_top + dest_height); |
| 1749 dest_rect.Normalize(); | 1749 dest_rect.Normalize(); |
| 1750 FX_RECT dest_clip = dest_rect; | 1750 FX_RECT dest_clip = dest_rect; |
| 1751 dest_clip.Intersect(*pClipRect); | 1751 dest_clip.Intersect(*pClipRect); |
| 1752 CFX_BitmapComposer composer; | 1752 CFX_BitmapComposer composer; |
| 1753 composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, FALSE, FALSE, | 1753 composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, FALSE, FALSE, |
| 1754 FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, | 1754 FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, |
| 1755 blend_type); | 1755 blend_type); |
| 1756 dest_clip.Offset(-dest_rect.left, -dest_rect.top); | 1756 dest_clip.Offset(-dest_rect.left, -dest_rect.top); |
| 1757 CFX_ImageStretcher stretcher; | 1757 CFX_ImageStretcher stretcher(&composer, pSource, dest_width, dest_height, |
| 1758 if (stretcher.Start(&composer, pSource, dest_width, dest_height, dest_clip, | 1758 dest_clip, flags); |
| 1759 flags)) { | 1759 if (stretcher.Start()) |
| 1760 stretcher.Continue(NULL); | 1760 stretcher.Continue(nullptr); |
| 1761 } | |
| 1762 return TRUE; | 1761 return TRUE; |
| 1763 } | 1762 } |
| 1764 | 1763 |
| 1765 FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, | 1764 FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, |
| 1766 int bitmap_alpha, | 1765 int bitmap_alpha, |
| 1767 uint32_t argb, | 1766 uint32_t argb, |
| 1768 const CFX_Matrix* pMatrix, | 1767 const CFX_Matrix* pMatrix, |
| 1769 uint32_t render_flags, | 1768 uint32_t render_flags, |
| 1770 void*& handle, | 1769 void*& handle, |
| 1771 int alpha_flag, | 1770 int alpha_flag, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); | 1829 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); |
| 1831 SetDeviceDriver(pDriver); | 1830 SetDeviceDriver(pDriver); |
| 1832 return true; | 1831 return true; |
| 1833 } | 1832 } |
| 1834 | 1833 |
| 1835 CFX_FxgeDevice::~CFX_FxgeDevice() { | 1834 CFX_FxgeDevice::~CFX_FxgeDevice() { |
| 1836 if (m_bOwnedBitmap) { | 1835 if (m_bOwnedBitmap) { |
| 1837 delete GetBitmap(); | 1836 delete GetBitmap(); |
| 1838 } | 1837 } |
| 1839 } | 1838 } |
| OLD | NEW |