summaryrefslogtreecommitdiff
path: root/chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-12 14:07:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 10:29:26 +0000
commitec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch)
tree25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp
parentbb09965444b5bb20b096a291445170876225268d (diff)
downloadqtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp')
-rw-r--r--chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp b/chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp
new file mode 100644
index 00000000000..2d6edd0d60e
--- /dev/null
+++ b/chromium/third_party/pdfium/core/fxge/dib/cfx_filtereddib.cpp
@@ -0,0 +1,42 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "core/fxge/dib/cfx_filtereddib.h"
+
+#include "core/fxge/fx_dib.h"
+
+CFX_FilteredDIB::CFX_FilteredDIB() {}
+
+CFX_FilteredDIB::~CFX_FilteredDIB() {}
+
+void CFX_FilteredDIB::LoadSrc(const CFX_RetainPtr<CFX_DIBSource>& pSrc) {
+ m_pSrc = pSrc;
+ m_Width = pSrc->GetWidth();
+ m_Height = pSrc->GetHeight();
+ FXDIB_Format format = GetDestFormat();
+ m_bpp = static_cast<uint8_t>(format);
+ m_AlphaFlag = static_cast<uint8_t>(format >> 8);
+ m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
+ m_pPalette.reset(GetDestPalette());
+ m_Scanline.resize(m_Pitch);
+}
+
+const uint8_t* CFX_FilteredDIB::GetScanline(int line) const {
+ TranslateScanline(m_pSrc->GetScanline(line), &m_Scanline);
+ return m_Scanline.data();
+}
+
+void CFX_FilteredDIB::DownSampleScanline(int line,
+ uint8_t* dest_scan,
+ int dest_bpp,
+ int dest_width,
+ bool bFlipX,
+ int clip_left,
+ int clip_width) const {
+ m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX,
+ clip_left, clip_width);
+ TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp);
+}