1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <rtl/bootstrap.hxx>
23 #include <comphelper/processfactory.hxx>
24 #include <cppuhelper/servicefactory.hxx>
25 #include <cppuhelper/bootstrap.hxx>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/lang/XInitialization.hpp>
28 #include <com/sun/star/registry/XSimpleRegistry.hpp>
30 #include <vcl/svapp.hxx>
31 #include <vcl/dialog.hxx>
32 #include <vcl/outdev.hxx>
33 #include <vcl/virdev.hxx>
34 #include <vcl/hatch.hxx>
35 #include <vcl/bitmap.hxx>
36 #include <vcl/wall.hxx>
37 #include <vcl/image.hxx>
38 #include <vcl/gdimtf.hxx>
39 #include <vcl/metaact.hxx>
40 #include <vcl/bitmapex.hxx>
41 #include <vcl/gradient.hxx>
42 #include <vcl/lineinfo.hxx>
43 #include <tools/string.hxx>
47 #include <boost/function.hpp>
48 #include <boost/bind.hpp>
53 using namespace ::com::sun::star
;
59 class GrindApp
: public Application
63 virtual sal_uInt16
Exception( sal_uInt16 nError
);
66 class TestWindow
: public Dialog
69 TestWindow() : Dialog( (Window
*) NULL
)
71 SetText( OUString("OutDev grinding") );
72 SetSizePixel( Size( 1024, 1024 ) );
77 virtual ~TestWindow() {}
78 virtual void Paint( const Rectangle
& rRect
);
81 typedef boost::function1
<void, OutputDevice
*> functor_type
;
82 typedef std::vector
< std::pair
<const char*,
83 functor_type
> > functor_vector_type
;
85 template< typename Functor
> void add( functor_vector_type
& res
,
89 res
.push_back( std::make_pair(pStr
,functor_type(func
)) );
92 void setupMethodStubs( functor_vector_type
& res
)
94 const Color
aWhiteColor( COL_WHITE
);
95 const Color
aBlackColor( COL_BLACK
);
97 const Point
aPt1(10,10);
98 const Point
aPt2(500,500);
99 const Point
aPt3(0,0);
100 const Point
aPt4(450,450);
102 const Rectangle
aRect(aPt1
,aPt2
);
103 const Rectangle
aRect2(aPt3
,aPt4
);
104 const Polygon
aPoly(aRect
);
105 const Polygon
aPoly2(aRect2
);
106 PolyPolygon
aPolyPoly(aPoly
);
107 aPolyPoly
.Insert( aPoly2
);
108 Polygon
aPoly3(aPoly2
);
109 aPoly3
.Rotate( aPoly3
.GetBoundRect().Center(),
112 const String
aString("This is a test");
113 const LineInfo
aLineInfo(LINE_SOLID
,5);
115 // unfortunately, VDevs have inaccessible copy constructors
116 static VirtualDevice aVDev
;
117 static VirtualDevice
aVDevBW(1);
119 const Size aVDevSize
;
120 aVDev
.SetOutputSizePixel(aVDevSize
);
121 aVDevBW
.SetOutputSizePixel(aVDevSize
);
123 const Bitmap
aBitmap( aVDev
.GetBitmap(aPt1
,aVDevSize
) );
124 const Bitmap
aBitmapBW( aVDevBW
.GetBitmap(aPt1
,aVDevSize
) );
125 const Bitmap
aBitmapAlien( aVDevSize
, 8 );
127 const BitmapEx
aBitmapEx( aBitmap
, aBitmapBW
);
128 const BitmapEx
aBitmapExBW( aBitmapBW
, aBitmapBW
);
129 const BitmapEx
aBitmapExAlien( aBitmapAlien
, aBitmapBW
);
130 const BitmapEx
aBitmapExAlpha( aBitmap
, aBitmapAlien
);
131 const BitmapEx
aBitmapExAlphaAlien( aBitmapAlien
, aBitmapAlien
);
133 const Image
aImage( aBitmapEx
);
134 const Gradient
aGradient(GradientStyle_ELLIPTICAL
,aBlackColor
,aWhiteColor
);
135 const Hatch
aHatch(HatchStyle_TRIPLE
,aBlackColor
,4,450);
136 const Wallpaper
aWallpaper( aWhiteColor
);
139 aMtf
.AddAction( new MetaFillColorAction(Color(COL_RED
),sal_True
) );
140 aMtf
.AddAction( new MetaRectAction(aRect
) );
142 /* void DrawTextArray( const Point& rStartPt, const XubString& rStr,
143 const sal_Int32* pDXAry = NULL,
144 xub_StrLen nIndex = 0,
145 xub_StrLen nLen = STRING_LEN );
150 &OutputDevice::DrawTextArray
,
152 aPt1
, aString
, (const sal_Int32
*)0, (sal_uInt16
)0, aString
.Len() ));
154 /* void DrawPixel( const Point& rPt, const Color& rColor ); */
158 (void (OutputDevice::*)( const Point
&, const Color
& ))(
159 &OutputDevice::DrawPixel
),
161 aPt1
, aBlackColor
));
163 /* void DrawLine( const Point& rStartPt, const Point& rEndPt ); */
167 (void (OutputDevice::*)( const Point
&, const Point
& ))(
168 &OutputDevice::DrawLine
),
172 /* void DrawLine( const Point& rStartPt, const Point& rEndPt,
173 const LineInfo& rLineInfo );
176 "DrawLine(LineInfo)",
178 (void (OutputDevice::*)( const Point
&, const Point
&,const LineInfo
& ))(
179 &OutputDevice::DrawLine
),
181 aPt1
, aPt2
, aLineInfo
));
183 /* void DrawPolyLine( const Polygon& rPoly ); */
187 (void (OutputDevice::*)( const Polygon
& ))(
188 &OutputDevice::DrawPolyLine
),
192 /* void DrawPolyLine( const Polygon& rPoly,
193 const LineInfo& rLineInfo );
196 "DrawPolyLine(LineInfo)",
198 (void (OutputDevice::*)( const Polygon
&, const LineInfo
& ))(
199 &OutputDevice::DrawPolyLine
),
203 /* void DrawPolygon( const Polygon& rPoly ); */
207 (void (OutputDevice::*)( const Polygon
& ))
208 &OutputDevice::DrawPolygon
,
212 /* void DrawPolyPolygon( const PolyPolygon& rPolyPoly ); */
216 (void (OutputDevice::*)( const PolyPolygon
& ))
217 &OutputDevice::DrawPolyPolygon
,
221 /* void DrawRect( const Rectangle& rRect ); */
225 (void (OutputDevice::*)( const Rectangle
& ))(
226 &OutputDevice::DrawRect
),
230 /* void DrawRect( const Rectangle& rRect,
231 sal_uLong nHorzRount, sal_uLong nVertRound );
234 "DrawRect(round corners)",
236 (void (OutputDevice::*)( const Rectangle
&, sal_uLong nHorzRount
, sal_uLong nVertRound
))(
237 &OutputDevice::DrawRect
),
242 /* void DrawEllipse( const Rectangle& rRect ); */
246 &OutputDevice::DrawEllipse
,
250 /* void DrawArc( const Rectangle& rRect,
251 const Point& rStartPt, const Point& rEndPt );
256 &OutputDevice::DrawArc
,
260 /* void DrawPie( const Rectangle& rRect,
261 const Point& rStartPt, const Point& rEndPt );
266 &OutputDevice::DrawPie
,
270 /* void DrawChord( const Rectangle& rRect,
271 const Point& rStartPt, const Point& rEndPt );
276 &OutputDevice::DrawChord
,
280 /* void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
281 const Point& rSrcPt, const Size& rSrcSize );
286 (void (OutputDevice::*)( const Point
&, const Size
&,
287 const Point
&, const Size
& ))(
288 &OutputDevice::DrawOutDev
),
290 aRect2
.TopLeft(), aRect2
.GetSize(),
291 aRect
.TopLeft(), aRect
.GetSize()));
293 /* void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
294 const Point& rSrcPt, const Size& rSrcSize,
295 const OutputDevice& rOutDev );
298 "DrawOutDev(foreign source)",
300 (void (OutputDevice::*)( const Point
&, const Size
&,
301 const Point
&, const Size
&,
302 const OutputDevice
& ))(
303 &OutputDevice::DrawOutDev
),
305 aRect2
.TopLeft(), aRect2
.GetSize(),
306 aRect
.TopLeft(), aRect
.GetSize(),
307 boost::cref(aVDevBW
) ));
309 /* void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
310 const Point& rSrcPt, const Size& rSrcSize,
311 const OutputDevice& rOutDev );
314 "DrawOutDev(foreign source, scaled)",
316 (void (OutputDevice::*)( const Point
&, const Size
&,
317 const Point
&, const Size
&,
318 const OutputDevice
& ))(
319 &OutputDevice::DrawOutDev
),
321 aRect2
.TopLeft(), aRect2
.GetSize(),
322 aRect
.TopLeft(), aRect
.GetSize(),
323 boost::cref(aVDev
) ));
325 /* void CopyArea( const Point& rDestPt,
326 const Point& rSrcPt, const Size& rSrcSize,
327 sal_uInt16 nFlags = 0 );
332 &OutputDevice::CopyArea
,
334 aPt1
,aPt3
,aRect2
.GetSize(),(sal_uInt16
)0 ));
336 /* void DrawBitmap( const Point& rDestPt,
337 const Bitmap& rBitmap );
340 "DrawBitmap(alien source)",
342 (void (OutputDevice::*)( const Point
&,
344 &OutputDevice::DrawBitmap
),
346 aPt1
,aBitmapAlien
));
348 /* void DrawBitmap( const Point& rDestPt,
349 const Bitmap& rBitmap );
354 (void (OutputDevice::*)( const Point
&,
356 &OutputDevice::DrawBitmap
),
360 /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
361 const Bitmap& rBitmap );
364 "DrawBitmap(scaled,alien source)",
366 (void (OutputDevice::*)( const Point
&,
369 &OutputDevice::DrawBitmap
),
371 aPt1
,aRect
.GetSize(),aBitmapAlien
));
373 /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
374 const Bitmap& rBitmap );
377 "DrawBitmap(scaled)",
379 (void (OutputDevice::*)( const Point
&,
382 &OutputDevice::DrawBitmap
),
384 aPt1
,aRect
.GetSize(),aBitmap
));
386 /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
387 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
388 const Bitmap& rBitmap );
391 "DrawBitmap(scaled subset,alien source)",
393 (void (OutputDevice::*)( const Point
&,
398 &OutputDevice::DrawBitmap
),
400 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapAlien
));
402 /* void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
403 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
404 const Bitmap& rBitmap );
407 "DrawBitmap(scaled subset)",
409 (void (OutputDevice::*)( const Point
&,
414 &OutputDevice::DrawBitmap
),
416 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmap
));
418 /* void DrawBitmapEx( const Point& rDestPt,
419 const BitmapEx& rBitmapEx );
422 "DrawBitmapEx(alien source)",
424 (void (OutputDevice::*)( const Point
&,
426 &OutputDevice::DrawBitmapEx
),
428 aPt1
,aBitmapExAlien
));
430 /* void DrawBitmapEx( const Point& rDestPt,
431 const BitmapEx& rBitmapEx );
436 (void (OutputDevice::*)( const Point
&,
438 &OutputDevice::DrawBitmapEx
),
442 /* void DrawBitmapEx( const Point& rDestPt,
443 const BitmapEx& rBitmapEx );
446 "DrawBitmapEx(alpha)",
448 (void (OutputDevice::*)( const Point
&,
450 &OutputDevice::DrawBitmapEx
),
452 aPt1
,aBitmapExAlpha
));
454 /* void DrawBitmapEx( const Point& rDestPt,
455 const BitmapEx& rBitmapEx );
458 "DrawBitmapEx(alpha, alien source)",
460 (void (OutputDevice::*)( const Point
&,
462 &OutputDevice::DrawBitmapEx
),
464 aPt1
,aBitmapExAlphaAlien
));
466 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
467 const BitmapEx& rBitmapEx );
470 "DrawBitmapEx(scaled,alien source)",
472 (void (OutputDevice::*)( const Point
&,
475 &OutputDevice::DrawBitmapEx
),
477 aPt1
,aRect
.GetSize(),aBitmapExAlien
));
479 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
480 const BitmapEx& rBitmapEx );
483 "DrawBitmapEx(scaled)",
485 (void (OutputDevice::*)( const Point
&,
488 &OutputDevice::DrawBitmapEx
),
490 aPt1
,aRect
.GetSize(),aBitmapEx
));
492 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
493 const BitmapEx& rBitmapEx );
496 "DrawBitmapEx(scaled alpha)",
498 (void (OutputDevice::*)( const Point
&,
501 &OutputDevice::DrawBitmapEx
),
503 aPt1
,aRect
.GetSize(),aBitmapExAlpha
));
505 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
506 const BitmapEx& rBitmapEx );
509 "DrawBitmapEx(scaled alpha, alien source)",
511 (void (OutputDevice::*)( const Point
&,
514 &OutputDevice::DrawBitmapEx
),
516 aPt1
,aRect
.GetSize(),aBitmapExAlphaAlien
));
518 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
519 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
520 const BitmapEx& rBitmapEx );
523 "DrawBitmapEx(scaled subset,alien source)",
525 (void (OutputDevice::*)( const Point
&,
530 &OutputDevice::DrawBitmapEx
),
532 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapExAlien
));
534 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
535 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
536 const BitmapEx& rBitmapEx );
539 "DrawBitmapEx(scaled subset)",
541 (void (OutputDevice::*)( const Point
&,
546 &OutputDevice::DrawBitmapEx
),
548 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapEx
));
550 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
551 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
552 const BitmapEx& rBitmapEx );
555 "DrawBitmapEx(scaled subset, alpha)",
557 (void (OutputDevice::*)( const Point
&,
562 &OutputDevice::DrawBitmapEx
),
564 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapExAlpha
));
566 /* void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
567 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
568 const BitmapEx& rBitmapEx );
571 "DrawBitmapEx(scaled subset, alpha alien source)",
573 (void (OutputDevice::*)( const Point
&,
578 &OutputDevice::DrawBitmapEx
),
580 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapExAlphaAlien
));
582 /* void DrawMask( const Point& rDestPt,
583 const Bitmap& rBitmap, const Color& rMaskColor );
586 "DrawMask(alien source)",
588 (void (OutputDevice::*)( const Point
&,
591 &OutputDevice::DrawMask
),
593 aPt1
,aBitmapAlien
,aBlackColor
));
595 /* void DrawMask( const Point& rDestPt,
596 const Bitmap& rBitmap, const Color& rMaskColor );
601 (void (OutputDevice::*)( const Point
&,
604 &OutputDevice::DrawMask
),
606 aPt1
,aBitmap
,aBlackColor
));
608 /* void DrawMask( const Point& rDestPt, const Size& rDestSize,
609 const Bitmap& rBitmap, const Color& rMaskColor );
612 "DrawMask(scaled,alien source)",
614 (void (OutputDevice::*)( const Point
&,
618 &OutputDevice::DrawMask
),
620 aPt1
,aRect
.GetSize(),aBitmapAlien
, aBlackColor
));
622 /* void DrawMask( const Point& rDestPt, const Size& rDestSize,
623 const Bitmap& rBitmap, const Color& rMaskColor );
628 (void (OutputDevice::*)( const Point
&,
632 &OutputDevice::DrawMask
),
634 aPt1
,aRect
.GetSize(),aBitmap
,aBlackColor
));
636 /* void DrawMask( const Point& rDestPt, const Size& rDestSize,
637 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
638 const Bitmap& rBitmap, const Color& rMaskColor );
641 "DrawMask(scaled subset,alien source)",
643 (void (OutputDevice::*)( const Point
&,
649 &OutputDevice::DrawMask
),
651 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmapAlien
,aBlackColor
));
653 /* void DrawMask( const Point& rDestPt, const Size& rDestSize,
654 const Point& rSrcPtPixel, const Size& rSrcSizePixel,
655 const Bitmap& rBitmap, const Color& rMaskColor );
658 "DrawMask(scaled subset)",
660 (void (OutputDevice::*)( const Point
&,
666 &OutputDevice::DrawMask
),
668 aPt1
,aRect
.GetSize(),aPt3
,aRect2
.GetSize(),aBitmap
,aBlackColor
));
670 /* void DrawImage( const Point& rPos,
671 const Image& rImage, sal_uInt16 nStyle = 0 );
676 (void (OutputDevice::*)( const Point
&,
678 sal_uInt16 nStyle
))(
679 &OutputDevice::DrawImage
),
681 aPt1
,aImage
,(sal_uInt16
)0 ));
683 /* void DrawImage( const Point& rPos, const Size& rSize,
684 const Image& rImage, sal_uInt16 nStyle = 0 );
689 (void (OutputDevice::*)( const Point
&,
692 sal_uInt16 nStyle
))(
693 &OutputDevice::DrawImage
),
695 aPt1
,aRect
.GetSize(),aImage
,(sal_uInt16
)0 ));
697 /* void DrawGradient( const Rectangle& rRect, const Gradient& rGradient ); */
701 (void (OutputDevice::*)( const Rectangle
&, const Gradient
& ))(
702 &OutputDevice::DrawGradient
),
706 /* void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient ); */
708 "DrawGradient(polygon)",
710 (void (OutputDevice::*)( const PolyPolygon
&, const Gradient
& ))(
711 &OutputDevice::DrawGradient
),
715 /* void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch ); */
719 &OutputDevice::DrawHatch
,
723 /* void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper ); */
727 &OutputDevice::DrawWallpaper
,
729 aRect2
,aWallpaper
));
731 /* void DrawWaveLine( const Point& rStartPos, const Point& rEndPos, sal_uInt16 nStyle ); */
735 &OutputDevice::DrawWaveLine
,
737 aPt1
,aPt2
,(sal_uInt16
)WAVE_NORMAL
));
739 /* void DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags ); */
743 &OutputDevice::DrawGrid
,
745 aRect
,Size(10,20),GRID_HORZLINES
|GRID_VERTLINES
));
747 /* void DrawTransparent( const PolyPolygon& rPolyPoly,
748 sal_uInt16 nTransparencePercent );
753 (void (OutputDevice::*)( const PolyPolygon
&, sal_uInt16
))(
754 &OutputDevice::DrawTransparent
),
756 aPoly3
,(sal_uInt16
)50 ));
758 /* void DrawTransparent( const GDIMetaFile& rMtf,
759 const Point& rPos, const Size& rSize,
760 const Gradient& rTransparenceGradient );
763 "DrawTransparent(metafile)",
765 (void (OutputDevice::*)( const GDIMetaFile
&,
769 &OutputDevice::DrawTransparent
),
771 aMtf
,aPt1
,aRect
.GetSize(),aGradient
));
777 &OutputDevice::Erase
,
783 void grindFunc( OutputDevice
& rTarget
,
784 functor_vector_type::const_iterator iter
,
788 const sal_uInt32
nStartTime( osl_getGlobalTimer() );
790 for( sal_Int32 i
=0; i
<nTurns
; ++i
)
791 iter
->second(&rTarget
);
793 if( rTarget
.GetOutDevType() == OUTDEV_WINDOW
)
794 static_cast<Window
&>(rTarget
).Sync();
797 "Duration: %d ms (%d repetitions)\tOperation: %s\tSetup: %s\n",
798 (int)(osl_getGlobalTimer() - nStartTime
),
805 /** Call OutputDevice render methods repeatedly, and output elapsed
808 void outDevGrind( OutputDevice
& rTarget
, sal_Int32 nTurns
=100 )
810 // TODO(F1): also profile pure complex clip setup times!
812 // State: fill/line color, draw mode, w/o clip, rect clip, complex clip
813 functor_vector_type aMethods
;
814 setupMethodStubs( aMethods
);
816 const Rectangle
aClipRect(10,10,1000,1000);
817 const Polygon
aPoly1( aClipRect
);
818 Polygon
aPoly2( aClipRect
);
819 aPoly2
.Rotate(aClipRect
.Center(),450);
820 PolyPolygon
aClipPoly(aPoly1
);
821 aClipPoly
.Insert(aPoly2
);
823 functor_vector_type::const_iterator iter
= aMethods
.begin();
824 const functor_vector_type::const_iterator end
= aMethods
.end();
827 rTarget
.SetLineColor( Color(COL_BLACK
) );
828 rTarget
.SetFillColor( Color(COL_GREEN
) );
829 rTarget
.SetRasterOp( ROP_OVERPAINT
);
830 rTarget
.SetClipRegion();
831 grindFunc( rTarget
, iter
, nTurns
, "w/o clip, w/o xor" );
833 rTarget
.SetLineColor( Color(COL_BLACK
) );
834 rTarget
.SetFillColor( Color(COL_GREEN
) );
835 rTarget
.SetRasterOp( ROP_OVERPAINT
);
836 rTarget
.SetClipRegion( aClipRect
);
837 grindFunc( rTarget
, iter
, nTurns
, "with rect clip, w/o xor" );
839 rTarget
.SetLineColor( Color(COL_BLACK
) );
840 rTarget
.SetFillColor( Color(COL_GREEN
) );
841 rTarget
.SetRasterOp( ROP_OVERPAINT
);
842 rTarget
.SetClipRegion( aClipPoly
);
843 grindFunc( rTarget
, iter
, nTurns
, "with complex clip, w/o xor" );
845 rTarget
.SetLineColor( Color(COL_BLACK
) );
846 rTarget
.SetFillColor( Color(COL_GREEN
) );
847 rTarget
.SetRasterOp( ROP_XOR
);
848 rTarget
.SetClipRegion();
849 grindFunc( rTarget
, iter
, nTurns
, "w/o clip, with xor" );
851 rTarget
.SetLineColor( Color(COL_BLACK
) );
852 rTarget
.SetFillColor( Color(COL_GREEN
) );
853 rTarget
.SetRasterOp( ROP_XOR
);
854 rTarget
.SetClipRegion( aClipRect
);
855 grindFunc( rTarget
, iter
, nTurns
, "with rect clip, with xor" );
857 rTarget
.SetLineColor( Color(COL_BLACK
) );
858 rTarget
.SetFillColor( Color(COL_GREEN
) );
859 rTarget
.SetRasterOp( ROP_XOR
);
860 rTarget
.SetClipRegion( aClipPoly
);
861 grindFunc( rTarget
, iter
, nTurns
, "with complex clip, with xor" );
868 void TestWindow::Paint( const Rectangle
& )
870 outDevGrind( *this );
874 sal_uInt16
GrindApp::Exception( sal_uInt16 nError
)
876 switch( nError
& EXC_MAJORTYPE
)
878 case EXC_RSCNOTLOADED
:
879 Abort( "Error: could not load language resources.\nPlease check your installation.\n" );
889 for( sal_uInt16 i
= 0; i
< GetCommandLineParamCount(); i
++ )
891 OUString aParam
= GetCommandLineParam( i
);
893 if( aParam
== "--help" || aParam
== "-h" )
899 printf( "outdevgrind - Profile OutputDevice\n" );
903 // create the global service-manager
904 uno::Reference
< lang::XMultiServiceFactory
> xFactory
;
907 uno::Reference
< uno::XComponentContext
> xCtx
= ::cppu::defaultBootstrap_InitialComponentContext();
908 xFactory
= uno::Reference
< lang::XMultiServiceFactory
>( xCtx
->getServiceManager(),
911 ::comphelper::setProcessServiceFactory( xFactory
);
913 catch( uno::Exception
& )
920 "Could not bootstrap UNO, installation must be in disorder. Exiting.\n" );
934 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */