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