LibreOffice Module canvas (master) 1
cairo_spritehelper.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
23
25
27
28
29namespace cairocanvas
30{
31 /* Definition of SpriteHelper class */
32
39 {
40 public:
44
65 void init( const css::geometry::RealSize2D& rSpriteSize,
66 const SpriteCanvasRef& rSpriteCanvas );
67
68 void disposing();
69
70 void setSurface( const ::cairo::SurfaceSharedPtr& pBufferSurface );
71
86 void redraw( const ::cairo::CairoSharedPtr& pCairo,
87 const ::basegfx::B2DPoint& rPos,
88 bool& bSurfacesDirty,
89 bool bBufferedUpdate ) const;
90
91 private:
92 virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
93 css::uno::Reference< css::rendering::XPolyPolygon2D >& xPoly ) const override;
94
95
98 mutable bool mbTextureDirty; // when true, texture needs update
99 };
100}
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class for canvas sprites.
void init(const css::geometry::RealSize2D &rSpriteSize, const SpriteCanvasRef &rSpriteCanvas)
Late-init the sprite helper.
void setSurface(const ::cairo::SurfaceSharedPtr &pBufferSurface)
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override
Called to convert an API polygon to a basegfx polygon.
void redraw(const ::cairo::CairoSharedPtr &pCairo, const ::basegfx::B2DPoint &rPos, bool &bSurfacesDirty, bool bBufferedUpdate) const
Repaint sprite content to associated sprite canvas.
::cairo::SurfaceSharedPtr mpBufferSurface
SpriteHelper()
Create sprite helper.
Base class for an XSprite helper implementation - to be used in concert with CanvasCustomSpriteBase.
std::shared_ptr< Surface > SurfaceSharedPtr