20#ifndef INCLUDED_VCL_SKIA_GDIIMPL_HXX
21#define INCLUDED_VCL_SKIA_GDIIMPL_HXX
31#include <SkBlendMode.h>
45 virtual void Init()
override;
79 virtual void SetXORMode(
bool bSet,
bool bInvertOnly)
override;
102 const Point** pPtAry)
override;
110 css::drawing::LineCap,
double fMiterMinimumAngle,
111 bool bPixelSnapHairline)
override;
120 const Point*
const* pPtAry,
121 const PolyFlags*
const* pFlgAry)
override;
126 bool bWindowInvalidate)
override;
142 Color nMaskColor)
override;
156 void* pPtr, sal_uInt32 nSize)
override;
176 const SalBitmap* pAlphaBitmap,
double fAlpha)
override;
199 const Gradient& rGradient)
override;
206 void dump(
const char* file)
const;
210 SkBlendMode blendMode = SkBlendMode::kSrcOver);
213 SkBlendMode eBlendMode = SkBlendMode::kSrcOver);
216 SkBlendMode blendMode = SkBlendMode::kSrcOver);
219 const SkFont& verticalFont);
244 tools::Long nHeight,
double nTransparency,
bool blockAA =
false);
250 bool isGPU()
const {
return mIsGPU; }
257 friend class SkiaFlushIdle;
260 int GetWidth()
const {
return mProvider ? mProvider->GetWidth() : 1; }
262 int GetHeight()
const {
return mProvider ? mProvider->GetHeight() : 1; }
269 SkIRect addedRect = rect.makeOutset(2, 2).round();
272 mDirtyRect.join(addedRect);
278 const Size& targetSize);
291 static constexpr SkScalar toSkXYFix = SkScalar(0.005);
303 int srcScalingFactor = 1)
315 SkPaint makePaintInternal()
const;
317 SkPaint makeLinePaint(
double transparency = 0)
const;
319 SkPaint makeFillPaint(
double transparency = 0)
const;
321 SkPaint makeBitmapPaint()
const;
323 SkPaint makeGradientPaint()
const;
325 SkPaint makeTextPaint(std::optional<Color>
color)
const;
327 SkPaint makePixelPaint(std::optional<Color>
color)
const;
329 template <
typename charT,
typename traits>
330 friend inline std::basic_ostream<charT, traits>&
333 if (graphics ==
nullptr)
334 return stream <<
"(null)";
336 stream << static_cast<const void*>(graphics) <<
" "
375 inline static int pendingOperationsToFlush = 0;
398 paint.setColor(transparency == 0
401 paint.setStyle(SkPaint::kStroke_Style);
409 paint.setColor(transparency == 0
413 paint.setStyle(SkPaint::kStrokeAndFill_Style);
415 paint.setStyle(SkPaint::kFill_Style);
425 assert(
color.has_value());
433 assert(
color.has_value());
std::ostream & operator<<(std::ostream &rStrm, const glm::mat4 &rMatrix)
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Implementation class for SalGraphics.
sk_sp< SkSurface > mSurface
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual void SetROPFillColor(SalROPColor nROPColor) override
void drawGenericLayout(const GenericSalLayout &layout, Color textColor, const SkFont &font, const SkFont &verticalFont)
virtual tools::Long GetGraphicsWidth() const override
void setProvider(SalGeometryProvider *provider)
virtual void ResetClipRegion() override
SkPaint makeGradientPaint() const
virtual int getWindowScaling() const
void privateDrawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, double nTransparency, bool blockAA=false)
void invert(basegfx::B2DPolygon const &rPoly, SalInvert eFlags)
virtual void SetROPLineColor(SalROPColor nROPColor) override
static constexpr SkScalar toSkY(tools::Long y)
virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual void SetFillColor(Color nColor) override
SkPaint makePixelPaint(std::optional< Color > color) const
void createWindowSurface(bool forceRaster=false)
virtual void SetXORMode(bool bSet, bool bInvertOnly) override
std::unique_ptr< SkiaFlushIdle > mFlush
SkCanvas * getDrawCanvas()
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap) override
Render bitmap with alpha channel.
virtual bool avoidRecreateByResize() const
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
virtual bool implDrawGradient(const basegfx::B2DPolyPolygon &rPolyPolygon, const SalGradient &rGradient) override
SkSamplingOptions makeSamplingOptions(const SalTwoRect &rPosAry, int scalingFactor, int srcScalingFactor=1)
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
SkPaint makeLinePaint(double transparency=0) const
virtual bool supportsOperation(OutDevSupportType eType) const override
virtual void DeInit() override
virtual void SetLineColor(Color nColor) override
virtual bool drawPolyLine(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &, double fTransparency, double fLineWidth, const std::vector< double > *pStroke, basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle, bool bPixelSnapHairline) override
void dump(const char *file) const
SalGeometryProvider * mProvider
Pointer to the SalFrame or SalVirtualDevice.
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rMaskBitmap) override
virtual void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override
virtual void createWindowSurfaceInternal(bool forceRaster=false)=0
std::optional< Color > moLineColor
BmpScaleFlag goodScalingQuality() const
virtual void Init() override
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry) override
virtual Color getPixel(tools::Long nX, tools::Long nY) override
void drawImage(const SalTwoRect &rPosAry, const sk_sp< SkImage > &aImage, int srcScaling=1, SkBlendMode eBlendMode=SkBlendMode::kSrcOver)
SkPaint makeTextPaint(std::optional< Color > color) const
virtual void setClipRegion(const vcl::Region &) override
void setCanvasScalingAndClipping()
bool mInWindowBackingPropertiesChanged
virtual ~SkiaSalGraphicsImpl() override
SkSamplingOptions makeSamplingOptions(const SkMatrix &matrix, int scalingFactor)
virtual bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize) override
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap) override
virtual bool drawGradient(const tools::PolyPolygon &rPolygon, const Gradient &rGradient) override
SkiaSalGraphicsImpl(SalGraphics &pParent, SalGeometryProvider *pProvider)
virtual bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha) override
draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system
static void setCanvasClipRegion(SkCanvas *canvas, const vcl::Region ®ion)
std::optional< Color > moFillColor
virtual void SetFillColor() override
static constexpr SkScalar toSkX(tools::Long x)
bool delayDrawPolyPolygon(const basegfx::B2DPolyPolygon &polygon, double transparency)
void addUpdateRegion(const SkRect &rect)
virtual void drawPixel(tools::Long nX, tools::Long nY) override
virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override
virtual bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency) override
Render solid rectangle with given transparency.
virtual OUString getRenderBackendName() const override
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry) override
void resetCanvasScalingAndClipping()
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap) override
void privateCopyBits(const SalTwoRect &rPosAry, SkiaSalGraphicsImpl *src)
virtual sal_uInt16 GetBitCount() const override
SkPaint makePaintInternal() const
void createOffscreenSurface()
virtual void SetLineColor() override
sk_sp< SkImage > mergeCacheBitmaps(const SkiaSalBitmap &bitmap, const SkiaSalBitmap *alphaBitmap, const Size &targetSize)
void windowBackingPropertiesChanged()
virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency) override
virtual void invert(sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags) override
SkPaint makeBitmapPaint() const
virtual bool hasFastDrawTransformedBitmap() const override
void drawBitmap(const SalTwoRect &rPosAry, const SkiaSalBitmap &bitmap, SkBlendMode blendMode=SkBlendMode::kSrcOver)
virtual bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap) override
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry) override
SkPaint makeFillPaint(double transparency=0) const
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry) override
virtual void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry) override
void drawShader(const SalTwoRect &rPosAry, const sk_sp< SkShader > &shader, SkBlendMode blendMode=SkBlendMode::kSrcOver)
virtual void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags) override
std::unique_ptr< sk_app::WindowContext > mWindowContext
virtual void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override
virtual void createSurface()
void checkPendingDrawing()
void performDrawPolyPolygon(const basegfx::B2DPolyPolygon &polygon, double transparency, bool useAA)
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics) override
const vcl::Region & getClipRegion() const
LastPolyPolygonInfo mLastPolyPolygonInfo
virtual void flushSurfaceToWindowContext()
static OString makeCachedImageKey(const SkiaSalBitmap &bitmap, const SkiaSalBitmap *alphaBitmap, const Size &targetSize, DirectImage bitmapType, DirectImage alphaBitmapType)
Reference< XOutputStream > stream
void setBlenderXor(SkPaint *paint)
BmpScaleFlag goodScalingQuality(bool isGPU)
SkColor toSkColorWithTransparency(Color aColor, double fTransparency)
SkSamplingOptions makeSamplingOptions(BmpScaleFlag scalingType, SkMatrix matrix, int scalingFactor)
void setBlenderInvert(SkPaint *paint)
SkColor toSkColor(Color color)
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
basegfx::B2DPolyPolygonVector polygons