summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-07-12 18:54:51 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-12 18:54:51 +0000
commitec4d28f844e72dbe47b9c6d464abc04d947b4bf5 (patch)
treea3ee3823fedf9aa3ee87a4e44f15a250d7380ca4
parent6aa2190f70a80b70af7bcfe198041756ed8c803e (diff)
downloadpdfium-ec4d28f844e72dbe47b9c6d464abc04d947b4bf5.tar.xz
Rename 'ori' to 'backdrop' in rendering code.
Change-Id: I6fa3fd93638bc3aeaaef854676fe31476888433b Reviewed-on: https://pdfium-review.googlesource.com/37671 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp10
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp114
-rw-r--r--core/fxge/agg/fx_agg_driver.h4
-rw-r--r--core/fxge/cfx_defaultrenderdevice.h4
-rw-r--r--core/fxge/skia/fx_skia_device.cpp43
-rw-r--r--core/fxge/skia/fx_skia_device.h4
6 files changed, 93 insertions, 86 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 433d32b886..23eeefd0ed 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1551,15 +1551,15 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
int width = rect.Width();
int height = rect.Height();
CFX_DefaultRenderDevice bitmap_device;
- RetainPtr<CFX_DIBitmap> oriDevice;
+ RetainPtr<CFX_DIBitmap> backdrop;
if (!transparency.IsIsolated() &&
(m_pDevice->GetRenderCaps() & FXRC_GET_BITS)) {
- oriDevice = pdfium::MakeRetain<CFX_DIBitmap>();
- if (!m_pDevice->CreateCompatibleBitmap(oriDevice, width, height))
+ backdrop = pdfium::MakeRetain<CFX_DIBitmap>();
+ if (!m_pDevice->CreateCompatibleBitmap(backdrop, width, height))
return true;
- m_pDevice->GetDIBits(oriDevice, rect.left, rect.top);
+ m_pDevice->GetDIBits(backdrop, rect.left, rect.top);
}
- if (!bitmap_device.Create(width, height, FXDIB_Argb, oriDevice))
+ if (!bitmap_device.Create(width, height, FXDIB_Argb, backdrop))
return true;
RetainPtr<CFX_DIBitmap> bitmap = bitmap_device.GetBitmap();
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index a19868f764..affabba797 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -326,7 +326,7 @@ class CFX_Renderer {
void prepare(unsigned) {}
void CompositeSpan(uint8_t* dest_scan,
- uint8_t* ori_scan,
+ uint8_t* backdrop_scan,
int Bpp,
bool bDestAlpha,
int span_left,
@@ -387,7 +387,7 @@ class CFX_Renderer {
uint8_t* dest_extra_alpha_scan);
bool Init(const RetainPtr<CFX_DIBitmap>& pDevice,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropDevice,
const CFX_ClipRgn* pClipRgn,
uint32_t color,
bool bFullCover,
@@ -443,14 +443,14 @@ class CFX_Renderer {
bool m_bFullCover;
bool m_bRgbByteOrder;
FX_RECT m_ClipBox;
- RetainPtr<CFX_DIBitmap> m_pOriDevice;
+ RetainPtr<CFX_DIBitmap> m_pBackdropDevice;
RetainPtr<CFX_DIBitmap> m_pClipMask;
RetainPtr<CFX_DIBitmap> m_pDevice;
UnownedPtr<const CFX_ClipRgn> m_pClipRgn;
};
void CFX_Renderer::CompositeSpan(uint8_t* dest_scan,
- uint8_t* ori_scan,
+ uint8_t* backdrop_scan,
int Bpp,
bool bDestAlpha,
int span_left,
@@ -464,30 +464,33 @@ void CFX_Renderer::CompositeSpan(uint8_t* dest_scan,
int col_end = GetColEnd(span_left, span_len, clip_right);
if (Bpp) {
dest_scan += col_start * Bpp;
- ori_scan += col_start * Bpp;
+ backdrop_scan += col_start * Bpp;
} else {
dest_scan += col_start / 8;
- ori_scan += col_start / 8;
+ backdrop_scan += col_start / 8;
}
if (m_bRgbByteOrder) {
if (Bpp == 4 && bDestAlpha) {
for (int col = col_start; col < col_end; col++) {
int src_alpha = GetSrcAlpha(clip_scan, col);
uint8_t dest_alpha =
- ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255;
+ backdrop_scan[3] + src_alpha - backdrop_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (m_bFullCover) {
- *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, alpha_ratio);
- *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, alpha_ratio);
- *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, alpha_ratio);
+ *dest_scan++ =
+ FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Red, alpha_ratio);
+ *dest_scan++ =
+ FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Green, alpha_ratio);
+ *dest_scan++ =
+ FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Blue, alpha_ratio);
dest_scan++;
- ori_scan++;
+ backdrop_scan++;
} else {
- int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, alpha_ratio);
- int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, alpha_ratio);
- int b = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, alpha_ratio);
- ori_scan++;
+ int r = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Red, alpha_ratio);
+ int g = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Green, alpha_ratio);
+ int b = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Blue, alpha_ratio);
+ backdrop_scan++;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan[col]);
dest_scan++;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan[col]);
@@ -501,10 +504,10 @@ void CFX_Renderer::CompositeSpan(uint8_t* dest_scan,
if (Bpp == 3 || Bpp == 4) {
for (int col = col_start; col < col_end; col++) {
int src_alpha = GetSrcAlpha(clip_scan, col);
- int r = FXDIB_ALPHA_MERGE(*ori_scan++, m_Red, src_alpha);
- int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha);
- int b = FXDIB_ALPHA_MERGE(*ori_scan, m_Blue, src_alpha);
- ori_scan += Bpp - 2;
+ int r = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Red, src_alpha);
+ int g = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Green, src_alpha);
+ int b = FXDIB_ALPHA_MERGE(*backdrop_scan, m_Blue, src_alpha);
+ backdrop_scan += Bpp - 2;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, r, cover_scan[col]);
dest_scan++;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan[col]);
@@ -554,17 +557,17 @@ void CFX_Renderer::CompositeSpan(uint8_t* dest_scan,
for (int col = col_start; col < col_end; col++) {
int src_alpha = GetSrcAlpha(clip_scan, col);
if (m_bFullCover) {
- *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_alpha);
- *dest_scan++ = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha);
- *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha);
+ *dest_scan++ = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Blue, src_alpha);
+ *dest_scan++ = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Green, src_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*backdrop_scan, m_Red, src_alpha);
dest_scan += Bpp - 2;
- ori_scan += Bpp - 2;
+ backdrop_scan += Bpp - 2;
continue;
}
- int b = FXDIB_ALPHA_MERGE(*ori_scan++, m_Blue, src_alpha);
- int g = FXDIB_ALPHA_MERGE(*ori_scan++, m_Green, src_alpha);
- int r = FXDIB_ALPHA_MERGE(*ori_scan, m_Red, src_alpha);
- ori_scan += Bpp - 2;
+ int b = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Blue, src_alpha);
+ int g = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Green, src_alpha);
+ int r = FXDIB_ALPHA_MERGE(*backdrop_scan, m_Red, src_alpha);
+ backdrop_scan += Bpp - 2;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, b, cover_scan[col]);
dest_scan++;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, g, cover_scan[col]);
@@ -579,10 +582,10 @@ void CFX_Renderer::CompositeSpan(uint8_t* dest_scan,
for (int col = col_start; col < col_end; col++) {
int src_alpha = GetSrcAlpha(clip_scan, col);
if (m_bFullCover) {
- *dest_scan = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray, src_alpha);
+ *dest_scan = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Gray, src_alpha);
continue;
}
- int gray = FXDIB_ALPHA_MERGE(*ori_scan++, m_Gray, src_alpha);
+ int gray = FXDIB_ALPHA_MERGE(*backdrop_scan++, m_Gray, src_alpha);
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, cover_scan[col]);
dest_scan++;
}
@@ -886,7 +889,7 @@ void CFX_Renderer::CompositeSpanCMYK(uint8_t* dest_scan,
}
bool CFX_Renderer::Init(const RetainPtr<CFX_DIBitmap>& pDevice,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropDevice,
const CFX_ClipRgn* pClipRgn,
uint32_t color,
bool bFullCover,
@@ -895,7 +898,7 @@ bool CFX_Renderer::Init(const RetainPtr<CFX_DIBitmap>& pDevice,
m_pClipRgn = pClipRgn;
composite_span = nullptr;
m_bRgbByteOrder = bRgbByteOrder;
- m_pOriDevice = pOriDevice;
+ m_pBackdropDevice = pBackdropDevice;
if (m_pClipRgn) {
m_ClipBox = m_pClipRgn->GetBox();
} else {
@@ -938,7 +941,7 @@ bool CFX_Renderer::Init(const RetainPtr<CFX_DIBitmap>& pDevice,
template <class Scanline>
void CFX_Renderer::render(const Scanline& sl) {
- if (!m_pOriDevice && !composite_span)
+ if (!m_pBackdropDevice && !composite_span)
return;
int y = sl.y();
@@ -952,9 +955,11 @@ void CFX_Renderer::render(const Scanline& sl) {
dest_scan_extra_alpha =
pAlphaMask->GetBuffer() + pAlphaMask->GetPitch() * y;
}
- uint8_t* ori_scan = nullptr;
- if (m_pOriDevice)
- ori_scan = m_pOriDevice->GetBuffer() + m_pOriDevice->GetPitch() * y;
+ uint8_t* backdrop_scan = nullptr;
+ if (m_pBackdropDevice) {
+ backdrop_scan =
+ m_pBackdropDevice->GetBuffer() + m_pBackdropDevice->GetPitch() * y;
+ }
int Bpp = m_pDevice->GetBPP() / 8;
bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
unsigned num_spans = sl.num_spans();
@@ -966,15 +971,15 @@ void CFX_Renderer::render(const Scanline& sl) {
int x = span->x;
uint8_t* dest_pos = nullptr;
uint8_t* dest_extra_alpha_pos = nullptr;
- uint8_t* ori_pos = nullptr;
+ uint8_t* backdrop_pos = nullptr;
if (Bpp) {
- ori_pos = ori_scan ? ori_scan + x * Bpp : nullptr;
+ backdrop_pos = backdrop_scan ? backdrop_scan + x * Bpp : nullptr;
dest_pos = dest_scan + x * Bpp;
dest_extra_alpha_pos =
dest_scan_extra_alpha ? dest_scan_extra_alpha + x : nullptr;
} else {
dest_pos = dest_scan + x / 8;
- ori_pos = ori_scan ? ori_scan + x / 8 : nullptr;
+ backdrop_pos = backdrop_scan ? backdrop_scan + x / 8 : nullptr;
}
uint8_t* clip_pos = nullptr;
if (m_pClipMask) {
@@ -982,8 +987,8 @@ void CFX_Renderer::render(const Scanline& sl) {
(y - m_ClipBox.top) * m_pClipMask->GetPitch() + x -
m_ClipBox.left;
}
- if (ori_pos) {
- CompositeSpan(dest_pos, ori_pos, Bpp, bDestAlpha, x, span->len,
+ if (backdrop_pos) {
+ CompositeSpan(dest_pos, backdrop_pos, Bpp, bDestAlpha, x, span->len,
span->covers, m_ClipBox.left, m_ClipBox.right, clip_pos);
} else {
(this->*composite_span)(dest_pos, Bpp, x, span->len, span->covers,
@@ -1115,7 +1120,7 @@ void CAgg_PathData::BuildPath(const CFX_PathData* pPathData,
CFX_AggDeviceDriver::CFX_AggDeviceDriver(
const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
bool bGroupKnockout)
: m_pBitmap(pBitmap),
#if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_
@@ -1123,7 +1128,7 @@ CFX_AggDeviceDriver::CFX_AggDeviceDriver(
#endif
m_FillFlags(0),
m_bRgbByteOrder(bRgbByteOrder),
- m_pOriDevice(pOriDevice),
+ m_pBackdropBitmap(pBackdropBitmap),
m_bGroupKnockout(bGroupKnockout) {
InitPlatform();
}
@@ -1292,7 +1297,7 @@ bool CFX_AggDeviceDriver::RenderRasterizer(
uint32_t color,
bool bFullCover,
bool bGroupKnockout) {
- RetainPtr<CFX_DIBitmap> pt = bGroupKnockout ? m_pOriDevice : nullptr;
+ RetainPtr<CFX_DIBitmap> pt = bGroupKnockout ? m_pBackdropBitmap : nullptr;
CFX_Renderer render;
if (!render.Init(m_pBitmap, pt, m_pClipRgn.get(), color, bFullCover,
m_bRgbByteOrder)) {
@@ -1462,8 +1467,8 @@ bool CFX_AggDeviceDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap,
FX_RECT rect(left, top, left + pBitmap->GetWidth(),
top + pBitmap->GetHeight());
RetainPtr<CFX_DIBitmap> pBack;
- if (m_pOriDevice) {
- pBack = m_pOriDevice->Clone(&rect);
+ if (m_pBackdropBitmap) {
+ pBack = m_pBackdropBitmap->Clone(&rect);
if (!pBack)
return true;
@@ -1487,7 +1492,7 @@ bool CFX_AggDeviceDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap,
}
RetainPtr<CFX_DIBitmap> CFX_AggDeviceDriver::GetBackDrop() {
- return m_pOriDevice;
+ return m_pBackdropBitmap;
}
bool CFX_AggDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap,
@@ -1570,16 +1575,17 @@ CFX_DefaultRenderDevice::CFX_DefaultRenderDevice() {}
CFX_DefaultRenderDevice::~CFX_DefaultRenderDevice() {}
-bool CFX_DefaultRenderDevice::Attach(const RetainPtr<CFX_DIBitmap>& pBitmap,
- bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
- bool bGroupKnockout) {
+bool CFX_DefaultRenderDevice::Attach(
+ const RetainPtr<CFX_DIBitmap>& pBitmap,
+ bool bRgbByteOrder,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
+ bool bGroupKnockout) {
if (!pBitmap)
return false;
SetBitmap(pBitmap);
SetDeviceDriver(pdfium::MakeUnique<CFX_AggDeviceDriver>(
- pBitmap, bRgbByteOrder, pOriDevice, bGroupKnockout));
+ pBitmap, bRgbByteOrder, pBackdropBitmap, bGroupKnockout));
return true;
}
@@ -1587,14 +1593,14 @@ bool CFX_DefaultRenderDevice::Create(
int width,
int height,
FXDIB_Format format,
- const RetainPtr<CFX_DIBitmap>& pOriDevice) {
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap) {
auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
if (!pBitmap->Create(width, height, format))
return false;
SetBitmap(pBitmap);
- SetDeviceDriver(pdfium::MakeUnique<CFX_AggDeviceDriver>(pBitmap, false,
- pOriDevice, false));
+ SetDeviceDriver(pdfium::MakeUnique<CFX_AggDeviceDriver>(
+ pBitmap, false, pBackdropBitmap, false));
return true;
}
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 4e94a00b63..b59cec004c 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -34,7 +34,7 @@ class CFX_AggDeviceDriver : public RenderDeviceDriverIface {
public:
CFX_AggDeviceDriver(const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
bool bGroupKnockout);
~CFX_AggDeviceDriver() override;
@@ -117,7 +117,7 @@ class CFX_AggDeviceDriver : public RenderDeviceDriverIface {
#endif
int m_FillFlags;
const bool m_bRgbByteOrder;
- RetainPtr<CFX_DIBitmap> m_pOriDevice;
+ RetainPtr<CFX_DIBitmap> m_pBackdropBitmap;
const bool m_bGroupKnockout;
};
diff --git a/core/fxge/cfx_defaultrenderdevice.h b/core/fxge/cfx_defaultrenderdevice.h
index 59415df641..6510e41f6f 100644
--- a/core/fxge/cfx_defaultrenderdevice.h
+++ b/core/fxge/cfx_defaultrenderdevice.h
@@ -19,12 +19,12 @@ class CFX_DefaultRenderDevice : public CFX_RenderDevice {
bool Attach(const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
bool bGroupKnockout);
bool Create(int width,
int height,
FXDIB_Format format,
- const RetainPtr<CFX_DIBitmap>& pOriDevice);
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap);
#ifdef _SKIA_SUPPORT_
bool AttachRecorder(SkPictureRecorder* recorder);
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 87cb178a52..e932781c9b 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -1496,10 +1496,10 @@ void CFX_SkiaDeviceDriver::PaintStroke(SkPaint* spaint,
CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(
const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
bool bGroupKnockout)
: m_pBitmap(pBitmap),
- m_pOriDevice(pOriDevice),
+ m_pBackdropBitmap(pBackdropBitmap),
m_pRecorder(nullptr),
m_pCache(new SkiaState(this)),
#ifdef _SKIA_SUPPORT_PATHS_
@@ -1521,7 +1521,7 @@ CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(
#ifdef _SKIA_SUPPORT_
CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(int size_x, int size_y)
: m_pBitmap(nullptr),
- m_pOriDevice(nullptr),
+ m_pBackdropBitmap(nullptr),
m_pRecorder(new SkPictureRecorder),
m_pCache(new SkiaState(this)),
m_bGroupKnockout(false) {
@@ -1531,7 +1531,7 @@ CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(int size_x, int size_y)
CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(SkPictureRecorder* recorder)
: m_pBitmap(nullptr),
- m_pOriDevice(nullptr),
+ m_pBackdropBitmap(nullptr),
m_pRecorder(recorder),
m_pCache(new SkiaState(this)),
m_bGroupKnockout(false) {
@@ -2222,8 +2222,8 @@ bool CFX_SkiaDeviceDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap,
FX_RECT rect(left, top, left + pBitmap->GetWidth(),
top + pBitmap->GetHeight());
RetainPtr<CFX_DIBitmap> pBack;
- if (m_pOriDevice) {
- pBack = m_pOriDevice->Clone(&rect);
+ if (m_pBackdropBitmap) {
+ pBack = m_pBackdropBitmap->Clone(&rect);
if (!pBack)
return true;
@@ -2250,7 +2250,7 @@ bool CFX_SkiaDeviceDriver::GetDIBits(const RetainPtr<CFX_DIBitmap>& pBitmap,
}
RetainPtr<CFX_DIBitmap> CFX_SkiaDeviceDriver::GetBackDrop() {
- return m_pOriDevice;
+ return m_pBackdropBitmap;
}
bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBSource>& pBitmap,
@@ -2345,7 +2345,7 @@ bool CFX_SkiaDeviceDriver::StartDIBits(
int blend_type) {
#ifdef _SKIA_SUPPORT_
m_pCache->FlushForDraw();
- DebugValidate(m_pBitmap, m_pOriDevice);
+ DebugValidate(m_pBitmap, m_pBackdropBitmap);
std::unique_ptr<uint8_t, FxFreeDeleter> dst8Storage;
std::unique_ptr<uint32_t, FxFreeDeleter> dst32Storage;
SkBitmap skBitmap;
@@ -2379,7 +2379,7 @@ bool CFX_SkiaDeviceDriver::StartDIBits(
m_pCanvas->drawBitmap(skBitmap, 0, 0, &paint);
}
m_pCanvas->restore();
- DebugValidate(m_pBitmap, m_pOriDevice);
+ DebugValidate(m_pBitmap, m_pBackdropBitmap);
#endif // _SKIA_SUPPORT_
#ifdef _SKIA_SUPPORT_PATHS_
@@ -2474,7 +2474,7 @@ bool CFX_SkiaDeviceDriver::DrawBitsWithMask(
int bitmap_alpha,
const CFX_Matrix* pMatrix,
int blend_type) {
- DebugValidate(m_pBitmap, m_pOriDevice);
+ DebugValidate(m_pBitmap, m_pBackdropBitmap);
std::unique_ptr<uint8_t, FxFreeDeleter> src8Storage, mask8Storage;
std::unique_ptr<uint32_t, FxFreeDeleter> src32Storage, mask32Storage;
SkBitmap skBitmap, skMask;
@@ -2505,7 +2505,7 @@ bool CFX_SkiaDeviceDriver::DrawBitsWithMask(
SkRect r = {0, 0, SkIntToScalar(srcWidth), SkIntToScalar(srcHeight)};
m_pCanvas->drawRect(r, paint);
m_pCanvas->restore();
- DebugValidate(m_pBitmap, m_pOriDevice);
+ DebugValidate(m_pBitmap, m_pBackdropBitmap);
return true;
}
@@ -2537,8 +2537,8 @@ void CFX_SkiaDeviceDriver::Dump() const {
#ifdef _SKIA_SUPPORT_
void CFX_SkiaDeviceDriver::DebugVerifyBitmapIsPreMultiplied() const {
- if (m_pOriDevice)
- m_pOriDevice->DebugVerifyBitmapIsPreMultiplied(nullptr);
+ if (m_pBackdropBitmap)
+ m_pBackdropBitmap->DebugVerifyBitmapIsPreMultiplied(nullptr);
}
#endif // _SKIA_SUPPORT_
@@ -2559,15 +2559,16 @@ SkPictureRecorder* CFX_DefaultRenderDevice::CreateRecorder(int size_x,
}
#endif // _SKIA_SUPPORT_
-bool CFX_DefaultRenderDevice::Attach(const RetainPtr<CFX_DIBitmap>& pBitmap,
- bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
- bool bGroupKnockout) {
+bool CFX_DefaultRenderDevice::Attach(
+ const RetainPtr<CFX_DIBitmap>& pBitmap,
+ bool bRgbByteOrder,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
+ bool bGroupKnockout) {
if (!pBitmap)
return false;
SetBitmap(pBitmap);
SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(
- pBitmap, bRgbByteOrder, pOriDevice, bGroupKnockout));
+ pBitmap, bRgbByteOrder, pBackdropBitmap, bGroupKnockout));
return true;
}
@@ -2584,14 +2585,14 @@ bool CFX_DefaultRenderDevice::Create(
int width,
int height,
FXDIB_Format format,
- const RetainPtr<CFX_DIBitmap>& pOriDevice) {
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap) {
auto pBitmap = pdfium::MakeRetain<CFX_DIBitmap>();
if (!pBitmap->Create(width, height, format)) {
return false;
}
SetBitmap(pBitmap);
- SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(pBitmap, false,
- pOriDevice, false));
+ SetDeviceDriver(pdfium::MakeUnique<CFX_SkiaDeviceDriver>(
+ pBitmap, false, pBackdropBitmap, false));
return true;
}
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 8fdd4fd03f..692199f6bb 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -26,7 +26,7 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface {
public:
CFX_SkiaDeviceDriver(const RetainPtr<CFX_DIBitmap>& pBitmap,
bool bRgbByteOrder,
- const RetainPtr<CFX_DIBitmap>& pOriDevice,
+ const RetainPtr<CFX_DIBitmap>& pBackdropBitmap,
bool bGroupKnockout);
#ifdef _SKIA_SUPPORT_
explicit CFX_SkiaDeviceDriver(SkPictureRecorder* recorder);
@@ -160,7 +160,7 @@ class CFX_SkiaDeviceDriver : public RenderDeviceDriverIface {
private:
RetainPtr<CFX_DIBitmap> m_pBitmap;
- RetainPtr<CFX_DIBitmap> m_pOriDevice;
+ RetainPtr<CFX_DIBitmap> m_pBackdropBitmap;
SkCanvas* m_pCanvas;
SkPictureRecorder* const m_pRecorder;
std::unique_ptr<SkiaState> m_pCache;