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 #ifndef INCLUDED_CANVAS_ISURFACEPROXY_HXX
25 #define INCLUDED_CANVAS_ISURFACEPROXY_HXX
26 
27 #include <canvas/rendering/irendermodule.hxx>
28 
29 #include <boost/shared_ptr.hpp>
30 
31 namespace basegfx
32 {
33     class B2DRange;
34     class B2DPoint;
35     class B2DPolyPolygon;
36     class B2DHomMatrix;
37 }
38 
39 namespace canvas
40 {
41     struct ISurfaceProxy
42     {
~ISurfaceProxycanvas::ISurfaceProxy43         virtual ~ISurfaceProxy() {}
44 
45         /** Notify the proxy that the color buffer has changed
46          */
47         virtual void setColorBufferDirty() = 0;
48 
49         /** Render the surface content to screen.
50 
51             @param fAlpha
52             Overall alpha for content
53 
54             @param rPos
55             Output position
56 
57             @param rTransform
58             Output transformation (does not affect output position)
59          */
60         virtual bool draw( double                         fAlpha,
61                            const ::basegfx::B2DPoint&     rPos,
62                            const ::basegfx::B2DHomMatrix& rTransform ) = 0;
63 
64         /** Render the surface content to screen.
65 
66             @param fAlpha
67             Overall alpha for content
68 
69             @param rPos
70             Output position
71 
72             @param rArea
73             Subset of the surface to render. Coordinate system are
74             surface area pixel, given area will be clipped to the
75             surface bounds.
76 
77             @param rTransform
78             Output transformation (does not affect output position)
79          */
80         virtual bool draw( double                         fAlpha,
81                            const ::basegfx::B2DPoint&     rPos,
82                            const ::basegfx::B2DRange&     rArea,
83                            const ::basegfx::B2DHomMatrix& rTransform ) = 0;
84 
85         /** Render the surface content to screen.
86 
87             @param fAlpha
88             Overall alpha for content
89 
90             @param rPos
91             Output position
92 
93             @param rClipPoly
94             Clip polygon for the surface. The clip polygon is also
95             subject to the output transformation.
96 
97             @param rTransform
98             Output transformation (does not affect output position)
99          */
100         virtual bool draw( double                           fAlpha,
101                            const ::basegfx::B2DPoint&       rPos,
102                            const ::basegfx::B2DPolyPolygon& rClipPoly,
103                            const ::basegfx::B2DHomMatrix&   rTransform ) = 0;
104     };
105 
106     typedef ::boost::shared_ptr< ISurfaceProxy > ISurfaceProxySharedPtr;
107 }
108 
109 #endif /* INCLUDED_CANVAS_ISURFACEPROXY_HXX */
110