diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-11-05 14:04:39 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:15 +0100 |
commit | 4faf0c5a4a782478567d16f4941d5610c2f78ddb (patch) | |
tree | 1d11cb26e97da8fdb9e15560f1f9de173ef8b1a9 /vcl/inc | |
parent | 26de28fb919169b652fb33f63a2b593dd955a34f (diff) |
add SAL log group vcl.skia for tracing Skia usage
Change-Id: Ife21bbe0b86c3edd20e657da09c6e218fa4fced3
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 10 | ||||
-rw-r--r-- | vcl/inc/skia/salbmp.hxx | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index 0c70ce0705ee..f45b29abb07e 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -215,6 +215,8 @@ protected: void setProvider(SalGeometryProvider* provider) { mProvider = provider; } bool isOffscreen() const { return mProvider == nullptr || mProvider->IsOffScreen(); } + // TODO mainly for debugging purposes + bool isGPU() const; void invert(basegfx::B2DPolygon const& rPoly, SalInvert eFlags); @@ -241,6 +243,14 @@ protected: void prefillSurface(); #endif + template <typename charT, typename traits> + friend inline std::basic_ostream<charT, traits>& + operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalGraphicsImpl* graphics) + { // O - offscreen, G - GPU-based, R - raster + return stream << (void*)graphics << " " << Size(graphics->GetWidth(), graphics->GetHeight()) + << (graphics->isOffscreen() ? "O" : "") << (graphics->isGPU() ? "G" : "R"); + } + SalGraphics& mParent; /// Pointer to the SalFrame or SalVirtualDevice SalGeometryProvider* mProvider; diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx index b7d0bd25a1b6..c5922685c5b7 100644 --- a/vcl/inc/skia/salbmp.hxx +++ b/vcl/inc/skia/salbmp.hxx @@ -78,6 +78,17 @@ private: void verify() const {}; #endif + template <typename charT, typename traits> + friend inline std::basic_ostream<charT, traits>& + operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalBitmap* bitmap) + { // TODO GPU-based, once it's done + // B - has SkBitmap, A - has alpha SkBitmap, D - has data buffer + return stream << (void*)bitmap << " " << bitmap->GetSize() << "/" << bitmap->mBitCount + << (!bitmap->mBitmap.drawsNothing() ? "B" : "") + << (!bitmap->mAlphaBitmap.drawsNothing() ? "A" : "") + << (bitmap->mBuffer.get() ? "D" : ""); + } + // TODO use something GPU-backed, or at least cache it for when drawing it to something GPU-backed? SkBitmap mBitmap; SkBitmap mAlphaBitmap; // TODO for use as an alpha channel or mask |