LibreOffice Module vcl (master)  1
salgdilayout.cxx
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 #include <memory>
21 #include <config_features.h>
22 #include <sal/log.hxx>
23 #if HAVE_FEATURE_OPENGL
24 #include <opengl/gdiimpl.hxx>
25 #include <opengl/zone.hxx>
26 #include <desktop/exithelper.h>
27 #ifdef _WIN32
28 #include <svsys.h>
29 #endif
30 #endif
31 #include <salgdi.hxx>
32 #include <salframe.hxx>
36 
37 // The only common SalFrame method
38 
40 {
41  // mirror frame coordinates at parent
42  SalFrame *pParent = GetParent();
43  if( pParent && AllSettings::GetLayoutRTL() )
44  {
46  int parent_x = aGeom.nX - pParent->maGeometry.nX;
47  aGeom.nX = pParent->maGeometry.nX + pParent->maGeometry.nWidth - maGeometry.nWidth - parent_x;
48  return aGeom;
49  }
50  else
51  return maGeometry;
52 }
53 
55 : m_nLayout( SalLayoutFlags::NONE ),
56  m_aLastMirror(),
57  m_aLastMirrorW(0),
58  m_bAntiAliasB2DDraw(false)
59 {
60  // read global RTL settings
63 }
64 
66 {
67  bool bFileDefinitionsWidgetDraw = !!getenv("VCL_DRAW_WIDGETS_FROM_FILE");
68 
69  if (bFileDefinitionsWidgetDraw || bForce)
70  {
72  auto pFileDefinitionWidgetDraw = static_cast<vcl::FileDefinitionWidgetDraw*>(m_pWidgetDraw.get());
73  if (!pFileDefinitionWidgetDraw->isActive())
74  {
75  m_pWidgetDraw.reset();
76  return false;
77  }
78  return true;
79  }
80  return false;
81 }
82 
83 SalGraphics::~SalGraphics() COVERITY_NOEXCEPT_FALSE
84 {
85  // can't call ReleaseFonts here, as the destructor just calls this classes SetFont (pure virtual)!
86 }
87 
88 #if HAVE_FEATURE_OPENGL
89 
90 namespace
91 {
92  void disableOpenGLAndTerminateForRestart()
93  {
95 #ifdef _WIN32
96  TerminateProcess(GetCurrentProcess(), EXITHELPER_NORMAL_RESTART);
97 #endif
98  }
99 }
100 
102 {
103  OpenGLSalGraphicsImpl *pImpl = dynamic_cast<OpenGLSalGraphicsImpl*>(GetImpl());
104  if (pImpl)
105  {
106  // If we notice that OpenGL is broken the first time being called, it is not too late to call
107  // disableOpenGLAndTerminateForRestart(). The first time this will be called is from displaying
108  // the splash screen, so if OpenGL is broken, it is "early enough" for us to be able to disable
109  // OpenGL and terminate bluntly with EXITHELPER_NORMAL_RESTART, thus causing the wrapper process
110  // to restart us, then without using OpenGL.
111  static bool bFirstCall = true;
113  if (!xRet.is() && bFirstCall)
114  disableOpenGLAndTerminateForRestart();
115  bFirstCall = false;
116  return xRet;
117  }
118  return nullptr;
119 }
120 
121 #endif
122 
124  const basegfx::B2DPoint& /* rNull */,
125  const basegfx::B2DPoint& /* rX */,
126  const basegfx::B2DPoint& /* rY */,
127  const SalBitmap& /* rSourceBitmap */,
128  const SalBitmap* /* pAlphaBitmap */)
129 {
130  // here direct support for transformed bitmaps can be implemented
131  return false;
132 }
133 
134 long SalGraphics::mirror2( long x, const OutputDevice *pOutDev ) const
135 {
136  mirror(x, pOutDev);
137  return x;
138 }
139 
140 inline long SalGraphics::GetDeviceWidth(const OutputDevice* pOutDev) const
141 {
142  return (pOutDev && pOutDev->IsVirtual())
143  ? pOutDev->GetOutputWidthPixel() : GetGraphicsWidth();
144 }
145 
146 void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const
147 {
148  const long w = GetDeviceWidth(pOutDev);
149  if( w )
150  {
151  if( pOutDev && pOutDev->ImplIsAntiparallel() )
152  {
153  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
154  // mirror this window back
156  {
157  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
158  x = devX + (x - pOutDevRef->GetOutOffXPixel());
159  }
160  else
161  {
162  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
163  x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1;
164  }
165  }
167  x = w-1-x;
168  }
169 }
170 
171 void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const
172 {
173  const long w = GetDeviceWidth(pOutDev);
174  if( w )
175  {
176  if( pOutDev && pOutDev->ImplIsAntiparallel() )
177  {
178  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
179  // mirror this window back
181  {
182  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
183  if( bBack )
184  x = x - devX + pOutDevRef->GetOutOffXPixel();
185  else
186  x = devX + (x - pOutDevRef->GetOutOffXPixel());
187  }
188  else
189  {
190  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
191  if( bBack )
192  x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth);
193  else
194  x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth;
195  }
196  }
198  x = w-nWidth-x;
199  }
200 }
201 
202 bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const
203 {
204  const long w = GetDeviceWidth(pOutDev);
205  if( w )
206  {
207  sal_uInt32 i, j;
208 
209  if( pOutDev && pOutDev->ImplIsAntiparallel() )
210  {
211  OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev);
212  // mirror this window back
214  {
215  long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
216  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
217  {
218  pPtAry2[j].mnX = devX + (pPtAry[i].mnX - pOutDevRef->GetOutOffXPixel());
219  pPtAry2[j].mnY = pPtAry[i].mnY;
220  }
221  }
222  else
223  {
224  long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX
225  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
226  {
227  pPtAry2[j].mnX = pOutDevRef->GetOutputWidthPixel() - (pPtAry[i].mnX - devX) + pOutDevRef->GetOutOffXPixel() - 1;
228  pPtAry2[j].mnY = pPtAry[i].mnY;
229  }
230  }
231  }
233  {
234  for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
235  {
236  pPtAry2[j].mnX = w-1-pPtAry[i].mnX;
237  pPtAry2[j].mnY = pPtAry[i].mnY;
238  }
239  }
240  return true;
241  }
242  else
243  return false;
244 }
245 
246 void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
247 {
248  if( rRgn.HasPolyPolygonOrB2DPolyPolygon() )
249  {
250  const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev));
251 
252  rRgn = vcl::Region(aPolyPoly);
253  }
254  else
255  {
256  RectangleVector aRectangles;
257  rRgn.GetRegionRectangles(aRectangles);
258  rRgn.SetEmpty();
259 
260  for (auto & rectangle : aRectangles)
261  {
262  mirror(rectangle, pOutDev);
263  rRgn.Union(rectangle);
264  }
265 
266  //ImplRegionInfo aInfo;
267  //bool bRegionRect;
268  //Region aMirroredRegion;
269  //long nX, nY, nWidth, nHeight;
270 
271  //bRegionRect = rRgn.ImplGetFirstRect( aInfo, nX, nY, nWidth, nHeight );
272  //while ( bRegionRect )
273  //{
274  // Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
275  // mirror( aRect, pOutDev, bBack );
276  // aMirroredRegion.Union( aRect );
277  // bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
278  //}
279  //rRgn = aMirroredRegion;
280  }
281 }
282 
283 void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
284 {
285  long nWidth = rRect.GetWidth();
286  long x = rRect.Left();
287  long x_org = x;
288 
289  mirror( x, nWidth, pOutDev, bBack );
290  rRect.Move( x - x_org, 0 );
291 }
292 
293 basegfx::B2DPoint SalGraphics::mirror( const basegfx::B2DPoint& i_rPoint, const OutputDevice* i_pOutDev ) const
294 {
295  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
296 
297  if(rMirror.isIdentity())
298  {
299  return i_rPoint;
300  }
301  else
302  {
303  return rMirror * i_rPoint;
304  }
305 }
306 
308 {
309  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
310 
311  if(rMirror.isIdentity())
312  {
313  return i_rPoly;
314  }
315  else
316  {
317  basegfx::B2DPolyPolygon aRet(i_rPoly);
318  aRet.transform(rMirror);
319  aRet.flip();
320  return aRet;
321  }
322 }
323 
325 {
326  // get mirroring transformation
327  const long w = GetDeviceWidth(i_pOutDev);
328  SAL_WARN_IF( !w, "vcl", "missing graphics width" );
329 
330  if(w != m_aLastMirrorW)
331  {
332  const_cast<SalGraphics*>(this)->m_aLastMirrorW = w;
333 
334  if(w)
335  {
336  if(nullptr != i_pOutDev && !i_pOutDev->IsRTLEnabled())
337  {
338  // Original code was (removed here already pOutDevRef->i_pOutDev):
339  // // mirror this window back
340  // double devX = w-i_pOutDev->GetOutputWidthPixel()-i_pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
341  // aRet.setX( devX + (i_rPoint.getX() - i_pOutDev->GetOutOffXPixel()) );
342  // I do not really understand the comment 'mirror this window back', so cannot guarantee
343  // that this works as before, but I have reduced this (by re-placing and re-formatting) to
344  // a simple translation:
346  w - i_pOutDev->GetOutputWidthPixel() - (2 * i_pOutDev->GetOutOffXPixel()),
347  0.0);
348  }
349  else
350  {
351  // Original code was:
352  // aRet.setX( w-1-i_rPoint.getX() );
353  // -mirror X -> scale(-1.0, 1.0)
354  // -translate X -> translate(w-1, 0); but already mirrored, so use translate(1-w, 0)
355  // Checked this one, works as expected.
357  -1.0,
358  1.0,
359  1-w,
360  0.0);
361  }
362  }
363  else
364  {
365  const_cast<SalGraphics*>(this)->m_aLastMirror.identity();
366  }
367  }
368 
369  return m_aLastMirror;
370 }
371 
373 {
374  // add mirroring transformation to i_rMatrix
375  const basegfx::B2DHomMatrix& rMirror(getMirror(pOutDev));
376 
377  // Apply mirror to given matrix by multiply from left ('after' i_rMatrix).
378  // Identity checks and fast-paths are in the operator
379  return rMirror * i_rMatrix;
380 }
381 
382 bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice *pOutDev )
383 {
384  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
385  {
386  vcl::Region aMirror( i_rClip );
387  mirror( aMirror, pOutDev );
388  return setClipRegion( aMirror );
389  }
390  return setClipRegion( i_rClip );
391 }
392 
393 void SalGraphics::DrawPixel( long nX, long nY, const OutputDevice *pOutDev )
394 {
395  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
396  mirror( nX, pOutDev );
397  drawPixel( nX, nY );
398 }
399 
400 void SalGraphics::DrawPixel( long nX, long nY, Color nColor, const OutputDevice *pOutDev )
401 {
402  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
403  mirror( nX, pOutDev );
404  drawPixel( nX, nY, nColor );
405 }
406 
407 void SalGraphics::DrawLine( long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev )
408 {
409  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
410  {
411  mirror( nX1, pOutDev );
412  mirror( nX2, pOutDev );
413  }
414  drawLine( nX1, nY1, nX2, nY2 );
415 }
416 
417 void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
418 {
419  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
420  mirror( nX, nWidth, pOutDev );
421  drawRect( nX, nY, nWidth, nHeight );
422 }
423 
424 void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, SalPoint const * pPtAry, const OutputDevice *pOutDev )
425 {
426  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
427  {
428  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
429  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
430  drawPolyLine( nPoints, bCopied ? pPtAry2.get() : pPtAry );
431  }
432  else
433  drawPolyLine( nPoints, pPtAry );
434 }
435 
436 void SalGraphics::DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
437 {
438  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
439  {
440  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
441  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
442  drawPolygon( nPoints, bCopied ? pPtAry2.get() : pPtAry );
443  }
444  else
445  drawPolygon( nPoints, pPtAry );
446 }
447 
448 void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry, const OutputDevice *pOutDev )
449 {
450  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
451  {
452  // TODO: optimize, reduce new/delete calls
453  std::unique_ptr<SalPoint*[]> pPtAry2( new SalPoint*[nPoly] );
454  sal_uLong i;
455  for(i=0; i<nPoly; i++)
456  {
457  sal_uLong nPoints = pPoints[i];
458  pPtAry2[i] = new SalPoint[ nPoints ];
459  mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
460  }
461 
462  drawPolyPolygon( nPoly, pPoints, const_cast<PCONSTSALPOINT*>(pPtAry2.get()) );
463 
464  for(i=0; i<nPoly; i++)
465  delete [] pPtAry2[i];
466  }
467  else
468  drawPolyPolygon( nPoly, pPoints, pPtAry );
469 }
470 
472  const basegfx::B2DHomMatrix& rObjectToDevice,
473  const basegfx::B2DPolyPolygon& i_rPolyPolygon,
474  double i_fTransparency,
475  const OutputDevice* i_pOutDev)
476 {
477  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
478  {
479  // mirroring set
480  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
481 
482  if(!rMirror.isIdentity())
483  {
484  if(rObjectToDevice.isIdentity())
485  {
486  // There is no ObjectToDevice transformation set. We can just
487  // use rMirror, that would be the result of the linear combination
488  return drawPolyPolygon(
489  rMirror,
490  i_rPolyPolygon,
491  i_fTransparency);
492  }
493  else
494  {
495  // Create the linear combination
496  basegfx::B2DHomMatrix aLinearCombination(rObjectToDevice);
497  basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
498 
499  aLinearCombination = rMirror * aLinearCombination;
500  aObjectToDeviceInv.invert();
501  aLinearCombination = aObjectToDeviceInv * aLinearCombination;
502 
503  return drawPolyPolygon(
504  aLinearCombination,
505  i_rPolyPolygon,
506  i_fTransparency);
507  }
508  }
509  }
510 
511  return drawPolyPolygon(
512  rObjectToDevice,
513  i_rPolyPolygon,
514  i_fTransparency);
515 }
516 
517 bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
518 {
519  bool bResult = false;
520  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
521  {
522  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
523  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
524  bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
525  }
526  else
527  bResult = drawPolyLineBezier( nPoints, pPtAry, pFlgAry );
528  return bResult;
529 }
530 
531 bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
532 {
533  bool bResult = false;
534  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
535  {
536  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
537  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
538  bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
539  }
540  else
541  bResult = drawPolygonBezier( nPoints, pPtAry, pFlgAry );
542  return bResult;
543 }
544 
545 bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
546  const SalPoint* const* i_pPtAry, const PolyFlags* const* i_pFlgAry, const OutputDevice* i_pOutDev )
547 {
548  bool bRet = false;
549  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
550  {
551  // TODO: optimize, reduce new/delete calls
552  std::unique_ptr<SalPoint*[]> pPtAry2( new SalPoint*[i_nPoly] );
553  sal_uLong i;
554  for(i=0; i<i_nPoly; i++)
555  {
556  sal_uLong nPoints = i_pPoints[i];
557  pPtAry2[i] = new SalPoint[ nPoints ];
558  mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
559  }
560 
561  bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, const_cast<PCONSTSALPOINT const *>(pPtAry2.get()), i_pFlgAry );
562 
563  for(i=0; i<i_nPoly; i++)
564  delete [] pPtAry2[i];
565  }
566  else
567  bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, i_pPtAry, i_pFlgAry );
568  return bRet;
569 }
570 
572  const basegfx::B2DHomMatrix& rObjectToDevice,
573  const basegfx::B2DPolygon& i_rPolygon,
574  double i_fTransparency,
575  const basegfx::B2DVector& i_rLineWidth,
576  const std::vector< double >* i_pStroke, // MM01
577  basegfx::B2DLineJoin i_eLineJoin,
578  css::drawing::LineCap i_eLineCap,
579  double i_fMiterMinimumAngle,
580  bool bPixelSnapHairline,
581  const OutputDevice* i_pOutDev)
582 {
583  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
584  {
585  // mirroring set
586  const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
587 
588  if(!rMirror.isIdentity())
589  {
590  // If we really have a mirroring to apply, we *could*
591  // use the ::mirror call to modify the B2DPolygon (and
592  // prepare the LineWidth scaling), but we also
593  // can add that mirroring to rObjectToDevice transformation
594  // by using linear combination of transformations and stay
595  // on having the transformation
596  if(rObjectToDevice.isIdentity())
597  {
598  // There is no ObjectToDevice transformation set. We can just
599  // use rMirror, that would be the result of the linear combination
600  return drawPolyLine(
601  rMirror,
602  i_rPolygon,
603  i_fTransparency,
604  i_rLineWidth,
605  i_pStroke, // MM01
606  i_eLineJoin,
607  i_eLineCap,
608  i_fMiterMinimumAngle,
609  bPixelSnapHairline);
610  }
611  else
612  {
613  // To create the linear combination, we need to
614  // - multiply with rObjectToDevice to get to device-coordinates
615  // (what is a simple copy)
616  // - apply rMirror (multiply from left)
617  // - multiply with inverse of rObjectToDevice to get back from
618  // device-coordinates to object-coordinates
619  // this only makes sense to do when we *have* an ObjectToDevice
620  // transformation, so optimize that
621  basegfx::B2DHomMatrix aLinearCombination(rObjectToDevice);
622  basegfx::B2DHomMatrix aObjectToDeviceInv(rObjectToDevice);
623 
624  aLinearCombination = rMirror * aLinearCombination;
625  aObjectToDeviceInv.invert();
626  aLinearCombination = aObjectToDeviceInv * aLinearCombination;
627 
628  return drawPolyLine(
629  aLinearCombination,
630  i_rPolygon,
631  i_fTransparency,
632  i_rLineWidth,
633  i_pStroke, // MM01
634  i_eLineJoin,
635  i_eLineCap,
636  i_fMiterMinimumAngle,
637  bPixelSnapHairline);
638  }
639  }
640  }
641 
642  // no mirroring set (or identity), use standard call
643  return drawPolyLine(
644  rObjectToDevice,
645  i_rPolygon,
646  i_fTransparency,
647  i_rLineWidth,
648  i_pStroke, // MM01
649  i_eLineJoin,
650  i_eLineCap,
651  i_fMiterMinimumAngle,
652  bPixelSnapHairline);
653 }
654 
655 bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient )
656 {
657  return drawGradient( rPolyPoly, rGradient );
658 }
659 
660 bool SalGraphics::DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rSalGradient)
661 {
662  return implDrawGradient(rPolyPolygon, rSalGradient);
663 }
664 
665 void SalGraphics::CopyArea( long nDestX, long nDestY,
666  long nSrcX, long nSrcY,
667  long nSrcWidth, long nSrcHeight,
668  const OutputDevice *pOutDev )
669 {
670  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
671  {
672  mirror( nDestX, nSrcWidth, pOutDev );
673  mirror( nSrcX, nSrcWidth, pOutDev );
674  }
675  copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, true/*bWindowInvalidate*/ );
676 }
677 
678 void SalGraphics::CopyBits( const SalTwoRect& rPosAry,
679  SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
680 {
681  if( ( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
682  (pSrcGraphics && ( (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) )
683  {
684  SalTwoRect aPosAry2 = rPosAry;
685  if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) )
686  mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcOutDev );
687  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
688  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
689  copyBits( aPosAry2, pSrcGraphics );
690  }
691  else
692  copyBits( rPosAry, pSrcGraphics );
693 }
694 
695 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
696  const SalBitmap& rSalBitmap, const OutputDevice *pOutDev )
697 {
698  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
699  {
700  SalTwoRect aPosAry2 = rPosAry;
701  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
702  drawBitmap( aPosAry2, rSalBitmap );
703  }
704  else
705  drawBitmap( rPosAry, rSalBitmap );
706 }
707 
708 void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
709  const SalBitmap& rSalBitmap,
710  const SalBitmap& rTransparentBitmap, const OutputDevice *pOutDev )
711 {
712  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
713  {
714  SalTwoRect aPosAry2 = rPosAry;
715  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
716  drawBitmap( aPosAry2, rSalBitmap, rTransparentBitmap );
717  }
718  else
719  drawBitmap( rPosAry, rSalBitmap, rTransparentBitmap );
720 }
721 
722 void SalGraphics::DrawMask( const SalTwoRect& rPosAry,
723  const SalBitmap& rSalBitmap,
724  Color nMaskColor, const OutputDevice *pOutDev )
725 {
726  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
727  {
728  SalTwoRect aPosAry2 = rPosAry;
729  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
730  drawMask( aPosAry2, rSalBitmap, nMaskColor );
731  }
732  else
733  drawMask( rPosAry, rSalBitmap, nMaskColor );
734 }
735 
736 std::shared_ptr<SalBitmap> SalGraphics::GetBitmap( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev )
737 {
738  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
739  mirror( nX, nWidth, pOutDev );
740  return getBitmap( nX, nY, nWidth, nHeight );
741 }
742 
743 Color SalGraphics::GetPixel( long nX, long nY, const OutputDevice *pOutDev )
744 {
745  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
746  mirror( nX, pOutDev );
747  return getPixel( nX, nY );
748 }
749 
750 void SalGraphics::Invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
751 {
752  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
753  mirror( nX, nWidth, pOutDev );
754  invert( nX, nY, nWidth, nHeight, nFlags );
755 }
756 
757 void SalGraphics::Invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
758 {
759  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
760  {
761  std::unique_ptr<SalPoint[]> pPtAry2(new SalPoint[nPoints]);
762  bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
763  invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags );
764  }
765  else
766  invert( nPoints, pPtAry, nFlags );
767 }
768 
769 bool SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev )
770 {
771  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
772  mirror( nX, nWidth, pOutDev );
773  return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
774 }
775 
777  const Point& aPos, bool& rIsInside, const OutputDevice *pOutDev )
778 {
779  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
780  {
781  Point pt( aPos );
782  tools::Rectangle rgn( rControlRegion );
783  pt.setX( mirror2( pt.X(), pOutDev ) );
784  mirror( rgn, pOutDev );
785  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rgn, pt, rIsInside );
786  }
787  else
788  return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rControlRegion, aPos, rIsInside );
789 }
790 
791 void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const
792 {
793  switch( rVal.getType() )
794  {
795  case ControlType::Slider:
796  {
797  SliderValue* pSlVal = static_cast<SliderValue*>(&rVal);
798  mirror(pSlVal->maThumbRect,pOutDev);
799  }
800  break;
802  {
803  ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal);
804  mirror(pScVal->maThumbRect,pOutDev);
805  mirror(pScVal->maButton1Rect,pOutDev);
806  mirror(pScVal->maButton2Rect,pOutDev);
807  }
808  break;
811  {
812  SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal);
813  mirror(pSpVal->maUpperRect,pOutDev);
814  mirror(pSpVal->maLowerRect,pOutDev);
815  }
816  break;
818  {
819  ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal);
820  mirror(pTVal->maGripRect,pOutDev);
821  }
822  break;
823  default: break;
824  }
825 }
826 
827 bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
828  ControlState nState, const ImplControlValue& aValue,
829  const OUString& aCaption, const OutputDevice *pOutDev)
830 {
831  bool bRet = false;
832  tools::Rectangle aControlRegion(rControlRegion);
833  if (aControlRegion.IsEmpty())
834  return bRet;
835 
836  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
837  {
838  mirror(aControlRegion, pOutDev);
839  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
840  mirror( *mirrorValue, pOutDev );
841  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, *mirrorValue, aCaption);
842  }
843  else
844  bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, aValue, aCaption);
845 
846  if (bRet && m_pWidgetDraw)
847  handleDamage(aControlRegion);
848  return bRet;
849 }
850 
852  const ImplControlValue& aValue,
853  tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
854 {
855  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
856  {
857  tools::Rectangle rgn( rControlRegion );
858  mirror( rgn, pOutDev );
859  std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
860  mirror( *mirrorValue, pOutDev );
861  if (forWidget()->getNativeControlRegion(nType, nPart, rgn, nState, *mirrorValue, OUString(), rNativeBoundingRegion, rNativeContentRegion))
862  {
863  mirror( rNativeBoundingRegion, pOutDev, true );
864  mirror( rNativeContentRegion, pOutDev, true );
865  return true;
866  }
867  return false;
868  }
869  else
870  return forWidget()->getNativeControlRegion(nType, nPart, rControlRegion, nState, aValue, OUString(), rNativeBoundingRegion, rNativeContentRegion);
871 }
872 
874  const SalBitmap& rBitmap,
875  const OutputDevice *pOutDev )
876 {
877  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
878  {
879  SalTwoRect aPosAry2 = rPosAry;
880  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
881  return blendBitmap( aPosAry2, rBitmap );
882  }
883  else
884  return blendBitmap( rPosAry, rBitmap );
885 }
886 
888  const SalBitmap& rSrcBitmap,
889  const SalBitmap& rMaskBitmap,
890  const SalBitmap& rAlphaBitmap,
891  const OutputDevice *pOutDev )
892 {
893  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
894  {
895  SalTwoRect aPosAry2 = rPosAry;
896  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
897  return blendAlphaBitmap( aPosAry2, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
898  }
899  else
900  return blendAlphaBitmap( rPosAry, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
901 }
902 
904  const SalBitmap& rSourceBitmap,
905  const SalBitmap& rAlphaBitmap,
906  const OutputDevice *pOutDev )
907 {
908  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
909  {
910  SalTwoRect aPosAry2 = rPosAry;
911  mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
912  return drawAlphaBitmap( aPosAry2, rSourceBitmap, rAlphaBitmap );
913  }
914  else
915  return drawAlphaBitmap( rPosAry, rSourceBitmap, rAlphaBitmap );
916 }
917 
919  const basegfx::B2DPoint& rNull,
920  const basegfx::B2DPoint& rX,
921  const basegfx::B2DPoint& rY,
922  const SalBitmap& rSourceBitmap,
923  const SalBitmap* pAlphaBitmap,
924  const OutputDevice* pOutDev)
925 {
926  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
927  {
928  mirror(rNull, pOutDev);
929  mirror(rX, pOutDev);
930  mirror(rY, pOutDev);
931 
932  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
933  }
934  else
935  {
936  return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
937  }
938 }
939 
940 bool SalGraphics::DrawAlphaRect( long nX, long nY, long nWidth, long nHeight,
941  sal_uInt8 nTransparency, const OutputDevice *pOutDev )
942 {
943  if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
944  mirror( nX, nWidth, pOutDev );
945 
946  return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
947 }
948 
950 {
951  if (GetImpl())
952  return GetImpl()->getRenderBackendName();
953  return OUString();
954 }
955 
956 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SalFrame * GetParent() const =0
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
Render bitmap with alpha channel.
long mnSrcWidth
Definition: salgtype.hxx:52
virtual long GetGraphicsWidth() const =0
virtual OUString getRenderBackendName() const
long GetWidth() const
unsigned long nWidth
Definition: salgeom.hxx:31
bool DrawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap, const OutputDevice *pOutDev)
virtual bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap)=0
draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system ...
void mirror(long &nX, const OutputDevice *pOutDev) const
rtl::Reference< OpenGLContext > GetOpenGLContext() const
Check that our mpImpl is OpenGL and return the context, otherwise NULL.
virtual bool IsVirtual() const
Definition: outdev.cxx:183
virtual bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap)=0
Draw the bitmap by blending using the mask and alpha channel.
void DrawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor, const OutputDevice *pOutDev)
SalFrameGeometry GetGeometry() const
ControlType getType() const
void Union(const tools::Rectangle &rRegion)
Definition: region.cxx:508
long GetDeviceWidth(const OutputDevice *pOutDev) const
long GetOutOffXPixel() const
Definition: outdev.hxx:445
sal_uIntPtr sal_uLong
virtual void copyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, bool bWindowInvalidate)=0
bool DrawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const SalPoint *const *pPtAry, const PolyFlags *const *pFlgAry, const OutputDevice *pOutDev)
virtual void invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags)=0
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const SalPoint *const *pPtAry, const PolyFlags *const *pFlgAry)=0
tools::Rectangle maButton2Rect
void CopyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev)
long mnDestWidth
Definition: salgtype.hxx:56
long m_aLastMirrorW
Definition: salgdi.hxx:600
long mnSrcX
Definition: salgtype.hxx:50
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap)=0
Blend the bitmap with the current buffer.
long mnY
Definition: salgtype.hxx:43
void DrawRect(long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev)
bool DrawEPS(long nX, long nY, long nWidth, long nHeight, void *pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev)
float x
tools::Rectangle maLowerRect
virtual void drawPolygon(sal_uInt32 nPoints, const SalPoint *pPtAry)=0
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry)=0
NONE
void Move(long nHorzMoveDelta, long nVertMoveDelta)
std::vector< tools::Rectangle > RectangleVector
Definition: region.hxx:37
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &, SalGradient const &)
Definition: salgdi.hxx:496
bool IsEmpty() const
tools::Rectangle maUpperRect
void setX(long nX)
bool initWidgetDrawBackends(bool bForce=false)
basegfx::B2DHomMatrix m_aLastMirror
Definition: salgdi.hxx:599
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
virtual bool hitTestNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, const Point &aPos, bool &rIsInside)
Query if a position is inside the native widget part.
void DrawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice *pOutDev)
bool DrawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)
void DrawPolyLine(sal_uInt32 nPoints, SalPoint const *pPtAry, const OutputDevice *pOutDev)
void DrawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry, const OutputDevice *pOutDev)
void DrawPolygon(sal_uInt32 nPoints, const SalPoint *pPtAry, const OutputDevice *pOutDev)
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
long mnX
Definition: salgtype.hxx:42
SalLayoutFlags m_nLayout
Definition: salgdi.hxx:596
virtual Color getPixel(long nX, long nY)=0
virtual bool setClipRegion(const vcl::Region &)=0
bool IsRTLEnabled() const
Definition: outdev.hxx:1361
bool BlendBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const OutputDevice *pOutDev)
static void hardDisable()
Called from a signal handler or watchdog thread if we get a crash or hang in some GL code...
virtual ImplControlValue * clone() const
void SetEmpty()
Definition: region.cxx:1417
tools::Rectangle maButton1Rect
bool DrawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, const OutputDevice *pOutDev)
bool BlendAlphaBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalSrcBitmap, const SalBitmap &rSalMaskBitmap, const SalBitmap &rSalAlphaBitmap, const OutputDevice *pOutDev)
virtual bool getNativeControlRegion(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaption, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion)
Get the native control regions for the control part.
int i
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
Definition: outdev.cxx:597
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
rtl::Reference< OpenGLContext > GetOpenGLContext()
static bool GetLayoutRTL()
void transform(const basegfx::B2DHomMatrix &rMatrix)
SalFrameGeometry maGeometry
absolute, unmirrored values
Definition: salframe.hxx:127
sal_Int32 w
std::unique_ptr< vcl::WidgetDrawInterface > m_pWidgetDraw
Definition: salgdi.hxx:621
virtual std::shared_ptr< SalBitmap > getBitmap(long nX, long nY, long nWidth, long nHeight)=0
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const OutputDevice *pOutDev)
SalInvert
Definition: salgtype.hxx:84
virtual OUString getRenderBackendName() const =0
bool isIdentity() const
bool SetClipRegion(const vcl::Region &, const OutputDevice *pOutDev)
virtual SalGraphicsImpl * GetImpl() const =0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
long X() const
tools::Rectangle maThumbRect
void DrawPixel(long nX, long nY, const OutputDevice *pOutDev)
virtual bool drawNativeControl(ControlType eType, ControlPart ePart, const tools::Rectangle &rBoundingControlRegion, ControlState eState, const ImplControlValue &aValue, const OUString &aCaptions)
Draw the requested control.
long GetOutputWidthPixel() const
Definition: outdev.hxx:443
vcl::WidgetDrawInterface * forWidget()
Definition: salgdi.hxx:622
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...
SalLayoutFlags
Definition: outdev.hxx:121
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void CopyArea(long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, const OutputDevice *pOutDev)
def rectangle(l)
virtual void drawRect(long nX, long nY, long nWidth, long nHeight)=0
bool HitTestNativeScrollbar(ControlPart nPart, const tools::Rectangle &rControlRegion, const Point &aPos, bool &rIsInside, const OutputDevice *pOutDev)
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry)=0
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, PCONSTSALPOINT *pPtAry)=0
void Invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags, const OutputDevice *pOutDev)
const basegfx::B2DHomMatrix & getMirror(const OutputDevice *pOutDev) const
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
SalLayoutFlags GetLayout() const
Definition: salgdi.hxx:200
long mnDestX
Definition: salgtype.hxx:54
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev)
Color GetPixel(long nX, long nY, const OutputDevice *pOutDev)
void GetRegionRectangles(RectangleVector &rTarget) const
Definition: region.cxx:1659
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
virtual void drawLine(long nX1, long nY1, long nX2, long nY2)=0
bool HasPolyPolygonOrB2DPolyPolygon() const
Definition: region.hxx:110
~SalGraphics() COVERITY_NOEXCEPT_FALSE override
long Left() const
virtual void drawPixel(long nX, long nY)=0
virtual void drawPolyLine(sal_uInt32 nPoints, const SalPoint *pPtAry)=0
basegfx::B2DPolyPolygon GetAsB2DPolyPolygon() const
Definition: region.cxx:1289
long mirror2(long nX, const OutputDevice *pOutDev) const
tools::Rectangle maGripRect
virtual bool drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)=0
Render solid rectangle with given transparency.
void DrawLine(long nX1, long nY1, long nX2, long nY2, const OutputDevice *pOutDev)
std::shared_ptr< SalBitmap > GetBitmap(long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
bool DrawPolyLineBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry, const OutputDevice *pOutDev)
virtual bool drawEPS(long nX, long nY, long nWidth, long nHeight, void *pPtr, sal_uInt32 nSize)=0
virtual bool drawGradient(const tools::PolyPolygon &rPolyPoly, const Gradient &rGradient)=0
tools::Rectangle maThumbRect
virtual void handleDamage(const tools::Rectangle &rDamagedRegion)
Handle damage done by drawing with a widget draw override.
Definition: salgdi.hxx:635
bool DrawPolygonBezier(sal_uInt32 nPoints, const SalPoint *pPtAry, const PolyFlags *pFlgAry, const OutputDevice *pOutDev)
PolyFlags
bool DrawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency, const OutputDevice *pOutDev)