summaryrefslogtreecommitdiff
path: root/vcl/skia
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/skia')
-rw-r--r--vcl/skia/gdiimpl.cxx21
-rw-r--r--vcl/skia/x11/gdiimpl.cxx6
2 files changed, 21 insertions, 6 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 7141eab1cba5..ba764cbdd0b9 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -19,6 +19,7 @@
#include <skia/gdiimpl.hxx>
+#include <salgdi.hxx>
#include <skia/salbmp.hxx>
#include <SkCanvas.h>
@@ -226,6 +227,26 @@ void SkiaSalGraphicsImpl::copyArea(long nDestX, long nDestY, long nSrcX, long nS
mSurface->getCanvas()->drawImage(image, nDestX, nDestY);
}
+void SkiaSalGraphicsImpl::copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics)
+{
+ SkiaSalGraphicsImpl* src;
+ if (pSrcGraphics)
+ {
+ assert(dynamic_cast<SkiaSalGraphicsImpl*>(pSrcGraphics->GetImpl()));
+ src = static_cast<SkiaSalGraphicsImpl*>(pSrcGraphics->GetImpl());
+ }
+ else
+ src = this;
+ sk_sp<SkImage> image = src->mSurface->makeImageSnapshot(
+ SkIRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcWidth, rPosAry.mnSrcHeight));
+ // TODO makeNonTextureImage() ?
+ mSurface->getCanvas()->drawImageRect(image,
+ SkRect::MakeXYWH(rPosAry.mnDestX, rPosAry.mnDestY,
+ rPosAry.mnDestWidth,
+ rPosAry.mnDestHeight),
+ nullptr);
+}
+
bool SkiaSalGraphicsImpl::blendBitmap(const SalTwoRect&, const SalBitmap& rBitmap)
{
(void)rBitmap;
diff --git a/vcl/skia/x11/gdiimpl.cxx b/vcl/skia/x11/gdiimpl.cxx
index e175f558372f..760ae1abf810 100644
--- a/vcl/skia/x11/gdiimpl.cxx
+++ b/vcl/skia/x11/gdiimpl.cxx
@@ -24,10 +24,4 @@ void X11SkiaSalGraphicsImpl::Init()
SkiaSalGraphicsImpl::Init();
}
-void X11SkiaSalGraphicsImpl::copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics)
-{
- (void)rPosAry;
- (void)pSrcGraphics;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */