1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: surfaceproxy.hxx,v $
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 #ifndef INCLUDED_CANVAS_SURFACEPROXY_HXX
32 #define INCLUDED_CANVAS_SURFACEPROXY_HXX
34 #include <canvas/rendering/isurfaceproxy.hxx>
35 #include <canvas/rendering/icolorbuffer.hxx>
37 #include "pagemanager.hxx"
38 #include "surface.hxx"
43 //////////////////////////////////////////////////////////////////////////////////
45 //////////////////////////////////////////////////////////////////////////////////
47 /** Definition of the surface proxy class.
49 Surface proxies are the connection between *one* source image
50 and *one or more* hardware surfaces (or textures). in a
51 logical structure surface proxies represent soley this
52 dependeny plus some simple cache management.
54 class SurfaceProxy
: public ISurfaceProxy
58 SurfaceProxy( const canvas::IColorBufferSharedPtr
& pBuffer
,
59 const PageManagerSharedPtr
&pPageManager
);
61 // ISurfaceProxy interface
62 virtual void setColorBufferDirty();
64 /** Render the surface content to screen.
67 Overall alpha for content
73 Output transformation (does not affect output position)
75 virtual bool draw( double fAlpha
,
76 const ::basegfx::B2DPoint
& rPos
,
77 const ::basegfx::B2DHomMatrix
& rTransform
);
79 /** Render the surface content to screen.
82 Overall alpha for content
88 Subset of the surface to render. Coordinate system are
89 surface area pixel, given area will be clipped to the
93 Output transformation (does not affect output position)
95 virtual bool draw( double fAlpha
,
96 const ::basegfx::B2DPoint
& rPos
,
97 const ::basegfx::B2DRange
& rArea
,
98 const ::basegfx::B2DHomMatrix
& rTransform
);
100 /** Render the surface content to screen.
103 Overall alpha for content
109 Clip polygon for the surface. The clip polygon is also
110 subject to the output transformation.
113 Output transformation (does not affect output position)
115 virtual bool draw( double fAlpha
,
116 const ::basegfx::B2DPoint
& rPos
,
117 const ::basegfx::B2DPolyPolygon
& rClipPoly
,
118 const ::basegfx::B2DHomMatrix
& rTransform
);
121 PageManagerSharedPtr mpPageManager
;
123 // the pagemanager will distribute the image
124 // to one or more surfaces, this is why we
126 std::vector
<SurfaceSharedPtr
> maSurfaceList
;
128 // pointer to the source of image data
129 // which always is stored in system memory,
130 // 32bit rgba and can have any size.
131 canvas::IColorBufferSharedPtr mpBuffer
;
134 typedef ::boost::shared_ptr
< SurfaceProxy
> SurfaceProxySharedPtr
;