update dev300-m58
[ooovba.git] / canvas / source / tools / surfaceproxy.hxx
blob81bd5cb3ae28e17012cf83ca490aab02e5f1f707
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: surfaceproxy.hxx,v $
10 * $Revision: 1.3 $
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"
40 namespace canvas
43 //////////////////////////////////////////////////////////////////////////////////
44 // SurfaceProxy
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
56 public:
58 SurfaceProxy( const canvas::IColorBufferSharedPtr& pBuffer,
59 const PageManagerSharedPtr &pPageManager );
61 // ISurfaceProxy interface
62 virtual void setColorBufferDirty();
64 /** Render the surface content to screen.
66 @param fAlpha
67 Overall alpha for content
69 @param rPos
70 Output position
72 @param rTransform
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.
81 @param fAlpha
82 Overall alpha for content
84 @param rPos
85 Output position
87 @param rArea
88 Subset of the surface to render. Coordinate system are
89 surface area pixel, given area will be clipped to the
90 surface bounds.
92 @param rTransform
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.
102 @param fAlpha
103 Overall alpha for content
105 @param rPos
106 Output position
108 @param rClipPoly
109 Clip polygon for the surface. The clip polygon is also
110 subject to the output transformation.
112 @param rTransform
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 );
120 private:
121 PageManagerSharedPtr mpPageManager;
123 // the pagemanager will distribute the image
124 // to one or more surfaces, this is why we
125 // need a list here.
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;
137 #endif