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 <vcl/bitmapex.hxx>
24 #include <base/canvascustomspritehelper.hxx>
25 #include <base/spritesurface.hxx>
26 #include <vclwrapper.hxx>
28 #include "backbuffer.hxx"
33 /* Definition of SpriteHelper class */
35 /** Helper class for canvas sprites.
37 This class implements all sprite-related functionality, like
38 that available on the XSprite interface.
40 class SpriteHelper
: public ::canvas::CanvasCustomSpriteHelper
45 // make CanvasCustomSpriteHelper::init visible for name lookup
46 using ::canvas::CanvasCustomSpriteHelper::init
;
48 /** Late-init the sprite helper
54 Sprite canvas this sprite is part of. Object stores
55 ref-counted reference to it, thus, don't forget to pass on
59 Buffer of the sprite content (non-alpha part)
61 @param rBackBufferMask
62 Buffer of the sprite content (alpha part)
64 void init( const css::geometry::RealSize2D
& rSpriteSize
,
65 const ::canvas::SpriteSurface::Reference
& rOwningSpriteCanvas
,
66 const BackBufferSharedPtr
& rBackBuffer
,
67 const BackBufferSharedPtr
& rBackBufferMask
,
68 bool bShowSpriteBounds
);
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( OutputDevice
& rOutDev
,
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 BackBufferSharedPtr mpBackBuffer
;
97 BackBufferSharedPtr mpBackBufferMask
;
99 /// Cached bitmap for the current sprite content
100 mutable ::canvas::vcltools::VCLObject
<BitmapEx
> maContent
;
102 /// When true, line sprite corners in red
103 bool mbShowSpriteBounds
;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */