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

Side by Side Diff: core/fxge/skia/fx_skia_device.cpp

Issue 2530343004: enable skia gradients, fix bugs (Closed)
Patch Set: rebase Created 4 years 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/fxge/ge/cfx_renderdevice.cpp ('k') | fpdfsdk/fpdfview.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 #include <algorithm> 5 #include <algorithm>
6 #include <utility> 6 #include <utility>
7 #include <vector> 7 #include <vector>
8 8
9 #include "core/fpdfapi/page/cpdf_meshstream.h" 9 #include "core/fpdfapi/page/cpdf_meshstream.h"
10 #include "core/fpdfapi/page/cpdf_shadingpattern.h" 10 #include "core/fpdfapi/page/cpdf_shadingpattern.h"
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 nullptr, nullptr); 1745 nullptr, nullptr);
1746 SkCanvas canvas(skDstBitmap); 1746 SkCanvas canvas(skDstBitmap);
1747 canvas.drawBitmap(skSrcBitmap, left, top, nullptr); 1747 canvas.drawBitmap(skSrcBitmap, left, top, nullptr);
1748 return true; 1748 return true;
1749 #endif // _SKIA_SUPPORT_ 1749 #endif // _SKIA_SUPPORT_
1750 1750
1751 #ifdef _SKIA_SUPPORT_PATHS_ 1751 #ifdef _SKIA_SUPPORT_PATHS_
1752 m_pBitmap->UnPreMultiply(); 1752 m_pBitmap->UnPreMultiply();
1753 FX_RECT rect(left, top, left + pBitmap->GetWidth(), 1753 FX_RECT rect(left, top, left + pBitmap->GetWidth(),
1754 top + pBitmap->GetHeight()); 1754 top + pBitmap->GetHeight());
1755 CFX_DIBitmap* pBack = nullptr; 1755 std::unique_ptr<CFX_DIBitmap> pBack = nullptr;
1756 if (m_pOriDevice) { 1756 if (m_pOriDevice) {
1757 pBack = m_pOriDevice->Clone(&rect); 1757 pBack = m_pOriDevice->Clone(&rect);
1758 if (!pBack) 1758 if (!pBack)
1759 return true; 1759 return true;
1760 1760
1761 pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), 1761 pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(),
1762 m_pBitmap, 0, 0); 1762 m_pBitmap, 0, 0);
1763 } else { 1763 } else {
1764 pBack = m_pBitmap->Clone(&rect); 1764 pBack = m_pBitmap->Clone(&rect);
1765 if (!pBack) 1765 if (!pBack)
1766 return true; 1766 return true;
1767 } 1767 }
1768 1768
1769 bool bRet = true; 1769 bool bRet = true;
1770 left = std::min(left, 0); 1770 left = std::min(left, 0);
1771 top = std::min(top, 0); 1771 top = std::min(top, 0);
1772 if (m_bRgbByteOrder) { 1772 if (m_bRgbByteOrder) {
1773 RgbByteOrderTransferBitmap(pBitmap, 0, 0, rect.Width(), rect.Height(), 1773 RgbByteOrderTransferBitmap(pBitmap, 0, 0, rect.Width(), rect.Height(),
1774 pBack, left, top); 1774 pBack.get(), left, top);
1775 } else { 1775 } else {
1776 bRet = pBitmap->TransferBitmap(0, 0, rect.Width(), rect.Height(), pBack, 1776 bRet = pBitmap->TransferBitmap(0, 0, rect.Width(), rect.Height(),
1777 left, top); 1777 pBack.get(), left, top);
1778 } 1778 }
1779 delete pBack;
1780 return bRet; 1779 return bRet;
1781 #endif // _SKIA_SUPPORT_PATHS_ 1780 #endif // _SKIA_SUPPORT_PATHS_
1782 } 1781 }
1783 1782
1784 CFX_DIBitmap* CFX_SkiaDeviceDriver::GetBackDrop() { 1783 CFX_DIBitmap* CFX_SkiaDeviceDriver::GetBackDrop() {
1785 return m_pOriDevice; 1784 return m_pOriDevice;
1786 } 1785 }
1787 1786
1788 bool CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, 1787 bool CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
1789 uint32_t argb, 1788 uint32_t argb,
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 } 3005 }
3007 } 3006 }
3008 if (m_pDevice->GetBPP() == 1) { 3007 if (m_pDevice->GetBPP() == 1) {
3009 composite_span = &CFX_Renderer::CompositeSpan1bpp; 3008 composite_span = &CFX_Renderer::CompositeSpan1bpp;
3010 } 3009 }
3011 return true; 3010 return true;
3012 } 3011 }
3013 }; 3012 };
3014 3013
3015 #endif // _SKIA_SUPPORT_PATHS_ 3014 #endif // _SKIA_SUPPORT_PATHS_
OLDNEW
« no previous file with comments | « core/fxge/ge/cfx_renderdevice.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698