LibreOffice Module canvas (master) 1
surfaceproxy.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
24
25#include "pagemanager.hxx"
26#include "surface.hxx"
27
28namespace canvas
29{
38 {
39 public:
40
41 SurfaceProxy( std::shared_ptr<canvas::IColorBuffer> xBuffer,
42 PageManagerSharedPtr xPageManager );
43
44 // ISurfaceProxy interface
45 virtual void setColorBufferDirty() override;
46
58 virtual bool draw( double fAlpha,
59 const ::basegfx::B2DPoint& rPos,
60 const ::basegfx::B2DHomMatrix& rTransform ) override;
61
78 virtual bool draw( double fAlpha,
79 const ::basegfx::B2DPoint& rPos,
80 const ::basegfx::B2DRange& rArea,
81 const ::basegfx::B2DHomMatrix& rTransform ) override;
82
98 virtual bool draw( double fAlpha,
99 const ::basegfx::B2DPoint& rPos,
100 const ::basegfx::B2DPolyPolygon& rClipPoly,
101 const ::basegfx::B2DHomMatrix& rTransform ) override;
102
103 private:
105
106 // the pagemanager will distribute the image
107 // to one or more surfaces, this is why we
108 // need a list here.
109 std::vector<SurfaceSharedPtr> maSurfaceList;
110
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;
115 };
116}
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition of the surface proxy class.
SurfaceProxy(std::shared_ptr< canvas::IColorBuffer > xBuffer, PageManagerSharedPtr xPageManager)
virtual void setColorBufferDirty() override
Notify the proxy that the color buffer has changed.
std::shared_ptr< canvas::IColorBuffer > mpBuffer
virtual bool draw(double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DHomMatrix &rTransform) override
Render the surface content to screen.
PageManagerSharedPtr mpPageManager
std::vector< SurfaceSharedPtr > maSurfaceList
std::shared_ptr< PageManager > PageManagerSharedPtr
Definition: pagemanager.hxx:73