update dev300-m58
[ooovba.git] / canvas / source / null / null_spritehelper.cxx
blob9a0b85fea0a718f4b895f3c807f52d6cfaf8f15a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: null_spritehelper.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_canvas.hxx"
34 #include <canvas/debug.hxx>
35 #include <tools/diagnose_ex.h>
36 #include <canvas/verbosetrace.hxx>
38 #include <rtl/logfile.hxx>
39 #include <rtl/math.hxx>
41 #include <canvas/canvastools.hxx>
43 #include <basegfx/matrix/b2dhommatrix.hxx>
44 #include <basegfx/point/b2dpoint.hxx>
45 #include <basegfx/tools/canvastools.hxx>
46 #include <basegfx/numeric/ftools.hxx>
47 #include <basegfx/polygon/b2dpolypolygontools.hxx>
48 #include <basegfx/polygon/b2dpolygontools.hxx>
49 #include <basegfx/polygon/b2dpolypolygonrasterconverter.hxx>
50 #include <basegfx/polygon/b2dpolygontriangulator.hxx>
51 #include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
53 #include "null_canvascustomsprite.hxx"
54 #include "null_spritehelper.hxx"
56 #include <memory>
59 using namespace ::com::sun::star;
61 namespace nullcanvas
63 SpriteHelper::SpriteHelper() :
64 mpSpriteCanvas(),
65 mbTextureDirty( true )
69 void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize,
70 const SpriteCanvasRef& rSpriteCanvas )
72 ENSURE_OR_THROW( rSpriteCanvas.get(),
73 "SpriteHelper::init(): Invalid device, sprite canvas or surface" );
75 mpSpriteCanvas = rSpriteCanvas;
76 mbTextureDirty = true;
78 // also init base class
79 CanvasCustomSpriteHelper::init( rSpriteSize,
80 rSpriteCanvas.get() );
83 void SpriteHelper::disposing()
85 mpSpriteCanvas.clear();
87 // forward to parent
88 CanvasCustomSpriteHelper::disposing();
91 void SpriteHelper::redraw( bool& /*io_bSurfaceDirty*/ ) const
93 // TODO
96 ::basegfx::B2DPolyPolygon SpriteHelper::polyPolygonFromXPolyPolygon2D( uno::Reference< rendering::XPolyPolygon2D >& xPoly ) const
98 return ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( xPoly );