Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_imagerenderer.cpp
Go to the documentation of this file.
1// Copyright 2018 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fxfa/cxfa_imagerenderer.h"
8
9#include <utility>
10
11#include "core/fxcrt/check.h"
12#include "core/fxcrt/check_op.h"
13#include "core/fxge/agg/cfx_agg_imagerenderer.h"
14#include "core/fxge/cfx_renderdevice.h"
15#include "core/fxge/dib/cfx_dibitmap.h"
16
18 RetainPtr<CFX_DIBitmap> bitmap,
19 const CFX_Matrix& image_to_device)
20 : m_ImageMatrix(image_to_device),
23 // Assume this always draws into CFX_DefaultRenderDevice.
24 CHECK(m_pDevice);
25 CHECK(m_pDevice->GetRenderCaps() & FXRC_GET_BITS);
26 CHECK(m_pBitmap);
27}
28
30
33 options.bInterpolateBilinear = true;
34 RenderDeviceDriverIface::StartResult result = m_pDevice->StartDIBits(
35 m_pBitmap, /*alpha=*/1.0f, /*argb=*/0, m_ImageMatrix, options);
37 return false;
38 }
39
41 m_DeviceHandle = std::move(result.agg_image_renderer);
42 if (!m_DeviceHandle) {
43 return false;
44 }
45
46 m_State = State::kStarted;
47 return true;
48}
49
51 CHECK_EQ(m_State, State::kStarted);
52 return m_pDevice->ContinueDIBits(m_DeviceHandle.get(), nullptr);
53}
#define CHECK_EQ(x, y)
Definition check_op.h:10
CFX_Matrix(const CFX_Matrix &other)=default
CXFA_ImageRenderer(CFX_RenderDevice *device, RetainPtr< CFX_DIBitmap > bitmap, const CFX_Matrix &image_to_device)
#define CHECK(cvref)
#define FXRC_GET_BITS