diff options
Diffstat (limited to 'vcl/inc/skia')
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/skia/packedsurfaceatlas.hxx | 83 | ||||
-rw-r--r-- | vcl/inc/skia/win/gdiimpl.hxx | 21 | ||||
-rw-r--r-- | vcl/inc/skia/win/winlayout.hxx | 52 | ||||
-rw-r--r-- | vcl/inc/skia/x11/cairotextrender.hxx | 27 |
5 files changed, 0 insertions, 186 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index 904053200d0a..68652cacc790 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -202,8 +202,6 @@ public: // Default blend mode for SkPaint is SkBlendMode::kSrcOver void drawImage(const SalTwoRect& rPosAry, const sk_sp<SkImage>& aImage, SkBlendMode eBlendMode = SkBlendMode::kSrcOver); - void drawBitmap(const SalTwoRect& rPosAry, const SkBitmap& aBitmap, - SkBlendMode eBlendMode = SkBlendMode::kSrcOver); enum class GlyphOrientation { @@ -300,7 +298,6 @@ protected: std::unique_ptr<SkCanvas> mXorCanvas; SkRegion mXorRegion; // the area that needs updating for the xor operation std::unique_ptr<SkiaFlushIdle> mFlush; - int mPendingPixelsToFlush; }; #endif diff --git a/vcl/inc/skia/packedsurfaceatlas.hxx b/vcl/inc/skia/packedsurfaceatlas.hxx deleted file mode 100644 index a66a24e53876..000000000000 --- a/vcl/inc/skia/packedsurfaceatlas.hxx +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - */ - -#ifndef INCLUDED_VCL_INC_SKIA_PACKEDSURFACEATLAS_HXX -#define INCLUDED_VCL_INC_SKIA_PACKEDSURFACEATLAS_HXX - -#include <memory> - -#include <SkSurface.h> - -#include <vcl/dllapi.h> -#include <tools/gen.hxx> - -/** - * SkSurface that is actually packed in a larger SkSurface atlas. - * - * In Skia's case we draw into SkSurface (as that's what's GPU-backed), - * but then for using the result we need to get an associated SkImage. - * The use of SkSurface::makeImageSnapshot() complicates things in two ways: - * - it does data copy if we want a sub-rectangle, so we need to pass a reference - * and the geometry wanted - * - it does a snapshot of the state, meaning any further drawing into the SkSurface - * would detach by creating a copy, so we need to pass around the SkSurface - * reference and then create only a temporary SkImage for the whole SkSurface - * (which should be almost a no-op) - */ -class VCL_DLLPUBLIC SkiaPackedSurface -{ -public: - sk_sp<SkSurface> mSurface; - tools::Rectangle mRect; // the area in the surface that is this "surface" - SkiaPackedSurface(const sk_sp<SkSurface>& surface, const tools::Rectangle& rect) - : mSurface(surface) - , mRect(rect) - { - } - SkiaPackedSurface() = default; -}; - -/** - * Pack Skia "surfaces" into one surface atlas. - * - * This is based on algorithm described in [1] and is an - * adaptation of "texture atlas generator" from [2]. - * - * [1]: http://www.blackpawn.com/texts/lightmaps/ - * [2]: https://github.com/lukaszdk/texture-atlas-generator - * - */ -class VCL_DLLPUBLIC SkiaPackedSurfaceAtlasManager final -{ - struct PackedSurface; - std::vector<std::unique_ptr<PackedSurface>> maPackedSurfaces; - - int const mnSurfaceWidth; - int const mnSurfaceHeight; - - void CreateNewSurface(); - - SkiaPackedSurfaceAtlasManager(const SkiaPackedSurfaceAtlasManager&) = delete; - SkiaPackedSurfaceAtlasManager& operator=(const SkiaPackedSurfaceAtlasManager&) = delete; - -public: - /** - * nSurfaceWidth and nSurfaceHeight are the dimensions of the common surface(s) - */ - SkiaPackedSurfaceAtlasManager(int nSurfaceWidth, int nSurfaceHeight); - ~SkiaPackedSurfaceAtlasManager(); - - SkiaPackedSurface Reserve(int nWidth, int nHeight); - std::vector<sk_sp<SkSurface>> ReduceSurfaceNumber(int nMaxNumberOfSurfaces); -}; - -#endif // INCLUDED_VCL_INC_SKIA_PACKEDSURFACEATLAS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/skia/win/gdiimpl.hxx b/vcl/inc/skia/win/gdiimpl.hxx index c16981abcb23..cdb6977e5bd2 100644 --- a/vcl/inc/skia/win/gdiimpl.hxx +++ b/vcl/inc/skia/win/gdiimpl.hxx @@ -14,7 +14,6 @@ #include <vcl/dllapi.h> #include <skia/gdiimpl.hxx> -#include <skia/packedsurfaceatlas.hxx> #include <win/salgdi.h> #include <win/wingdiimpl.hxx> #include <o3tl/lru_map.hxx> @@ -34,14 +33,11 @@ public: virtual std::unique_ptr<Texture> getAsMaskTexture() const override; - virtual bool wantsTextColorWhite() const override { return true; } - sk_sp<SkImage> getAsImage() const; sk_sp<SkImage> getAsMaskImage() const; sk_sp<SkImage> getAsImageDiff(const SkiaCompatibleDC& white) const; struct Texture; - struct PackedTexture; }; struct SkiaCompatibleDC::Texture : public CompatibleDC::Texture @@ -52,14 +48,6 @@ struct SkiaCompatibleDC::Texture : public CompatibleDC::Texture virtual int GetHeight() const { return image->height(); } }; -struct SkiaCompatibleDC::PackedTexture : public CompatibleDC::Texture -{ - SkiaPackedSurface packedSurface; - virtual bool isValid() const { return packedSurface.mSurface.get(); } - virtual int GetWidth() const { return packedSurface.mRect.GetWidth(); } - virtual int GetHeight() const { return packedSurface.mRect.GetHeight(); } -}; - class WinSkiaSalGraphicsImpl : public SkiaSalGraphicsImpl, public WinSalGraphicsImplBase { private: @@ -78,15 +66,6 @@ public: int nY, ControlCacheKey& aControlCacheKey) override; virtual bool DrawTextLayout(const GenericSalLayout& layout) override; - // TODO This method of text drawing can probably be removed once DrawTextLayout() - // is fully usable. - virtual bool UseTextDraw() const override { return true; } - virtual void PreDrawText() override; - virtual void PostDrawText() override; - virtual void DrawTextMask(CompatibleDC::Texture* rTexture, Color nMaskColor, - const SalTwoRect& rPosAry) override; - virtual void DeferredTextDraw(const CompatibleDC::Texture* pTexture, Color nMaskColor, - const SalTwoRect& rPosAry) override; virtual void ClearDevFontCache() override; static void prepareSkia(); diff --git a/vcl/inc/skia/win/winlayout.hxx b/vcl/inc/skia/win/winlayout.hxx deleted file mode 100644 index 649fe993b05a..000000000000 --- a/vcl/inc/skia/win/winlayout.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_INC_SKIA_WIN_WINLAYOUT_HXX -#define INCLUDED_VCL_INC_SKIA_WIN_WINLAYOUT_HXX - -#include <win/winlayout.hxx> - -#include <vector> - -#include <skia/packedsurfaceatlas.hxx> - -struct SkiaGlobalWinGlyphCache : public GlobalWinGlyphCache -{ - SkiaGlobalWinGlyphCache() - : mPackedSurfaceAtlas(2048, 2048) - { - } - SkiaPackedSurfaceAtlasManager mPackedSurfaceAtlas; - virtual bool AllocateTexture(WinGlyphDrawElement& rElement, CompatibleDC* dc) override; - virtual void Prune() override; -}; - -class SkiaWinGlyphCache : public WinGlyphCache -{ -public: - void RemoveSurfaces(const std::vector<sk_sp<SkSurface>>& surfaces); - -private: - // This class just "adds" RemoveSurfaces() to the base class, it's never instantiated. - SkiaWinGlyphCache() = delete; -}; - -#endif // INCLUDED_VCL_INC_SKIA_WIN_WINLAYOUT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/skia/x11/cairotextrender.hxx b/vcl/inc/skia/x11/cairotextrender.hxx deleted file mode 100644 index 947657a499cd..000000000000 --- a/vcl/inc/skia/x11/cairotextrender.hxx +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_VCL_SKIA_X11_CAIROTEXTRENDER_HXX -#define INCLUDED_VCL_SKIA_X11_CAIROTEXTRENDER_HXX - -#include <unx/x11/x11cairotextrender.hxx> - -class SkiaX11CairoTextRender final : public X11CairoTextRender -{ -public: - explicit SkiaX11CairoTextRender(X11SalGraphics& rParent); - - virtual cairo_t* getCairoContext() override; - virtual void getSurfaceOffset(double& nDX, double& nDY) override; - virtual void releaseCairoContext(cairo_t* cr) override; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |