LibreOffice Module vcl (master) 1
gdiimpl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_SKIA_GDIIMPL_HXX
21#define INCLUDED_VCL_SKIA_GDIIMPL_HXX
22
23#include <vcl/dllapi.h>
24
25#include <salgdiimpl.hxx>
26#include <salgeom.hxx>
27
28#include <skia/utils.hxx>
29
30#include <SkPaint.h>
31#include <SkBlendMode.h>
32#include <optional>
33
34class SkiaFlushIdle;
36class SkFont;
37class SkiaSalBitmap;
38
40{
41public:
43 virtual ~SkiaSalGraphicsImpl() override;
44
45 virtual void Init() override;
46
47 virtual void DeInit() override;
48
49 virtual OUString getRenderBackendName() const override { return "skia"; }
50
51 const vcl::Region& getClipRegion() const;
52 virtual void setClipRegion(const vcl::Region&) override;
53
54 //
55 // get the depth of the device
56 virtual sal_uInt16 GetBitCount() const override;
57
58 // get the width of the device
59 virtual tools::Long GetGraphicsWidth() const override;
60
61 // set the clip region to empty
62 virtual void ResetClipRegion() override;
63
64 // set the line color to transparent (= don't draw lines)
65
66 virtual void SetLineColor() override;
67
68 // set the line color to a specific color
69 virtual void SetLineColor(Color nColor) override;
70
71 // set the fill color to transparent (= don't fill)
72 virtual void SetFillColor() override;
73
74 // set the fill color to a specific color, shapes will be
75 // filled accordingly
76 virtual void SetFillColor(Color nColor) override;
77
78 // enable/disable XOR drawing
79 virtual void SetXORMode(bool bSet, bool bInvertOnly) override;
80
81 // set line color for raster operations
82 virtual void SetROPLineColor(SalROPColor nROPColor) override;
83
84 // set fill color for raster operations
85 virtual void SetROPFillColor(SalROPColor nROPColor) override;
86
87 // draw --> LineColor and FillColor and RasterOp and ClipRegion
88 virtual void drawPixel(tools::Long nX, tools::Long nY) override;
89 virtual void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override;
90
91 virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2,
92 tools::Long nY2) override;
93
94 virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth,
95 tools::Long nHeight) override;
96
97 virtual void drawPolyLine(sal_uInt32 nPoints, const Point* pPtAry) override;
98
99 virtual void drawPolygon(sal_uInt32 nPoints, const Point* pPtAry) override;
100
101 virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints,
102 const Point** pPtAry) override;
103
104 virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice,
105 const basegfx::B2DPolyPolygon&, double fTransparency) override;
106
107 virtual bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice,
108 const basegfx::B2DPolygon&, double fTransparency, double fLineWidth,
109 const std::vector<double>* pStroke, basegfx::B2DLineJoin,
110 css::drawing::LineCap, double fMiterMinimumAngle,
111 bool bPixelSnapHairline) override;
112
113 virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point* pPtAry,
114 const PolyFlags* pFlgAry) override;
115
116 virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point* pPtAry,
117 const PolyFlags* pFlgAry) override;
118
119 virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32* pPoints,
120 const Point* const* pPtAry,
121 const PolyFlags* const* pFlgAry) override;
122
123 // CopyArea --> No RasterOp, but ClipRegion
124 virtual void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX,
125 tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight,
126 bool bWindowInvalidate) override;
127
128 virtual void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override;
129
130 virtual bool blendBitmap(const SalTwoRect&, const SalBitmap& rBitmap) override;
131
132 virtual bool blendAlphaBitmap(const SalTwoRect&, const SalBitmap& rSrcBitmap,
133 const SalBitmap& rMaskBitmap,
134 const SalBitmap& rAlphaBitmap) override;
135
136 virtual void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap) override;
137
138 virtual void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,
139 const SalBitmap& rMaskBitmap) override;
140
141 virtual void drawMask(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,
142 Color nMaskColor) override;
143
144 virtual std::shared_ptr<SalBitmap> getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth,
145 tools::Long nHeight) override;
146
147 virtual Color getPixel(tools::Long nX, tools::Long nY) override;
148
149 // invert --> ClipRegion (only Windows or VirDevs)
150 virtual void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
151 SalInvert nFlags) override;
152
153 virtual void invert(sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags) override;
154
155 virtual bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
156 void* pPtr, sal_uInt32 nSize) override;
157
170 virtual bool drawAlphaBitmap(const SalTwoRect&, const SalBitmap& rSourceBitmap,
171 const SalBitmap& rAlphaBitmap) override;
172
174 virtual bool drawTransformedBitmap(const basegfx::B2DPoint& rNull, const basegfx::B2DPoint& rX,
175 const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap,
176 const SalBitmap* pAlphaBitmap, double fAlpha) override;
177
178 virtual bool hasFastDrawTransformedBitmap() const override;
179
196 tools::Long nHeight, sal_uInt8 nTransparency) override;
197
198 virtual bool drawGradient(const tools::PolyPolygon& rPolygon,
199 const Gradient& rGradient) override;
200 virtual bool implDrawGradient(const basegfx::B2DPolyPolygon& rPolyPolygon,
201 const SalGradient& rGradient) override;
202
203 virtual bool supportsOperation(OutDevSupportType eType) const override;
204
205 // Dump contents to a file for debugging.
206 void dump(const char* file) const;
207
208 // Default blend mode for SkPaint is SkBlendMode::kSrcOver
209 void drawBitmap(const SalTwoRect& rPosAry, const SkiaSalBitmap& bitmap,
210 SkBlendMode blendMode = SkBlendMode::kSrcOver);
211
212 void drawImage(const SalTwoRect& rPosAry, const sk_sp<SkImage>& aImage, int srcScaling = 1,
213 SkBlendMode eBlendMode = SkBlendMode::kSrcOver);
214
215 void drawShader(const SalTwoRect& rPosAry, const sk_sp<SkShader>& shader,
216 SkBlendMode blendMode = SkBlendMode::kSrcOver);
217
218 void drawGenericLayout(const GenericSalLayout& layout, Color textColor, const SkFont& font,
219 const SkFont& verticalFont);
220
221protected:
222 // To be called before any drawing.
223 void preDraw();
224 // To be called after any drawing.
225 void postDraw();
226 // The canvas to draw to.
227 SkCanvas* getDrawCanvas() { return mSurface->getCanvas(); }
228 // Call before makeImageSnapshot(), ensures the content is up to date.
230
231 virtual void createSurface();
232 // Call to ensure that mSurface is valid. If mSurface is going to be modified,
233 // use preDraw() instead of this.
236 // Reimplemented for X11.
237 virtual bool avoidRecreateByResize() const;
238 void createWindowSurface(bool forceRaster = false);
239 virtual void createWindowSurfaceInternal(bool forceRaster = false) = 0;
242
244 tools::Long nHeight, double nTransparency, bool blockAA = false);
246
247 void setProvider(SalGeometryProvider* provider) { mProvider = provider; }
248
249 bool isOffscreen() const;
250 bool isGPU() const { return mIsGPU; }
251
252 void invert(basegfx::B2DPolygon const& rPoly, SalInvert eFlags);
253
254 // Called by SkiaFlushIdle.
257 friend class SkiaFlushIdle;
258
259 // get the width of the device
260 int GetWidth() const { return mProvider ? mProvider->GetWidth() : 1; }
261 // get the height of the device
262 int GetHeight() const { return mProvider ? mProvider->GetHeight() : 1; }
263 // Get the global HiDPI scaling factor.
264 virtual int getWindowScaling() const;
265
266 void addUpdateRegion(const SkRect& rect)
267 {
268 // Make slightly larger, just in case (rounding, antialiasing,...).
269 SkIRect addedRect = rect.makeOutset(2, 2).round();
270 // Using SkIRect should be enough, SkRegion would be too slow with many operations
271 // and swapping to the screen is not _that_slow.
272 mDirtyRect.join(addedRect);
273 }
276 static void setCanvasClipRegion(SkCanvas* canvas, const vcl::Region& region);
277 sk_sp<SkImage> mergeCacheBitmaps(const SkiaSalBitmap& bitmap, const SkiaSalBitmap* alphaBitmap,
278 const Size& targetSize);
280 static OString makeCachedImageKey(const SkiaSalBitmap& bitmap, const SkiaSalBitmap* alphaBitmap,
281 const Size& targetSize, DirectImage bitmapType,
282 DirectImage alphaBitmapType);
283
284 // Skia uses floating point coordinates, so when we use integer coordinates, sometimes
285 // rounding results in off-by-one errors (down), especially when drawing using GPU,
286 // see https://bugs.chromium.org/p/skia/issues/detail?id=9611 . Compensate for
287 // it by using centers of pixels. Using 0.5 may sometimes round up, so go with 0.495 .
288 static constexpr SkScalar toSkX(tools::Long x) { return x + 0.495; }
289 static constexpr SkScalar toSkY(tools::Long y) { return y + 0.495; }
290 // Value to add to be exactly in the middle of the pixel.
291 static constexpr SkScalar toSkXYFix = SkScalar(0.005);
292
293 // Perform any pending drawing such as delayed merging of polygons. Called by preDraw()
294 // and anything that means the next operation cannot be another one in a series (e.g.
295 // changing colors).
297 bool delayDrawPolyPolygon(const basegfx::B2DPolyPolygon& polygon, double transparency);
298 void performDrawPolyPolygon(const basegfx::B2DPolyPolygon& polygon, double transparency,
299 bool useAA);
300
302 SkSamplingOptions makeSamplingOptions(const SalTwoRect& rPosAry, int scalingFactor,
303 int srcScalingFactor = 1)
304 {
305 return SkiaHelper::makeSamplingOptions(rPosAry, scalingFactor, srcScalingFactor, isGPU());
306 }
307 SkSamplingOptions makeSamplingOptions(const SkMatrix& matrix, int scalingFactor)
308 {
310 }
311
312 // Create SkPaint to use when drawing to the surface. It is not to be used
313 // when doing internal drawing such as when merging two bitmaps together.
314 // This may apply some default settings to the paint as necessary.
315 SkPaint makePaintInternal() const;
316 // Create SkPaint set up for drawing lines (using mLineColor etc.).
317 SkPaint makeLinePaint(double transparency = 0) const;
318 // Create SkPaint set up for filling (using mFillColor etc.).
319 SkPaint makeFillPaint(double transparency = 0) const;
320 // Create SkPaint set up for bitmap drawing.
321 SkPaint makeBitmapPaint() const;
322 // Create SkPaint set up for gradient drawing.
323 SkPaint makeGradientPaint() const;
324 // Create SkPaint set up for text drawing.
325 SkPaint makeTextPaint(std::optional<Color> color) const;
326 // Create SkPaint for unspecified pixel drawing. Avoid if possible.
327 SkPaint makePixelPaint(std::optional<Color> color) const;
328
329 template <typename charT, typename traits>
330 friend inline std::basic_ostream<charT, traits>&
331 operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalGraphicsImpl* graphics)
332 {
333 if (graphics == nullptr)
334 return stream << "(null)";
335 // O - offscreen, G - GPU-based, R - raster
336 stream << static_cast<const void*>(graphics) << " "
337 << Size(graphics->GetWidth(), graphics->GetHeight());
338 if (graphics->mScaling != 1)
339 stream << "*" << graphics->mScaling;
340 stream << (graphics->isGPU() ? "G" : "R") << (graphics->isOffscreen() ? "O" : "");
341 return stream;
342 }
343
345
349 // The Skia surface that is target of all the rendering.
350 sk_sp<SkSurface> mSurface;
351 // Note that mSurface may be a proxy surface and not the one from the window context.
352 std::unique_ptr<sk_app::WindowContext> mWindowContext;
353 bool mIsGPU; // whether the surface is GPU-backed
354 // Note that we generally use VCL coordinates, which is not mSurface coordinates if mScaling!=1.
355 SkIRect mDirtyRect; // The area that has been changed since the last performFlush().
357 std::optional<Color> moLineColor;
358 std::optional<Color> moFillColor;
359 enum class XorMode
360 {
361 None,
362 Invert,
363 Xor
364 };
366 std::unique_ptr<SkiaFlushIdle> mFlush;
367 // Info about pending polygons to draw (we try to merge adjacent polygons into one).
369 {
373 };
375 inline static int pendingOperationsToFlush = 0;
376 int mScaling; // The scale factor for HiDPI screens.
378};
379
381{
382 SkPaint paint;
383 // Invert could be done using a blend mode like invert() does, but
384 // intentionally use SkBlender to make sure it's not overwritten
385 // by a blend mode set later (which would be probably a mistake),
386 // and so that the drawing color does not actually matter.
389 else if (mXorMode == XorMode::Xor)
391 return paint;
392}
393
394inline SkPaint SkiaSalGraphicsImpl::makeLinePaint(double transparency) const
395{
396 assert(moLineColor.has_value());
397 SkPaint paint = makePaintInternal();
398 paint.setColor(transparency == 0
401 paint.setStyle(SkPaint::kStroke_Style);
402 return paint;
403}
404
405inline SkPaint SkiaSalGraphicsImpl::makeFillPaint(double transparency) const
406{
407 assert(moFillColor.has_value());
408 SkPaint paint = makePaintInternal();
409 paint.setColor(transparency == 0
413 paint.setStyle(SkPaint::kStrokeAndFill_Style);
414 else
415 paint.setStyle(SkPaint::kFill_Style);
416 return paint;
417}
418
419inline SkPaint SkiaSalGraphicsImpl::makeBitmapPaint() const { return makePaintInternal(); }
420
422
423inline SkPaint SkiaSalGraphicsImpl::makeTextPaint(std::optional<Color> color) const
424{
425 assert(color.has_value());
426 SkPaint paint = makePaintInternal();
427 paint.setColor(SkiaHelper::toSkColor(*color));
428 return paint;
429}
430
431inline SkPaint SkiaSalGraphicsImpl::makePixelPaint(std::optional<Color> color) const
432{
433 assert(color.has_value());
434 SkPaint paint = makePaintInternal();
435 paint.setColor(SkiaHelper::toSkColor(*color));
436 return paint;
437}
438
439#endif
440
441/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::ostream & operator<<(std::ostream &rStrm, const glm::mat4 &rMatrix)
Interface used to share logic on sizing between SalVirtualDevices and SalFrames.
Definition: salgeom.hxx:80
Implementation class for SalGraphics.
Definition: salgdiimpl.hxx:51
sk_sp< SkSurface > mSurface
Definition: gdiimpl.hxx:350
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)
Definition: gdiimpl.hxx:247
virtual void ResetClipRegion() override
SkPaint makeGradientPaint() const
Definition: gdiimpl.hxx:421
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)
Definition: gdiimpl.hxx:289
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
Definition: gdiimpl.hxx:431
void createWindowSurface(bool forceRaster=false)
SalGraphics & mParent
Definition: gdiimpl.hxx:346
virtual void SetXORMode(bool bSet, bool bInvertOnly) override
std::unique_ptr< SkiaFlushIdle > mFlush
Definition: gdiimpl.hxx:366
SkCanvas * getDrawCanvas()
Definition: gdiimpl.hxx:227
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)
Definition: gdiimpl.hxx:302
bool isGPU() const
Definition: gdiimpl.hxx:250
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor) override
SkPaint makeLinePaint(double transparency=0) const
Definition: gdiimpl.hxx:394
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.
Definition: gdiimpl.hxx:348
vcl::Region mClipRegion
Definition: gdiimpl.hxx:356
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
Definition: gdiimpl.hxx:357
BmpScaleFlag goodScalingQuality() const
Definition: gdiimpl.hxx:301
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
Definition: gdiimpl.hxx:423
virtual void setClipRegion(const vcl::Region &) override
void setCanvasScalingAndClipping()
bool mInWindowBackingPropertiesChanged
Definition: gdiimpl.hxx:377
virtual ~SkiaSalGraphicsImpl() override
SkSamplingOptions makeSamplingOptions(const SkMatrix &matrix, int scalingFactor)
Definition: gdiimpl.hxx:307
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
bool isOffscreen() const
SkiaSalGraphicsImpl(SalGraphics &pParent, SalGeometryProvider *pProvider)
int GetHeight() const
Definition: gdiimpl.hxx:262
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 &region)
std::optional< Color > moFillColor
Definition: gdiimpl.hxx:358
virtual void SetFillColor() override
static constexpr SkScalar toSkX(tools::Long x)
Definition: gdiimpl.hxx:288
bool delayDrawPolyPolygon(const basegfx::B2DPolyPolygon &polygon, double transparency)
void addUpdateRegion(const SkRect &rect)
Definition: gdiimpl.hxx:266
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
int GetWidth() const
Definition: gdiimpl.hxx:260
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
Definition: gdiimpl.hxx:49
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
Definition: gdiimpl.hxx:380
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
Definition: gdiimpl.hxx:419
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
Definition: gdiimpl.hxx:405
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
Definition: gdiimpl.hxx:352
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 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
Definition: gdiimpl.hxx:374
virtual void flushSurfaceToWindowContext()
static OString makeCachedImageKey(const SkiaSalBitmap &bitmap, const SkiaSalBitmap *alphaBitmap, const Size &targetSize, DirectImage bitmapType, DirectImage alphaBitmapType)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
Reference< XOutputStream > stream
float y
float x
void setBlenderXor(SkPaint *paint)
BmpScaleFlag goodScalingQuality(bool isGPU)
Definition: utils.hxx:161
SkColor toSkColorWithTransparency(Color aColor, double fTransparency)
Definition: utils.hxx:91
SkSamplingOptions makeSamplingOptions(BmpScaleFlag scalingType, SkMatrix matrix, int scalingFactor)
Definition: utils.hxx:174
void setBlenderInvert(SkPaint *paint)
SkColor toSkColor(Color color)
Definition: utils.hxx:86
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
double matrix[4][4]
None
long Long
PolyFlags
SalROPColor
Definition: salgtype.hxx:69
SalInvert
Definition: salgtype.hxx:73
basegfx::B2DPolyPolygonVector polygons
Definition: gdiimpl.hxx:370
unsigned char sal_uInt8
OutDevSupportType
Definition: vclenum.hxx:163