Use std::move() with CFX_SkiaDeviceDriver ctor
Explicitly move `pBitmap` into CFX_SkiaDeviceDriver to make the
move more obvious.
Change-Id: If978ce17d872ef2c6211c0fba7c6187d6ce564f6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/102830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nigi <nigi@chromium.org>
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 526a74d..ed75214 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -1338,7 +1338,7 @@
bool bRgbByteOrder,
RetainPtr<CFX_DIBitmap> pBackdropBitmap,
bool bGroupKnockout)
- : m_pBitmap(pBitmap),
+ : m_pBitmap(std::move(pBitmap)),
m_pBackdropBitmap(pBackdropBitmap),
m_pRecorder(nullptr),
m_pCache(std::make_unique<SkiaState>(this)),
@@ -1346,9 +1346,9 @@
m_bGroupKnockout(bGroupKnockout) {
SkBitmap skBitmap;
SkColorType color_type;
- const int bpp = pBitmap->GetBPP();
+ const int bpp = m_pBitmap->GetBPP();
if (bpp == 8) {
- color_type = pBitmap->IsAlphaFormat() || pBitmap->IsMaskFormat()
+ color_type = m_pBitmap->IsAlphaFormat() || m_pBitmap->IsMaskFormat()
? kAlpha_8_SkColorType
: kGray_8_SkColorType;
} else {
@@ -1357,10 +1357,10 @@
}
SkImageInfo imageInfo =
- SkImageInfo::Make(pBitmap->GetWidth(), pBitmap->GetHeight(), color_type,
- kPremul_SkAlphaType);
- skBitmap.installPixels(imageInfo, pBitmap->GetBuffer().data(),
- pBitmap->GetPitch());
+ SkImageInfo::Make(m_pBitmap->GetWidth(), m_pBitmap->GetHeight(),
+ color_type, kPremul_SkAlphaType);
+ skBitmap.installPixels(imageInfo, m_pBitmap->GetBuffer().data(),
+ m_pBitmap->GetPitch());
m_pCanvas = new SkCanvas(skBitmap);
}