27 if (m_pDevice->StartDIBits(m_pDIBBase, 1.0f, 0,
28 m_ImageMatrix, options, &m_DeviceHandle)) {
30 m_State = State::kStarted;
39 if ((fabs(m_ImageMatrix
.b) >= 0.5f || m_ImageMatrix
.a == 0) ||
40 (fabs(m_ImageMatrix
.c) >= 0.5f || m_ImageMatrix
.d == 0)) {
42 if (m_pDIBBase->IsAlphaFormat() &&
45 m_pCloneConvert = m_pDIBBase->ConvertTo(FXDIB_Format::kRgb);
49 pDib = m_pCloneConvert;
51 FX_RECT clip_box = m_pDevice->GetClipBox();
53 m_State = State::kTransforming;
54 m_pTransformer = std::make_unique<CFX_ImageTransformer>(pDib, m_ImageMatrix,
58 if (m_ImageMatrix
.a < 0)
59 dest_width = -dest_width;
60 if (m_ImageMatrix
.d > 0)
61 dest_height = -dest_height;
62 int dest_left = dest_width > 0 ? image_rect
.left : image_rect
.right;
63 int dest_top = dest_height > 0 ? image_rect
.top : image_rect
.bottom;
64 if (m_pDIBBase->IsOpaqueImage()) {
65 if (m_pDevice->StretchDIBitsWithFlagsAndBlend(
66 m_pDIBBase, dest_left, dest_top, dest_width, dest_height, options,
67 BlendMode::kNormal)) {
71 if (m_pDIBBase->IsMaskFormat()) {
72 if (m_pDevice->StretchBitMaskWithFlags(m_pDIBBase, dest_left, dest_top,
73 dest_width, dest_height, 0,
79 FX_RECT clip_box = m_pDevice->GetClipBox();
86 m_pDIBBase->StretchTo(dest_width, dest_height, options, &dest_clip);
88 CompositeDIBitmap(pStretched, dest_rect
.left, dest_rect
.top);
94 if (m_State == State::kTransforming) {
95 if (m_pTransformer->Continue(
nullptr))
98 RetainPtr<CFX_DIBitmap> pBitmap = m_pTransformer->DetachBitmap();
102 if (pBitmap->IsMaskFormat()) {
103 m_pDevice->SetBitMask(pBitmap, m_pTransformer->result().left,
104 m_pTransformer->result().top, 0);
106 m_pDevice->SetDIBitsWithBlend(pBitmap, m_pTransformer->result().left,
107 m_pTransformer->result().top,
112 if (m_State == State::kStarted)
113 return m_pDevice->ContinueDIBits(m_DeviceHandle.get(),
nullptr);
128 }
else if (m_pDevice->SetBitMask(pDIBitmap, left, top, 0)) {
139 m_pDevice->SetDIBitsWithBlend(pDIBitmap, left, top, BlendMode::kNormal);