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 <base/canvascustomspritehelper.hxx>
24 #include <basegfx/point/b2dpoint.hxx>
26 #include "cairo_spritecanvas.hxx"
31 /* Definition of SpriteHelper class */
33 /** Helper class for canvas sprites.
35 This class implements all sprite-related functionality, like
36 that available on the XSprite interface.
38 class SpriteHelper
: public ::canvas::CanvasCustomSpriteHelper
41 /** Create sprite helper
45 /** Late-init the sprite helper
51 Sprite canvas this sprite is part of. Object stores
52 ref-counted reference to it, thus, don't forget to pass on
59 The surface of the sprite (not the DX texture, but the
60 persistent target of content rendering)
62 @param bShowSpriteBounds
63 When true, little debug bound rects for sprites are shown
65 void init( const css::geometry::RealSize2D
& rSpriteSize
,
66 const SpriteCanvasRef
& rSpriteCanvas
);
70 void setSurface( const ::cairo::SurfaceSharedPtr
& pBufferSurface
);
72 /** Repaint sprite content to associated sprite canvas
75 Output position (sprite's own position is disregarded)
77 @param io_bSurfacesDirty
78 When true, the referenced sprite surfaces (backBuffer and
79 backBufferMask) have been modified since last call.
81 @param bBufferedUpdate
82 When true, the redraw does <em>not</em> happen directly on
83 the front buffer, but within a VDev. Used to speed up
86 void redraw( const ::cairo::CairoSharedPtr
& pCairo
,
87 const ::basegfx::B2DPoint
& rPos
,
89 bool bBufferedUpdate
) const;
92 virtual ::basegfx::B2DPolyPolygon
polyPolygonFromXPolyPolygon2D(
93 css::uno::Reference
< css::rendering::XPolyPolygon2D
>& xPoly
) const override
;
96 SpriteCanvasRef mpSpriteCanvas
;
97 ::cairo::SurfaceSharedPtr mpBufferSurface
;
98 mutable bool mbTextureDirty
; // when true, texture needs update
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */