LibreOffice Module canvas (master) 1
dx_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
22#include <com/sun/star/rendering/XCustomSprite.hpp>
23
25
29
30#include "dx_spritecanvas.hxx"
31#include "dx_surfacebitmap.hxx"
32
33namespace dxcanvas
34{
35 /* Definition of SpriteHelper class */
36
43 {
44 public:
48
69 void init( const css::geometry::RealSize2D& rSpriteSize,
70 const SpriteCanvasRef& rSpriteCanvas,
71 const IDXRenderModuleSharedPtr& rRenderModule,
72 const DXSurfaceBitmapSharedPtr& rBitmap,
73 bool bShowSpriteBounds );
74
75 void disposing();
76
85 void redraw( bool& io_bSurfaceDirty ) const;
86
87 private:
88 virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
89 css::uno::Reference< css::rendering::XPolyPolygon2D >& xPoly ) const override;
90
92 bool needRedraw() const;
93
95
97 mutable bool mbTextureDirty; // when true, texture needs update
98 bool mbShowSpriteBounds; // when true, debug bound rect for sprites is shown
99 };
100}
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for an XSprite helper implementation - to be used in concert with CanvasCustomSpriteBase.
Helper class for canvas sprites.
bool needRedraw() const
Returns true, if the sprite really needs redraw.
void redraw(bool &io_bSurfaceDirty) const
Repaint sprite content via hardware to associated sprite canvas.
SpriteCanvasRef mpSpriteCanvas
DXSurfaceBitmapSharedPtr mpBitmap
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(css::uno::Reference< css::rendering::XPolyPolygon2D > &xPoly) const override
Called to convert an API polygon to a basegfx polygon.
SpriteHelper()
Create sprite helper.
void init(const css::geometry::RealSize2D &rSpriteSize, const SpriteCanvasRef &rSpriteCanvas, const IDXRenderModuleSharedPtr &rRenderModule, const DXSurfaceBitmapSharedPtr &rBitmap, bool bShowSpriteBounds)
Late-init the sprite helper.
std::shared_ptr< DXSurfaceBitmap > DXSurfaceBitmapSharedPtr
std::shared_ptr< IDXRenderModule > IDXRenderModuleSharedPtr