diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-02-05 11:56:40 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-02-07 09:13:21 +0100 |
commit | 8a2a9d2809ed0664c2e47d634e1c2c6c6493d251 (patch) | |
tree | 261563f3ec7ebd5c87967344bda010d0d8874006 /vcl/skia/win | |
parent | d5fb841d2992fa44992d9a64de3407992661bab3 (diff) |
add Skia crash zone checking
Just like with OpenGL, mark zones where Skia code may call into graphics
drivers in order to be able to detect cases where the driver has
caused a crash or a lockup.
Change-Id: I0fdbcc2260e3ab7821a595e9960145ae1fc1adfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88011
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/skia/win')
-rw-r--r-- | vcl/skia/win/gdiimpl.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index aec2f22e5bb3..0d459be03722 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -12,6 +12,7 @@ #include <win/saldata.hxx> #include <vcl/skia/SkiaHelper.hxx> #include <skia/utils.hxx> +#include <skia/zone.hxx> #include <SkColorFilter.h> #include <SkPixelRef.h> @@ -27,6 +28,7 @@ WinSkiaSalGraphicsImpl::WinSkiaSalGraphicsImpl(WinSalGraphics& rGraphics, void WinSkiaSalGraphicsImpl::createWindowContext() { + SkiaZone zone; // When created, Init() gets called with size (0,0), which is invalid size // for Skia. Creating the actual surface is delayed, so the size should be always // valid here, but better check. @@ -49,6 +51,7 @@ void WinSkiaSalGraphicsImpl::createWindowContext() void WinSkiaSalGraphicsImpl::DeInit() { + SkiaZone zone; SkiaSalGraphicsImpl::DeInit(); mWindowContext.reset(); } @@ -57,6 +60,7 @@ void WinSkiaSalGraphicsImpl::freeResources() {} void WinSkiaSalGraphicsImpl::performFlush() { + SkiaZone zone; mPendingPixelsToFlush = 0; if (mWindowContext) mWindowContext->swapBuffers(); @@ -158,6 +162,7 @@ std::unique_ptr<CompatibleDC::Texture> SkiaCompatibleDC::getAsMaskTexture() cons sk_sp<SkImage> SkiaCompatibleDC::getAsMaskImage() const { + SkiaZone zone; // mpData is in the BGRA format, with A unused (and set to 0), and RGB are grey, // so convert it to Skia format, then to 8bit and finally use as alpha mask SkBitmap tmpBitmap; @@ -200,6 +205,7 @@ sk_sp<SkImage> SkiaCompatibleDC::getAsMaskImage() const sk_sp<SkImage> SkiaCompatibleDC::getAsImage() const { + SkiaZone zone; SkBitmap tmpBitmap; if (!tmpBitmap.installPixels(SkImageInfo::Make(maRects.mnSrcWidth, maRects.mnSrcHeight, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType), @@ -225,6 +231,7 @@ sk_sp<SkImage> SkiaCompatibleDC::getAsImage() const sk_sp<SkImage> SkiaCompatibleDC::getAsImageDiff(const SkiaCompatibleDC& white) const { + SkiaZone zone; assert(maRects.mnSrcWidth == white.maRects.mnSrcWidth || maRects.mnSrcHeight == white.maRects.mnSrcHeight); SkBitmap tmpBitmap; |