1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_CANVAS_SOURCE_TOOLS_SURFACEPROXY_HXX
21 #define INCLUDED_CANVAS_SOURCE_TOOLS_SURFACEPROXY_HXX
23 #include <canvas/rendering/isurfaceproxy.hxx>
24 #include <canvas/rendering/icolorbuffer.hxx>
26 #include "pagemanager.hxx"
27 #include "surface.hxx"
36 /** Definition of the surface proxy class.
38 Surface proxies are the connection between *one* source image
39 and *one or more* hardware surfaces (or textures). in a
40 logical structure surface proxies represent solely this
41 dependeny plus some simple cache management.
43 class SurfaceProxy
: public ISurfaceProxy
47 SurfaceProxy( const canvas::IColorBufferSharedPtr
& pBuffer
,
48 const PageManagerSharedPtr
&pPageManager
);
50 // ISurfaceProxy interface
51 virtual void setColorBufferDirty() SAL_OVERRIDE
;
53 /** Render the surface content to screen.
56 Overall alpha for content
62 Output transformation (does not affect output position)
64 virtual bool draw( double fAlpha
,
65 const ::basegfx::B2DPoint
& rPos
,
66 const ::basegfx::B2DHomMatrix
& rTransform
) SAL_OVERRIDE
;
68 /** Render the surface content to screen.
71 Overall alpha for content
77 Subset of the surface to render. Coordinate system are
78 surface area pixel, given area will be clipped to the
82 Output transformation (does not affect output position)
84 virtual bool draw( double fAlpha
,
85 const ::basegfx::B2DPoint
& rPos
,
86 const ::basegfx::B2DRange
& rArea
,
87 const ::basegfx::B2DHomMatrix
& rTransform
) SAL_OVERRIDE
;
89 /** Render the surface content to screen.
92 Overall alpha for content
98 Clip polygon for the surface. The clip polygon is also
99 subject to the output transformation.
102 Output transformation (does not affect output position)
104 virtual bool draw( double fAlpha
,
105 const ::basegfx::B2DPoint
& rPos
,
106 const ::basegfx::B2DPolyPolygon
& rClipPoly
,
107 const ::basegfx::B2DHomMatrix
& rTransform
) SAL_OVERRIDE
;
110 PageManagerSharedPtr mpPageManager
;
112 // the pagemanager will distribute the image
113 // to one or more surfaces, this is why we
115 std::vector
<SurfaceSharedPtr
> maSurfaceList
;
117 // pointer to the source of image data
118 // which always is stored in system memory,
119 // 32bit rgba and can have any size.
120 canvas::IColorBufferSharedPtr mpBuffer
;
123 typedef ::boost::shared_ptr
< SurfaceProxy
> SurfaceProxySharedPtr
;
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */