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 .
22 #include <rendering/isurfaceproxy.hxx>
23 #include <rendering/icolorbuffer.hxx>
25 #include "pagemanager.hxx"
26 #include "surface.hxx"
30 /** Definition of the surface proxy class.
32 Surface proxies are the connection between *one* source image
33 and *one or more* hardware surfaces (or textures). in a
34 logical structure surface proxies represent solely this
35 dependency plus some simple cache management.
37 class SurfaceProxy
: public ISurfaceProxy
41 SurfaceProxy( std::shared_ptr
<canvas::IColorBuffer
> xBuffer
,
42 PageManagerSharedPtr xPageManager
);
44 // ISurfaceProxy interface
45 virtual void setColorBufferDirty() override
;
47 /** Render the surface content to screen.
50 Overall alpha for content
56 Output transformation (does not affect output position)
58 virtual bool draw( double fAlpha
,
59 const ::basegfx::B2DPoint
& rPos
,
60 const ::basegfx::B2DHomMatrix
& rTransform
) override
;
62 /** Render the surface content to screen.
65 Overall alpha for content
71 Subset of the surface to render. Coordinate system are
72 surface area pixel, given area will be clipped to the
76 Output transformation (does not affect output position)
78 virtual bool draw( double fAlpha
,
79 const ::basegfx::B2DPoint
& rPos
,
80 const ::basegfx::B2DRange
& rArea
,
81 const ::basegfx::B2DHomMatrix
& rTransform
) override
;
83 /** Render the surface content to screen.
86 Overall alpha for content
92 Clip polygon for the surface. The clip polygon is also
93 subject to the output transformation.
96 Output transformation (does not affect output position)
98 virtual bool draw( double fAlpha
,
99 const ::basegfx::B2DPoint
& rPos
,
100 const ::basegfx::B2DPolyPolygon
& rClipPoly
,
101 const ::basegfx::B2DHomMatrix
& rTransform
) override
;
104 PageManagerSharedPtr mpPageManager
;
106 // the pagemanager will distribute the image
107 // to one or more surfaces, this is why we
109 std::vector
<SurfaceSharedPtr
> maSurfaceList
;
111 // pointer to the source of image data
112 // which always is stored in system memory,
113 // 32bit rgba and can have any size.
114 std::shared_ptr
<canvas::IColorBuffer
> mpBuffer
;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */