1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_canvas.hxx"
26 
27 #include <canvas/debug.hxx>
28 #include <tools/diagnose_ex.h>
29 #include <canvas/verbosetrace.hxx>
30 
31 #include <rtl/logfile.hxx>
32 #include <rtl/math.hxx>
33 
34 #include <canvas/canvastools.hxx>
35 
36 #include <basegfx/matrix/b2dhommatrix.hxx>
37 #include <basegfx/point/b2dpoint.hxx>
38 #include <basegfx/tools/canvastools.hxx>
39 #include <basegfx/numeric/ftools.hxx>
40 #include <basegfx/polygon/b2dpolypolygontools.hxx>
41 #include <basegfx/polygon/b2dpolygontools.hxx>
42 #include <basegfx/polygon/b2dpolypolygonrasterconverter.hxx>
43 #include <basegfx/polygon/b2dpolygontriangulator.hxx>
44 #include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
45 
46 #include "null_canvascustomsprite.hxx"
47 #include "null_spritehelper.hxx"
48 
49 #include <memory>
50 
51 
52 using namespace ::com::sun::star;
53 
54 namespace nullcanvas
55 {
SpriteHelper()56     SpriteHelper::SpriteHelper() :
57         mpSpriteCanvas(),
58         mbTextureDirty( true )
59     {
60     }
61 
init(const geometry::RealSize2D & rSpriteSize,const SpriteCanvasRef & rSpriteCanvas)62     void SpriteHelper::init( const geometry::RealSize2D&	rSpriteSize,
63                              const SpriteCanvasRef&			rSpriteCanvas )
64     {
65         ENSURE_OR_THROW( rSpriteCanvas.get(),
66                           "SpriteHelper::init(): Invalid device, sprite canvas or surface" );
67 
68         mpSpriteCanvas     = rSpriteCanvas;
69         mbTextureDirty     = true;
70 
71         // also init base class
72         CanvasCustomSpriteHelper::init( rSpriteSize,
73                                         rSpriteCanvas.get() );
74     }
75 
disposing()76     void SpriteHelper::disposing()
77     {
78         mpSpriteCanvas.clear();
79 
80         // forward to parent
81         CanvasCustomSpriteHelper::disposing();
82     }
83 
redraw(bool &) const84     void SpriteHelper::redraw( bool& /*io_bSurfaceDirty*/ ) const
85     {
86         // TODO
87     }
88 
polyPolygonFromXPolyPolygon2D(uno::Reference<rendering::XPolyPolygon2D> & xPoly) const89     ::basegfx::B2DPolyPolygon SpriteHelper::polyPolygonFromXPolyPolygon2D( uno::Reference< rendering::XPolyPolygon2D >& xPoly ) const
90     {
91         return ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( xPoly );
92     }
93 }
94