| 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 #include "core/fxge/include/fx_ge.h" | 5 #include "core/fxge/include/fx_ge.h" |
| 6 | 6 |
| 7 #if defined(_SKIA_SUPPORT_) | 7 #if defined(_SKIA_SUPPORT_) |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 } | 931 } |
| 932 | 932 |
| 933 FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, | 933 FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, |
| 934 int left, | 934 int left, |
| 935 int top) { | 935 int top) { |
| 936 if (!m_pBitmap || !m_pBitmap->GetBuffer()) | 936 if (!m_pBitmap || !m_pBitmap->GetBuffer()) |
| 937 return TRUE; | 937 return TRUE; |
| 938 | 938 |
| 939 FX_RECT rect(left, top, left + pBitmap->GetWidth(), | 939 FX_RECT rect(left, top, left + pBitmap->GetWidth(), |
| 940 top + pBitmap->GetHeight()); | 940 top + pBitmap->GetHeight()); |
| 941 CFX_DIBitmap* pBack; | 941 std::unique_ptr<CFX_DIBitmap> pBack; |
| 942 if (m_pOriDevice) { | 942 if (m_pOriDevice) { |
| 943 pBack = m_pOriDevice->Clone(&rect); | 943 pBack.reset(m_pOriDevice->Clone(&rect)); |
| 944 if (!pBack) | 944 if (!pBack) |
| 945 return TRUE; | 945 return TRUE; |
| 946 | 946 |
| 947 pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), | 947 pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), |
| 948 m_pBitmap, 0, 0); | 948 m_pBitmap, 0, 0); |
| 949 } else { | 949 } else { |
| 950 pBack = m_pBitmap->Clone(&rect); | 950 pBack.reset(m_pBitmap->Clone(&rect)); |
| 951 if (!pBack) | 951 if (!pBack) |
| 952 return TRUE; | 952 return TRUE; |
| 953 } | 953 } |
| 954 | 954 |
| 955 FX_BOOL bRet = TRUE; | |
| 956 left = std::min(left, 0); | 955 left = std::min(left, 0); |
| 957 top = std::min(top, 0); | 956 top = std::min(top, 0); |
| 958 if (m_bRgbByteOrder) { | 957 if (m_bRgbByteOrder) { |
| 959 RgbByteOrderTransferBitmap(pBitmap, 0, 0, rect.Width(), rect.Height(), | 958 RgbByteOrderTransferBitmap(pBitmap, 0, 0, rect.Width(), rect.Height(), |
| 960 pBack, left, top); | 959 pBack.get(), left, top); |
| 961 } else { | 960 return TRUE; |
| 962 bRet = pBitmap->TransferBitmap(0, 0, rect.Width(), rect.Height(), pBack, | |
| 963 left, top, nullptr); | |
| 964 } | 961 } |
| 965 delete pBack; | 962 |
| 966 return bRet; | 963 return pBitmap->TransferBitmap(0, 0, rect.Width(), rect.Height(), pBack.get(), |
| 964 left, top); |
| 967 } | 965 } |
| 968 | 966 |
| 969 CFX_DIBitmap* CFX_SkiaDeviceDriver::GetBackDrop() { | 967 CFX_DIBitmap* CFX_SkiaDeviceDriver::GetBackDrop() { |
| 970 return m_pOriDevice; | 968 return m_pOriDevice; |
| 971 } | 969 } |
| 972 | 970 |
| 973 FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, | 971 FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, |
| 974 uint32_t argb, | 972 uint32_t argb, |
| 975 const FX_RECT* pSrcRect, | 973 const FX_RECT* pSrcRect, |
| 976 int left, | 974 int left, |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 | 1256 |
| 1259 FX_BOOL IFX_RenderDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, | 1257 FX_BOOL IFX_RenderDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, |
| 1260 const CFX_Matrix* pMatrix, | 1258 const CFX_Matrix* pMatrix, |
| 1261 const FX_RECT& clip_rect, | 1259 const FX_RECT& clip_rect, |
| 1262 int alpha, | 1260 int alpha, |
| 1263 FX_BOOL bAlphaMode) { | 1261 FX_BOOL bAlphaMode) { |
| 1264 return false; | 1262 return false; |
| 1265 } | 1263 } |
| 1266 | 1264 |
| 1267 #endif | 1265 #endif |
| OLD | NEW |