tdf#151341 Use lzfse compression instead of bzip2
[LibreOffice.git] / vcl / inc / salgdi.hxx
blob0b8952b74123de963257bc9a61f1f174604fd45f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <sal/config.h>
24 #include <vcl/outdev.hxx>
26 #include "impfontmetricdata.hxx"
27 #include "salgdiimpl.hxx"
28 #include "sallayout.hxx"
29 #include "SalGradient.hxx"
30 #include <basegfx/matrix/b2dhommatrix.hxx>
31 #include "WidgetDrawInterface.hxx"
33 #include <config_cairo_canvas.h>
35 #include <map>
36 #include <vector>
38 class SalBitmap;
39 class FontAttributes;
40 namespace vcl::font {
41 class FontSelectPattern;
42 class PhysicalFontFace;
43 class PhysicalFontCollection;
45 class SalLayout;
46 namespace tools { class Rectangle; }
47 class OutputDevice;
48 class FreetypeFont;
49 struct SystemGraphicsData;
51 namespace basegfx {
52 class B2DVector;
53 class B2DPolygon;
54 class B2DPolyPolygon;
57 namespace vcl
59 class AbstractTrueTypeFont;
60 class FileDefinitionWidgetDraw;
61 typedef struct TTGlobalFontInfo_ TTGlobalFontInfo;
64 typedef sal_Unicode sal_Ucs; // TODO: use sal_UCS4 instead of sal_Unicode
66 // note: if you add any new methods to class SalGraphics using coordinates
67 // make sure they have a corresponding protected pure virtual method
68 // which has to be implemented by the platform dependent part.
69 // Add a method that performs coordinate mirroring if required, (see
70 // existing methods as sample) and then calls the equivalent pure method.
72 // note: all positions are in pixel and relative to
73 // the top/left-position of the virtual output area
75 class VCL_PLUGIN_PUBLIC SalGraphics : protected vcl::WidgetDrawInterface
77 public:
78 SalGraphics();
79 ~SalGraphics() COVERITY_NOEXCEPT_FALSE override;
81 virtual SalGraphicsImpl* GetImpl() const = 0;
83 void setAntiAlias(bool bNew)
85 m_bAntiAlias = bNew;
87 // Temporary store in both
88 if (GetImpl())
89 GetImpl()->setAntiAlias(bNew);
92 bool getAntiAlias() const
94 return m_bAntiAlias;
97 // public SalGraphics methods, the interface to the independent vcl part
99 // get device resolution
100 virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) = 0;
102 // get the depth of the device
103 virtual sal_uInt16 GetBitCount() const = 0;
105 // get the width of the device
106 virtual tools::Long GetGraphicsWidth() const = 0;
108 // set the clip region to empty
109 virtual void ResetClipRegion() = 0;
111 // set the line color to transparent (= don't draw lines)
113 virtual void SetLineColor() = 0;
115 // set the line color to a specific color
116 virtual void SetLineColor( Color nColor ) = 0;
118 // set the fill color to transparent (= don't fill)
119 virtual void SetFillColor() = 0;
121 // set the fill color to a specific color, shapes will be
122 // filled accordingly
123 virtual void SetFillColor( Color nColor ) = 0;
125 // enable/disable XOR drawing
126 virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
128 // set line color for raster operations
129 virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
131 // set fill color for raster operations
132 virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
134 // set the text color to a specific color
135 virtual void SetTextColor( Color nColor ) = 0;
137 // set the font
138 virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) = 0;
140 // release the fonts
141 void ReleaseFonts() { SetFont( nullptr, 0 ); }
143 // get the current font's metrics
144 virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) = 0;
146 // get the repertoire of the current font
147 virtual FontCharMapRef GetFontCharMap() const = 0;
149 // get the layout capabilities of the current font
150 virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
152 // graphics must fill supplied font list
153 virtual void GetDevFontList( vcl::font::PhysicalFontCollection* ) = 0;
155 // graphics must drop any cached font info
156 virtual void ClearDevFontCache() = 0;
158 virtual bool AddTempDevFont(
159 vcl::font::PhysicalFontCollection*,
160 const OUString& rFileURL,
161 const OUString& rFontName ) = 0;
163 virtual std::unique_ptr<GenericSalLayout>
164 GetTextLayout(int nFallbackLevel) = 0;
165 virtual void DrawTextLayout( const GenericSalLayout& ) = 0;
167 virtual bool supportsOperation( OutDevSupportType ) const = 0;
169 // mirroring specifics
170 SalLayoutFlags GetLayout() const { return m_nLayout; }
171 void SetLayout( SalLayoutFlags aLayout ) { m_nLayout = aLayout;}
173 void mirror( tools::Long& nX, const OutputDevice& rOutDev ) const;
174 // only called mirror2 to avoid ambiguity
175 [[nodiscard]] tools::Long mirror2( tools::Long nX, const OutputDevice& rOutDev ) const;
176 void mirror( tools::Long& nX, tools::Long nWidth, const OutputDevice& rOutDev, bool bBack = false ) const;
177 bool mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice& rOutDev ) const;
178 void mirror( tools::Rectangle& rRect, const OutputDevice&, bool bBack = false ) const;
179 void mirror( vcl::Region& rRgn, const OutputDevice& rOutDev ) const;
180 void mirror( ImplControlValue&, const OutputDevice& ) const;
181 basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice& rOutDev ) const;
182 const basegfx::B2DHomMatrix& getMirror( const OutputDevice& rOutDev ) const;
184 // non virtual methods; these do possible coordinate mirroring and
185 // then delegate to protected virtual methods
186 bool SetClipRegion( const vcl::Region&, const OutputDevice& rOutDev );
188 // draw --> LineColor and FillColor and RasterOp and ClipRegion
189 void DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev );
190 void DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice& rOutDev );
192 void DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice& rOutDev );
194 void DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice& rOutDev );
196 void DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice& rOutDev );
198 void DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice& rOutDev );
200 void DrawPolyPolygon(
201 sal_uInt32 nPoly,
202 const sal_uInt32* pPoints,
203 const Point** pPtAry,
204 const OutputDevice& rOutDev );
206 bool DrawPolyPolygon(
207 const basegfx::B2DHomMatrix& rObjectToDevice,
208 const basegfx::B2DPolyPolygon &i_rPolyPolygon,
209 double i_fTransparency,
210 const OutputDevice& i_rOutDev);
212 bool DrawPolyLine(
213 const basegfx::B2DHomMatrix& rObjectToDevice,
214 const basegfx::B2DPolygon& i_rPolygon,
215 double i_fTransparency,
216 double i_fLineWidth,
217 const std::vector< double >* i_pStroke, // MM01
218 basegfx::B2DLineJoin i_eLineJoin,
219 css::drawing::LineCap i_eLineCap,
220 double i_fMiterMinimumAngle,
221 bool bPixelSnapHairline,
222 const OutputDevice& i_rOutDev);
224 bool DrawPolyLineBezier(
225 sal_uInt32 nPoints,
226 const Point* pPtAry,
227 const PolyFlags* pFlgAry,
228 const OutputDevice& rOutDev );
230 bool DrawPolygonBezier(
231 sal_uInt32 nPoints,
232 const Point* pPtAry,
233 const PolyFlags* pFlgAry,
234 const OutputDevice& rOutDev );
236 bool DrawPolyPolygonBezier(
237 sal_uInt32 nPoly,
238 const sal_uInt32* pPoints,
239 const Point* const* pPtAry,
240 const PolyFlags* const* pFlgAry,
241 const OutputDevice& rOutDev );
243 bool DrawGradient(
244 const tools::PolyPolygon& rPolyPoly,
245 const Gradient& rGradient,
246 const OutputDevice& rOutDev);
248 // CopyArea --> No RasterOp, but ClipRegion
249 void CopyArea(
250 tools::Long nDestX, tools::Long nDestY,
251 tools::Long nSrcX, tools::Long nSrcY,
252 tools::Long nSrcWidth, tools::Long nSrcHeight,
253 const OutputDevice& rOutDev );
255 // CopyBits --> RasterOp and ClipRegion
256 // CopyBits() CopyBits on same Graphics
257 void CopyBits(
258 const SalTwoRect& rPosAry,
259 const OutputDevice& rOutDev);
261 // CopyBits --> RasterOp and ClipRegion
262 // CopyBits() CopyBits on different Graphics
263 void CopyBits(
264 const SalTwoRect& rPosAry,
265 SalGraphics& rSrcGraphics,
266 const OutputDevice& rOutDev,
267 const OutputDevice& rSrcOutDev );
270 void DrawBitmap(
271 const SalTwoRect& rPosAry,
272 const SalBitmap& rSalBitmap,
273 const OutputDevice& rOutDev );
275 void DrawBitmap(
276 const SalTwoRect& rPosAry,
277 const SalBitmap& rSalBitmap,
278 const SalBitmap& rTransparentBitmap,
279 const OutputDevice& rOutDev );
281 void DrawMask(
282 const SalTwoRect& rPosAry,
283 const SalBitmap& rSalBitmap,
284 Color nMaskColor,
285 const OutputDevice& rOutDev );
287 std::shared_ptr<SalBitmap> GetBitmap(
288 tools::Long nX, tools::Long nY,
289 tools::Long nWidth, tools::Long nHeight,
290 const OutputDevice& rOutDev );
292 Color GetPixel(
293 tools::Long nX, tools::Long nY,
294 const OutputDevice& rOutDev );
296 // invert --> ClipRegion (only Windows)
297 void Invert(
298 tools::Long nX, tools::Long nY,
299 tools::Long nWidth, tools::Long nHeight,
300 SalInvert nFlags,
301 const OutputDevice& rOutDev );
303 void Invert(
304 sal_uInt32 nPoints,
305 const Point* pPtAry,
306 SalInvert nFlags,
307 const OutputDevice& rOutDev );
309 bool DrawEPS(
310 tools::Long nX, tools::Long nY,
311 tools::Long nWidth, tools::Long nHeight,
312 void* pPtr,
313 sal_uInt32 nSize,
314 const OutputDevice& rOutDev );
316 // native widget rendering functions
319 * @see WidgetDrawInterface::isNativeControlSupported
321 inline bool IsNativeControlSupported(ControlType, ControlPart);
324 * @see WidgetDrawInterface::hitTestNativeControl
326 bool HitTestNativeScrollbar(
327 ControlPart nPart,
328 const tools::Rectangle& rControlRegion,
329 const Point& aPos,
330 bool& rIsInside,
331 const OutputDevice& rOutDev);
334 * @see WidgetDrawInterface::drawNativeControl
336 bool DrawNativeControl(
337 ControlType nType,
338 ControlPart nPart,
339 const tools::Rectangle& rControlRegion,
340 ControlState nState,
341 const ImplControlValue& aValue,
342 const OUString& aCaption,
343 const OutputDevice& rOutDev,
344 const Color& rBackgroundColor = COL_AUTO );
347 * @see WidgetDrawInterface::getNativeControlRegion
349 bool GetNativeControlRegion(
350 ControlType nType,
351 ControlPart nPart,
352 const tools::Rectangle& rControlRegion,
353 ControlState nState,
354 const ImplControlValue& aValue,
355 tools::Rectangle &rNativeBoundingRegion,
356 tools::Rectangle &rNativeContentRegion,
357 const OutputDevice& rOutDev );
360 * @see WidgetDrawInterface::updateSettings
362 inline bool UpdateSettings(AllSettings&);
364 bool BlendBitmap(
365 const SalTwoRect& rPosAry,
366 const SalBitmap& rSalBitmap,
367 const OutputDevice& rOutDev );
369 bool BlendAlphaBitmap(
370 const SalTwoRect& rPosAry,
371 const SalBitmap& rSalSrcBitmap,
372 const SalBitmap& rSalMaskBitmap,
373 const SalBitmap& rSalAlphaBitmap,
374 const OutputDevice& rOutDev );
376 bool DrawAlphaBitmap(
377 const SalTwoRect&,
378 const SalBitmap& rSourceBitmap,
379 const SalBitmap& rAlphaBitmap,
380 const OutputDevice& rOutDev );
382 bool DrawTransformedBitmap(
383 const basegfx::B2DPoint& rNull,
384 const basegfx::B2DPoint& rX,
385 const basegfx::B2DPoint& rY,
386 const SalBitmap& rSourceBitmap,
387 const SalBitmap* pAlphaBitmap,
388 double fAlpha,
389 const OutputDevice& rOutDev );
391 bool HasFastDrawTransformedBitmap() const;
393 bool DrawAlphaRect(
394 tools::Long nX, tools::Long nY,
395 tools::Long nWidth, tools::Long nHeight,
396 sal_uInt8 nTransparency,
397 const OutputDevice& rOutDev );
399 virtual OUString getRenderBackendName() const;
401 virtual SystemGraphicsData GetGraphicsData() const = 0;
403 // Backends like the svp/gtk ones use cairo and hidpi scale at the surface
404 // but bitmaps aren't hidpi, so if this returns true for the case that the
405 // surface is hidpi then pScaleOut contains the scaling factor. So we can
406 // create larger hires bitmaps which we know will be logically scaled down
407 // by this factor but physically just copied
408 virtual bool ShouldDownscaleIconsAtSurface(double* pScaleOut) const;
411 #if ENABLE_CAIRO_CANVAS
413 /// Check whether cairo will work
414 virtual bool SupportsCairo() const = 0;
415 /// Create Surface from given cairo surface
416 virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const = 0;
417 /// Create surface with given dimensions
418 virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const = 0;
419 /// Create Surface for given bitmap data
420 virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const = 0;
421 virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const = 0;
423 #endif // ENABLE_CAIRO_CANVAS
425 protected:
427 friend class vcl::FileDefinitionWidgetDraw;
429 virtual bool setClipRegion( const vcl::Region& ) = 0;
431 // draw --> LineColor and FillColor and RasterOp and ClipRegion
432 virtual void drawPixel( tools::Long nX, tools::Long nY ) = 0;
433 virtual void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) = 0;
435 virtual void drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) = 0;
437 virtual void drawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
439 virtual void drawPolyLine( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
441 virtual void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
443 virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) = 0;
445 virtual bool drawPolyPolygon(
446 const basegfx::B2DHomMatrix& rObjectToDevice,
447 const basegfx::B2DPolyPolygon&,
448 double fTransparency) = 0;
450 virtual bool drawPolyLine(
451 const basegfx::B2DHomMatrix& rObjectToDevice,
452 const basegfx::B2DPolygon&,
453 double fTransparency,
454 double fLineWidth,
455 const std::vector< double >* pStroke, // MM01
456 basegfx::B2DLineJoin,
457 css::drawing::LineCap,
458 double fMiterMinimumAngle,
459 bool bPixelSnapHairline) = 0;
461 virtual bool drawPolyLineBezier(
462 sal_uInt32 nPoints,
463 const Point* pPtAry,
464 const PolyFlags* pFlgAry ) = 0;
466 virtual bool drawPolygonBezier(
467 sal_uInt32 nPoints,
468 const Point* pPtAry,
469 const PolyFlags* pFlgAry ) = 0;
471 virtual bool drawPolyPolygonBezier(
472 sal_uInt32 nPoly,
473 const sal_uInt32* pPoints,
474 const Point* const* pPtAry,
475 const PolyFlags* const* pFlgAry ) = 0;
477 virtual bool drawGradient(
478 const tools::PolyPolygon& rPolyPoly,
479 const Gradient& rGradient ) = 0;
481 virtual bool implDrawGradient(basegfx::B2DPolyPolygon const & /*rPolyPolygon*/,
482 SalGradient const & /*rGradient*/)
484 return false;
487 // CopyArea --> No RasterOp, but ClipRegion
488 virtual void copyArea(
489 tools::Long nDestX, tools::Long nDestY,
490 tools::Long nSrcX, tools::Long nSrcY,
491 tools::Long nSrcWidth, tools::Long nSrcHeight,
492 bool bWindowInvalidate ) = 0;
494 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
495 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
496 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
498 virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
500 virtual void drawBitmap(
501 const SalTwoRect& rPosAry,
502 const SalBitmap& rSalBitmap,
503 const SalBitmap& rMaskBitmap ) = 0;
505 virtual void drawMask(
506 const SalTwoRect& rPosAry,
507 const SalBitmap& rSalBitmap,
508 Color nMaskColor ) = 0;
510 virtual std::shared_ptr<SalBitmap> getBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
512 virtual Color getPixel( tools::Long nX, tools::Long nY ) = 0;
514 // invert --> ClipRegion (only Windows or VirDevs)
515 virtual void invert(
516 tools::Long nX, tools::Long nY,
517 tools::Long nWidth, tools::Long nHeight,
518 SalInvert nFlags) = 0;
520 virtual void invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags ) = 0;
522 virtual bool drawEPS(
523 tools::Long nX, tools::Long nY,
524 tools::Long nWidth, tools::Long nHeight,
525 void* pPtr,
526 sal_uInt32 nSize ) = 0;
528 /** Blend the bitmap with the current buffer */
529 virtual bool blendBitmap(
530 const SalTwoRect&,
531 const SalBitmap& rBitmap ) = 0;
533 /** Draw the bitmap by blending using the mask and alpha channel */
534 virtual bool blendAlphaBitmap(
535 const SalTwoRect&,
536 const SalBitmap& rSrcBitmap,
537 const SalBitmap& rMaskBitmap,
538 const SalBitmap& rAlphaBitmap ) = 0;
540 /** Render bitmap with alpha channel
542 @param rSourceBitmap
543 Source bitmap to blit
545 @param rAlphaBitmap
546 Alpha channel to use for blitting
548 @return true, if the operation succeeded, and false
549 otherwise. In this case, clients should try to emulate alpha
550 compositing themselves
552 virtual bool drawAlphaBitmap(
553 const SalTwoRect&,
554 const SalBitmap& rSourceBitmap,
555 const SalBitmap& rAlphaBitmap ) = 0;
557 /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system
559 @param fAlpha additional alpha (0 to 1) to apply while drawing
561 virtual bool drawTransformedBitmap(
562 const basegfx::B2DPoint& rNull,
563 const basegfx::B2DPoint& rX,
564 const basegfx::B2DPoint& rY,
565 const SalBitmap& rSourceBitmap,
566 const SalBitmap* pAlphaBitmap,
567 double fAlpha) = 0;
569 /// Returns true if the drawTransformedBitmap() call is fast, and so it should
570 /// be used directly without trying to optimize some calls e.g. by calling drawBitmap()
571 /// instead (which is faster for most VCL backends). These optimizations are not
572 /// done unconditionally because they may be counter-productive for some fast VCL backends
573 /// (for example, some OutputDevice optimizations could try access the pixels, which
574 /// would make performance worse for GPU-backed backends).
575 /// See also tdf#138068.
576 virtual bool hasFastDrawTransformedBitmap() const = 0;
578 /** Render solid rectangle with given transparency
580 * @param nX Top left coordinate of rectangle
581 * @param nY Bottom right coordinate of rectangle
582 * @param nWidth Width of rectangle
583 * @param nHeight Height of rectangle
584 * @param nTransparency Transparency value (0-255) to use. 0 blits and opaque, 255 a
585 * fully transparent rectangle
586 * @returns true if successfully drawn, false if not able to draw rectangle
588 virtual bool drawAlphaRect(
589 tools::Long nX, tools::Long nY,
590 tools::Long nWidth, tools::Long nHeight,
591 sal_uInt8 nTransparency ) = 0;
593 private:
594 SalLayoutFlags m_nLayout; //< 0: mirroring off, 1: mirror x-axis
596 // for buffering the Mirror-Matrix, see ::getMirror
597 enum class MirrorMode
599 NONE,
600 Antiparallel,
601 AntiparallelBiDi,
602 BiDi
604 MirrorMode m_eLastMirrorMode;
605 tools::Long m_nLastMirrorTranslation;
606 basegfx::B2DHomMatrix m_aLastMirror;
608 MirrorMode GetMirrorMode(const OutputDevice& rOutDev) const;
610 protected:
611 /// flags which hold the SetAntialiasing() value from OutputDevice
612 bool m_bAntiAlias : 1;
614 inline tools::Long GetDeviceWidth(const OutputDevice& rOutDev) const;
617 * Handle damage done by drawing with a widget draw override
619 * If a m_pWidgetDraw is set and successfully draws using drawNativeControl,
620 * this function is called to handle the damage done to the graphics buffer.
622 * @param rDamagedRegion the region damaged by drawNativeControl.
624 virtual inline void handleDamage(const tools::Rectangle& rDamagedRegion);
626 // native controls
627 bool initWidgetDrawBackends(bool bForce = false);
629 std::unique_ptr<vcl::WidgetDrawInterface> m_pWidgetDraw;
630 vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? m_pWidgetDraw.get() : this; }
633 bool SalGraphics::IsNativeControlSupported(ControlType eType, ControlPart ePart)
635 return forWidget()->isNativeControlSupported(eType, ePart);
638 bool SalGraphics::UpdateSettings(AllSettings& rSettings)
640 return forWidget()->updateSettings(rSettings);
643 void SalGraphics::handleDamage(const tools::Rectangle&) {}
646 class VCL_DLLPUBLIC SalGraphicsAutoDelegateToImpl : public SalGraphics
648 public:
649 sal_uInt16 GetBitCount() const override
651 return GetImpl()->GetBitCount();
654 tools::Long GetGraphicsWidth() const override
656 return GetImpl()->GetGraphicsWidth();
659 void ResetClipRegion() override
661 GetImpl()->ResetClipRegion();
664 bool setClipRegion( const vcl::Region& i_rClip ) override
666 return GetImpl()->setClipRegion(i_rClip);
669 void SetLineColor() override
671 GetImpl()->SetLineColor();
674 void SetLineColor( Color nColor ) override
676 GetImpl()->SetLineColor(nColor);
679 void SetFillColor() override
681 GetImpl()->SetFillColor();
684 void SetFillColor( Color nColor ) override
686 GetImpl()->SetFillColor (nColor);
689 void SetROPLineColor(SalROPColor aColor) override
691 GetImpl()->SetROPLineColor(aColor);
694 void SetROPFillColor( SalROPColor aColor) override
696 GetImpl()->SetROPFillColor(aColor);
699 void SetXORMode(bool bSet, bool bInvertOnly) override
701 GetImpl()->SetXORMode(bSet, bInvertOnly);
704 void drawPixel( tools::Long nX, tools::Long nY ) override
706 GetImpl()->drawPixel(nX, nY);
709 void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) override
711 GetImpl()->drawPixel(nX, nY, nColor);
714 void drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) override
716 GetImpl()->drawLine(nX1, nY1, nX2, nY2);
719 void drawRect( tools::Long nX, tools::Long nY, tools::Long nDX, tools::Long nDY ) override
721 GetImpl()->drawRect(nX, nY, nDX, nDY);
724 void drawPolyLine( sal_uInt32 nPoints, const Point *pPtAry ) override
726 GetImpl()->drawPolyLine(nPoints, pPtAry);
729 void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) override
731 GetImpl()->drawPolygon(nPoints, pPtAry);
734 void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry) override
736 GetImpl()->drawPolyPolygon (nPoly, pPoints, pPtAry);
739 bool drawPolyPolygon(
740 const basegfx::B2DHomMatrix& rObjectToDevice,
741 const basegfx::B2DPolyPolygon& rPolyPolygon,
742 double fTransparency) override
744 return GetImpl()->drawPolyPolygon(rObjectToDevice, rPolyPolygon, fTransparency);
747 bool drawPolyLine(
748 const basegfx::B2DHomMatrix& rObjectToDevice,
749 const basegfx::B2DPolygon& rPolygon,
750 double fTransparency,
751 double fLineWidth,
752 const std::vector< double >* pStroke,
753 basegfx::B2DLineJoin eJoin,
754 css::drawing::LineCap eLineCap,
755 double fMiterMinimumAngle,
756 bool bPixelSnapHairline) override
758 return GetImpl()->drawPolyLine(rObjectToDevice, rPolygon, fTransparency, fLineWidth, pStroke, eJoin, eLineCap, fMiterMinimumAngle, bPixelSnapHairline);
761 bool drawPolyLineBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry ) override
763 return GetImpl()->drawPolyLineBezier(nPoints, pPtAry, pFlgAry);
766 bool drawPolygonBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry ) override
768 return GetImpl()->drawPolygonBezier(nPoints, pPtAry, pFlgAry);
771 bool drawPolyPolygonBezier( sal_uInt32 nPoly,
772 const sal_uInt32* pPoints,
773 const Point* const* pPtAry,
774 const PolyFlags* const* pFlgAry) override
776 return GetImpl()->drawPolyPolygonBezier(nPoly, pPoints, pPtAry, pFlgAry);
779 void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
780 SalInvert nFlags) override
782 GetImpl()->invert(nX, nY, nWidth, nHeight, nFlags);
785 void invert(sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags) override
787 GetImpl()->invert(nPoints, pPtAry, nFlags);
790 bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth,
791 tools::Long nHeight, void* pPtr, sal_uInt32 nSize) override
793 return GetImpl()->drawEPS(nX, nY, nWidth, nHeight, pPtr, nSize);
796 void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override
798 GetImpl()->copyBits(rPosAry, pSrcGraphics);
801 void copyArea (tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX,
802 tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight,
803 bool bWindowInvalidate) override
805 GetImpl()->copyArea(nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, bWindowInvalidate);
808 void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap) override
810 GetImpl()->drawBitmap(rPosAry, rSalBitmap);
813 void drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rMaskBitmap) override
815 GetImpl()->drawBitmap(rPosAry, rSalBitmap, rMaskBitmap);
818 void drawMask(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, Color nMaskColor) override
820 GetImpl()->drawMask(rPosAry, rSalBitmap, nMaskColor);
823 std::shared_ptr<SalBitmap> getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
825 return GetImpl()->getBitmap(nX, nY, nWidth, nHeight);
828 Color getPixel(tools::Long nX, tools::Long nY) override
830 return GetImpl()->getPixel(nX, nY);
833 bool blendBitmap(const SalTwoRect& rPosAry, const SalBitmap& rBitmap) override
835 return GetImpl()->blendBitmap(rPosAry, rBitmap);
838 bool blendAlphaBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSourceBitmap,
839 const SalBitmap& rMaskBitmap, const SalBitmap& rAlphaBitmap) override
841 return GetImpl()->blendAlphaBitmap(rPosAry, rSourceBitmap, rMaskBitmap, rAlphaBitmap);
844 bool drawAlphaBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSourceBitmap,
845 const SalBitmap& rAlphaBitmap) override
847 return GetImpl()->drawAlphaBitmap(rPosAry, rSourceBitmap, rAlphaBitmap);
850 bool drawTransformedBitmap(const basegfx::B2DPoint& rNull,
851 const basegfx::B2DPoint& rX,
852 const basegfx::B2DPoint& rY,
853 const SalBitmap& rSourceBitmap,
854 const SalBitmap* pAlphaBitmap, double fAlpha) override
856 return GetImpl()->drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap, fAlpha);
859 bool hasFastDrawTransformedBitmap() const override
861 return GetImpl()->hasFastDrawTransformedBitmap();
864 bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth,
865 tools::Long nHeight, sal_uInt8 nTransparency) override
867 return GetImpl()->drawAlphaRect(nX, nY, nWidth, nHeight, nTransparency);
870 bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) override
872 return GetImpl()->drawGradient(rPolygon, rGradient);
875 bool implDrawGradient(basegfx::B2DPolyPolygon const& rPolyPolygon,
876 SalGradient const& rGradient) override
878 return GetImpl()->implDrawGradient(rPolyPolygon, rGradient);
881 bool supportsOperation(OutDevSupportType eType) const override
883 return GetImpl()->supportsOperation(eType);
886 OUString getRenderBackendName() const override
888 return GetImpl()->getRenderBackendName();
892 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */