LibreOffice Module canvas (master) 1
cairo_spritecanvashelper.cxx
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#include <sal/config.h>
21#include <sal/log.hxx>
22
23#include <boost/cast.hpp>
24
27
29
30#include <cairo.h>
31
34
35using namespace ::cairo;
36using namespace ::com::sun::star;
37
38namespace cairocanvas
39{
40 namespace
41 {
47 void spriteRedraw( const CairoSharedPtr& pCairo,
48 const ::canvas::Sprite::Reference& rSprite )
49 {
50 // downcast to derived cairocanvas::Sprite interface, which
51 // provides the actual redraw methods.
52 ::boost::polymorphic_downcast< Sprite* >(rSprite.get())->redraw( pCairo, true);
53 }
54
55 void repaintBackground( const CairoSharedPtr& pCairo,
56 const SurfaceSharedPtr& pBackgroundSurface,
57 const ::basegfx::B2DRange& rArea )
58 {
59 cairo_save( pCairo.get() );
60 cairo_rectangle( pCairo.get(), ceil( rArea.getMinX() ), ceil( rArea.getMinY() ),
61 floor( rArea.getWidth() ), floor( rArea.getHeight() ) );
62 cairo_clip( pCairo.get() );
63 cairo_set_source_surface( pCairo.get(), pBackgroundSurface->getCairoSurface().get(), 0, 0 );
64 cairo_set_operator( pCairo.get(), CAIRO_OPERATOR_SOURCE );
65 cairo_paint( pCairo.get() );
66 cairo_restore( pCairo.get() );
67 }
68
69 void opaqueUpdateSpriteArea( const ::canvas::Sprite::Reference& rSprite,
70 const CairoSharedPtr& pCairo,
71 const ::basegfx::B2IRange& rArea )
72 {
73 // clip output to actual update region (otherwise a)
74 // wouldn't save much render time, and b) will clutter
75 // scrolled sprite content outside this area)
76 cairo_save( pCairo.get() );
77 cairo_rectangle( pCairo.get(), rArea.getMinX(), rArea.getMinY(),
78 sal::static_int_cast<sal_Int32>(rArea.getWidth()),
79 sal::static_int_cast<sal_Int32>(rArea.getHeight()) );
80 cairo_clip( pCairo.get() );
81
82 // repaint affected sprite directly to output device (at
83 // the actual screen output position)
84 // rendering directly to device buffer
85 ::boost::polymorphic_downcast< Sprite* >( rSprite.get() )->redraw( pCairo, false );
86
87 cairo_restore( pCairo.get() );
88 }
89 }
90
92 mpRedrawManager( nullptr ),
93 mpOwningSpriteCanvas( nullptr ),
94 mbCompositingSurfaceDirty(true)
95 {
96 }
97
99 SpriteCanvas& rDevice,
100 const ::basegfx::B2ISize& rSize )
101 {
102 mpRedrawManager = &rManager;
103 mpOwningSpriteCanvas = &rDevice;
104
105 CanvasHelper::init( rSize, rDevice, &rDevice );
106 }
107
109 {
110 mpCompositingSurface.reset();
111 mpOwningSpriteCanvas = nullptr;
112 mpRedrawManager = nullptr;
113
114 // forward to base
116 }
117
118 uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation(
119 const uno::Reference< rendering::XAnimation >& )
120 {
121 return uno::Reference< rendering::XAnimatedSprite >();
122 }
123
124 uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps(
125 const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/,
126 sal_Int8 /*interpolationMode*/ )
127 {
128 return uno::Reference< rendering::XAnimatedSprite >();
129 }
130
131 uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( const geometry::RealSize2D& spriteSize )
132 {
133 if( !mpRedrawManager )
134 return uno::Reference< rendering::XCustomSprite >(); // we're disposed
135
136 return uno::Reference< rendering::XCustomSprite >(
137 new CanvasCustomSprite( spriteSize,
139 }
140
141 uno::Reference< rendering::XSprite > SpriteCanvasHelper::createClonedSprite(
142 const uno::Reference< rendering::XSprite >& )
143 {
144 return uno::Reference< rendering::XSprite >();
145 }
146
147 bool SpriteCanvasHelper::updateScreen( const ::basegfx::B2IRange& /*rCurrArea*/,
148 bool bUpdateAll,
149 bool& io_bSurfaceDirty )
150 {
151 if( !mpRedrawManager ||
155 {
156 return false; // disposed, or otherwise dysfunctional
157 }
158
159 SAL_INFO("canvas.cairo", "SpriteCanvasHelper::updateScreen called");
160
161 const ::basegfx::B2ISize& rSize = mpOwningSpriteCanvas->getSizePixel();
162
163 // force compositing surface to be available before using it
164 // inside forEachSpriteArea
165 SurfaceSharedPtr pCompositingSurface = getCompositingSurface(rSize);
167 CairoSharedPtr pCompositingCairo = pCompositingSurface->getCairo();
168 CairoSharedPtr pWindowCairo = pWindowSurface->getCairo();
169
170 // TODO(P1): Might be worthwhile to track areas of background
171 // changes, too.
172 if( !bUpdateAll && !io_bSurfaceDirty && !mbCompositingSurfaceDirty )
173 {
174 // background has not changed, so we're free to optimize
175 // repaint to areas where a sprite has changed
176
177 // process each independent area of overlapping sprites
178 // separately.
180 }
181 else
182 {
183 SAL_INFO("canvas.cairo", "SpriteCanvasHelper::updateScreen update ALL");
184
185 // background has changed, so we currently have no choice
186 // but repaint everything (or caller requested that)
187
188 cairo_rectangle( pCompositingCairo.get(), 0, 0, rSize.getWidth(), rSize.getHeight() );
189 cairo_clip( pCompositingCairo.get() );
190 cairo_save( pCompositingCairo.get() );
191 cairo_set_source_surface( pCompositingCairo.get(),
192 mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(),
193 0, 0 );
194 cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE );
195 cairo_paint( pCompositingCairo.get() );
196 cairo_restore( pCompositingCairo.get() );
197
198 // repaint all active sprites on top of background into
199 // VDev.
201 [&pCompositingCairo]( const Sprite::Reference rSprite )
202 { spriteRedraw( pCompositingCairo, rSprite ); }
203 );
204
205 // flush to screen
206 cairo_rectangle( pWindowCairo.get(), 0, 0, rSize.getWidth(), rSize.getHeight() );
207 cairo_clip( pWindowCairo.get() );
208 cairo_set_source_surface( pWindowCairo.get(),
209 pCompositingSurface->getCairoSurface().get(),
210 0, 0 );
211 cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE );
212 cairo_paint( pWindowCairo.get() );
213 }
214
215 // change record vector must be cleared, for the next turn of
216 // rendering and sprite changing
218
220 io_bSurfaceDirty = false;
221
222 // commit to screen
224
225 return true;
226 }
227
228 void SpriteCanvasHelper::backgroundPaint( const ::basegfx::B2DRange& rUpdateRect )
229 {
231 repaintBackground( mpCompositingSurface->getCairo(),
233 rUpdateRect );
234 }
235
236 void SpriteCanvasHelper::scrollUpdate( const ::basegfx::B2DRange& rMoveStart,
237 const ::basegfx::B2DRange& rMoveEnd,
238 const ::canvas::SpriteRedrawManager::UpdateArea& rUpdateArea )
239 {
242 "SpriteCanvasHelper::scrollUpdate(): NULL device pointer " );
243
244 SAL_INFO("canvas.cairo", "SpriteCanvasHelper::scrollUpdate called");
245
246 const ::basegfx::B2ISize& rSize = mpOwningSpriteCanvas->getSizePixel();
247 const ::basegfx::B2IRange aOutputBounds( 0,0,
248 rSize.getWidth(),
249 rSize.getHeight() );
250
251 SurfaceSharedPtr pCompositingSurface = getCompositingSurface(rSize);
253 CairoSharedPtr pCompositingCairo = pCompositingSurface->getCairo();
254 CairoSharedPtr pWindowCairo = pWindowSurface->getCairo();
255
256 // round rectangles to integer pixel. Note: have to be
257 // extremely careful here, to avoid off-by-one errors for
258 // the destination area: otherwise, the next scroll update
259 // would copy pixel that are not supposed to be part of
260 // the sprite.
261 ::basegfx::B2IRange aSourceRect(
263 const ::basegfx::B2IRange& rDestRect(
265 ::basegfx::B2IPoint aDestPos( rDestRect.getMinimum() );
266
267 std::vector< ::basegfx::B2IRange > aUnscrollableAreas;
268
269 // TODO(E3): This is plain buggy (but copies the behaviour of
270 // the old Impress slideshow) - the scrolled area might
271 // actually lie _below_ another window!
272
273 // clip to output bounds (cannot properly scroll stuff
274 // _outside_ our screen area)
275 if( !::canvas::tools::clipScrollArea( aSourceRect,
276 aDestPos,
277 aUnscrollableAreas,
278 aOutputBounds ) )
279 {
280 // fully clipped scroll area: cannot simply scroll
281 // then. Perform normal opaque update (can use that, since
282 // one of the preconditions for scrollable update is
283 // opaque sprite content)
284
285 // repaint all affected sprites directly to output device
286 for( const auto& rComponent : rUpdateArea.maComponentList )
287 {
288 const ::canvas::Sprite::Reference& rSprite( rComponent.second.getSprite() );
289 if( rSprite.is() )
290 ::boost::polymorphic_downcast< Sprite* >( rSprite.get() )->redraw(
291 pCompositingCairo, true );
292 }
293 }
294 else
295 {
296 const ::basegfx::B2IVector aSourceUpperLeftPos( aSourceRect.getMinimum() );
297
298 // clip dest area (which must be inside rDestBounds)
299 ::basegfx::B2IRange aDestRect( rDestRect );
300 aDestRect.intersect( aOutputBounds );
301
302 ::basegfx::B2ISize aScrollSize( aDestRect.getWidth(), aDestRect.getHeight() );
303 SurfaceSharedPtr pScrollSurface( getTemporarySurface() );
304 CairoSharedPtr pScrollCairo( pScrollSurface->getCairo() );
305
306 cairo_save( pScrollCairo.get() );
307 // scroll the current content of the compositing surface (and,
308 // thus, of the window) in temp. surface
309 cairo_set_source_surface( pScrollCairo.get(),
310 pCompositingSurface->getCairoSurface().get(),
311 aDestPos.getX() - aSourceUpperLeftPos.getX(),
312 aDestPos.getY() - aSourceUpperLeftPos.getY() );
313 cairo_rectangle( pScrollCairo.get(),
314 aDestPos.getX(), aDestPos.getY(),
315 aScrollSize.getWidth(), aScrollSize.getHeight() );
316 cairo_clip( pScrollCairo.get() );
317 cairo_set_operator( pScrollCairo.get(), CAIRO_OPERATOR_SOURCE );
318 cairo_paint( pScrollCairo.get() );
319 cairo_restore( pScrollCairo.get() );
320
321 cairo_save( pCompositingCairo.get() );
322 // copy the scrolled area back onto the compositing surface
323 cairo_set_source_surface( pCompositingCairo.get(),
324 pScrollSurface->getCairoSurface().get(),
325 0, 0 );
326 cairo_rectangle( pCompositingCairo.get(),
327 aDestPos.getX(), aDestPos.getY(),
328 aScrollSize.getWidth(), aScrollSize.getHeight() );
329 cairo_clip( pCompositingCairo.get() );
330 cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE );
331 cairo_paint( pCompositingCairo.get() );
332 cairo_restore( pCompositingCairo.get() );
333
334 const ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator
335 aFirst( rUpdateArea.maComponentList.begin() );
336 ::canvas::SpriteRedrawManager::SpriteConnectedRanges::ComponentListType::const_iterator
337 aSecond( aFirst );
338 ++aSecond;
339
340 ENSURE_OR_THROW( aFirst->second.getSprite().is(),
341 "VCLCanvas::scrollUpdate(): no sprite" );
342
343 // repaint uncovered areas from sprite. Need to actually
344 // clip here, since we're only repainting _parts_ of the
345 // sprite
346 for( const auto& rArea : aUnscrollableAreas )
347 opaqueUpdateSpriteArea( aFirst->second.getSprite(),
348 pCompositingCairo, rArea );
349 }
350
351 // repaint uncovered areas from backbuffer - take the
352 // _rounded_ rectangles from above, to have the update
353 // consistent with the scroll above.
354 std::vector< ::basegfx::B2DRange > aUncoveredAreas;
355 ::basegfx::computeSetDifference( aUncoveredAreas,
356 rUpdateArea.maTotalBounds,
357 ::basegfx::B2DRange( rDestRect ) );
358 for( const auto& rArea : aUncoveredAreas )
359 repaintBackground( pCompositingCairo,
361
362 cairo_rectangle( pWindowCairo.get(), 0, 0, rSize.getWidth(), rSize.getHeight() );
363 cairo_clip( pWindowCairo.get() );
364 cairo_set_source_surface( pWindowCairo.get(),
365 pCompositingSurface->getCairoSurface().get(),
366 0, 0 );
367 cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE );
368 cairo_paint( pWindowCairo.get() );
369 }
370
371 void SpriteCanvasHelper::opaqueUpdate( const ::basegfx::B2DRange& rTotalArea,
372 const std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites )
373 {
376 "SpriteCanvasHelper::opaqueUpdate(): NULL device pointer " );
377
378 SAL_INFO("canvas.cairo", "SpriteCanvasHelper::opaqueUpdate called");
379
380 const ::basegfx::B2ISize& rDeviceSize = mpOwningSpriteCanvas->getSizePixel();
381
382 SurfaceSharedPtr pCompositingSurface = getCompositingSurface(rDeviceSize);
384 CairoSharedPtr pCompositingCairo = pCompositingSurface->getCairo();
385 CairoSharedPtr pWindowCairo = pWindowSurface->getCairo();
386
387 cairo_rectangle( pCompositingCairo.get(), 0, 0, rDeviceSize.getWidth(), rDeviceSize.getHeight() );
388 cairo_clip( pCompositingCairo.get() );
389
390 ::basegfx::B2DVector aPos( ceil( rTotalArea.getMinX() ), ceil( rTotalArea.getMinY() ) );
391 ::basegfx::B2DVector aSize( floor( rTotalArea.getMaxX() - aPos.getX() ), floor( rTotalArea.getMaxY() - aPos.getY() ) );
392
393 cairo_rectangle( pCompositingCairo.get(), aPos.getX(), aPos.getY(), aSize.getX(), aSize.getY() );
394 cairo_clip( pCompositingCairo.get() );
395
396 // repaint all affected sprites directly to output device
397 for( const auto& rSprite : rSortedUpdateSprites )
398 {
399 if( rSprite.is() )
400 ::boost::polymorphic_downcast< Sprite* >( rSprite.get() )->redraw(
401 pCompositingCairo, false );
402 }
403
404 // flush to screen
405 cairo_rectangle( pWindowCairo.get(), 0, 0, rDeviceSize.getWidth(), rDeviceSize.getHeight() );
406 cairo_clip( pWindowCairo.get() );
407 cairo_rectangle( pWindowCairo.get(), aPos.getX(), aPos.getY(), aSize.getX(), aSize.getY() );
408 cairo_clip( pWindowCairo.get() );
409 cairo_set_source_surface( pWindowCairo.get(),
410 pCompositingSurface->getCairoSurface().get(),
411 0, 0 );
412 cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE );
413 cairo_paint( pWindowCairo.get() );
414 }
415
416 void SpriteCanvasHelper::genericUpdate( const ::basegfx::B2DRange& rRequestedArea,
417 const std::vector< ::canvas::Sprite::Reference >& rSortedUpdateSprites )
418 {
419 // TODO
420 SAL_INFO("canvas.cairo", "SpriteCanvasHelper::genericUpdate called");
421
424 "SpriteCanvasHelper::genericUpdate(): NULL device pointer " );
425
426 // limit size of update VDev to target outdev's size
427 const ::basegfx::B2ISize& rSize = mpOwningSpriteCanvas->getSizePixel();
428
429 SurfaceSharedPtr pCompositingSurface = getCompositingSurface(rSize);
431 CairoSharedPtr pCompositingCairo = pCompositingSurface->getCairo();
432 CairoSharedPtr pWindowCairo = pWindowSurface->getCairo();
433
434 // round output position towards zero. Don't want to truncate
435 // a fraction of a sprite pixel... Clip position at origin,
436 // otherwise, truncation of size below might leave visible
437 // areas uncovered by VDev.
438 const Point aOutputPosition(
439 std::max( sal_Int32( 0 ),
440 static_cast< sal_Int32 >(rRequestedArea.getMinX()) ),
441 std::max( sal_Int32( 0 ),
442 static_cast< sal_Int32 >(rRequestedArea.getMinY()) ) );
443 // round output size towards +infty. Don't want to truncate a
444 // fraction of a sprite pixel... Limit size of VDev to output
445 // device's area.
446 const Size aOutputSize(
447 std::min( rSize.getWidth(),
448 ::canvas::tools::roundUp( rRequestedArea.getMaxX() - aOutputPosition.X()) ),
449 std::min( rSize.getHeight(),
450 ::canvas::tools::roundUp( rRequestedArea.getMaxY() - aOutputPosition.Y()) ) );
451
452 cairo_rectangle( pCompositingCairo.get(), aOutputPosition.X(), aOutputPosition.Y(), aOutputSize.Width(), aOutputSize.Height() );
453 cairo_clip( pCompositingCairo.get() );
454
455 // paint background
456 cairo_save( pCompositingCairo.get() );
457 cairo_set_source_surface( pCompositingCairo.get(),
458 mpOwningSpriteCanvas->getBufferSurface()->getCairoSurface().get(),
459 0, 0 );
460 cairo_set_operator( pCompositingCairo.get(), CAIRO_OPERATOR_SOURCE );
461 cairo_paint( pCompositingCairo.get() );
462 cairo_restore( pCompositingCairo.get() );
463
464 // repaint all affected sprites on top of background into
465 // VDev.
466 for( const auto& rSprite : rSortedUpdateSprites )
467 {
468 if( rSprite.is() )
469 ::boost::polymorphic_downcast< Sprite* >( rSprite.get() )->redraw(
470 pCompositingCairo, true );
471 }
472
473 // flush to screen
474 cairo_rectangle( pWindowCairo.get(), aOutputPosition.X(), aOutputPosition.Y(), aOutputSize.Width(), aOutputSize.Height() );
475 cairo_clip( pWindowCairo.get() );
476 cairo_set_source_surface( pWindowCairo.get(),
477 pCompositingSurface->getCairoSurface().get(),
478 0, 0 );
479 cairo_set_operator( pWindowCairo.get(), CAIRO_OPERATOR_SOURCE );
480 cairo_paint( pWindowCairo.get() );
481 }
482
483 ::cairo::SurfaceSharedPtr const & SpriteCanvasHelper::getCompositingSurface( const ::basegfx::B2ISize& rNeededSize )
484 {
485 if( rNeededSize.getWidth() > maCompositingSurfaceSize.getWidth() ||
486 rNeededSize.getHeight() > maCompositingSurfaceSize.getHeight() )
487 {
488 // need to give buffer more size
489 mpCompositingSurface.reset();
490 }
491
493 {
494 mpCompositingSurface = createSurface( rNeededSize );
495 maCompositingSurfaceSize = rNeededSize;
497 mpTemporarySurface.reset();
498 }
499
501 }
502
504 {
505 if ( !mpTemporarySurface )
507 return mpTemporarySurface;
508 }
509
510 ::cairo::SurfaceSharedPtr SpriteCanvasHelper::createSurface( const ::basegfx::B2ISize& rNeededSize ) const
511 {
512 return mpOwningSpriteCanvas->getWindowSurface()->getSimilar(
513 CAIRO_CONTENT_COLOR,
514 rNeededSize.getWidth(), rNeededSize.getHeight() );
515 }
516}
517
518/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
B2IPoint getMinimum() const
TYPE getWidth() const
void intersect(const Range2D &rRange)
TYPE getHeight() const
TYPE getWidth() const
TYPE getHeight() const
TYPE getX() const
TYPE getY() const
void disposing()
Release all references.
void init(const ::basegfx::B2ISize &rSizePixel, SurfaceProvider &rSurfaceProvider, css::rendering::XGraphicDevice *pDevice)
Initialize canvas helper.
css::uno::Reference< css::rendering::XSprite > createClonedSprite(const css::uno::Reference< css::rendering::XSprite > &original)
SpriteCanvas * mpOwningSpriteCanvas
Set from the init method. used to generate sprites.
void disposing()
Dispose all internal references.
void opaqueUpdate(const ::basegfx::B2DRange &rTotalArea, const std::vector< ::canvas::Sprite::Reference > &rSortedUpdateSprites)
css::uno::Reference< css::rendering::XAnimatedSprite > createSpriteFromAnimation(const css::uno::Reference< css::rendering::XAnimation > &animation)
void init(::canvas::SpriteRedrawManager &rManager, SpriteCanvas &rOwningSpriteCanvas, const ::basegfx::B2ISize &rSize)
::cairo::SurfaceSharedPtr createSurface(const ::basegfx::B2ISize &rNeededSize) const
::cairo::SurfaceSharedPtr const & getTemporarySurface()
::cairo::SurfaceSharedPtr mpTemporarySurface
a temporary surface that is guaranteed to be the same size
::cairo::SurfaceSharedPtr const & getCompositingSurface(const ::basegfx::B2ISize &rNeededSize)
::cairo::SurfaceSharedPtr mpCompositingSurface
a surface used to composite the frontbuffer image
void backgroundPaint(const ::basegfx::B2DRange &rUpdateRect)
Gets called for simple background repaints.
::canvas::SpriteRedrawManager * mpRedrawManager
Set from the SpriteCanvas: instance coordinating sprite redraw.
void scrollUpdate(const ::basegfx::B2DRange &rMoveStart, const ::basegfx::B2DRange &rMoveEnd, const ::canvas::SpriteRedrawManager::UpdateArea &rUpdateArea)
Gets called when area can be handled by scrolling.
css::uno::Reference< css::rendering::XAnimatedSprite > createSpriteFromBitmaps(const css::uno::Sequence< css::uno::Reference< css::rendering::XBitmap > > &animationBitmaps, sal_Int8 interpolationMode)
void genericUpdate(const ::basegfx::B2DRange &rTotalArea, const std::vector< ::canvas::Sprite::Reference > &rSortedUpdateSprites)
css::uno::Reference< css::rendering::XCustomSprite > createCustomSprite(const css::geometry::RealSize2D &spriteSize)
bool updateScreen(const ::basegfx::B2IRange &rCurrArea, bool bUpdateAll, bool &io_bSurfaceDirty)
Actually perform the screen update.
Product of this component's factory.
::cairo::SurfaceSharedPtr const & getWindowSurface() const
::cairo::SurfaceSharedPtr const & getBufferSurface() const
const ::basegfx::B2ISize & getSizePixel() const
This class manages smooth SpriteCanvas updates.
void forEachSpriteArea(Functor &rFunc) const
Call given functor for each sprite area that needs an update.
void clearChangeRecords()
Clear sprite change records (typically directly after a screen update)
void forEachSprite(const Functor &rFunc) const
Call given functor for each active sprite.
#define ENSURE_OR_THROW(c, m)
#define max(a, b)
Definition: dx_winstuff.hxx:43
#define SAL_INFO(area, stream)
std::shared_ptr< Surface > SurfaceSharedPtr
std::shared_ptr< cairo_t > CairoSharedPtr
::basegfx::B2IRange spritePixelAreaFromB2DRange(const ::basegfx::B2DRange &rRange)
Clip a blit between two differently surfaces.
bool clipScrollArea(::basegfx::B2IRange &io_rSourceArea, ::basegfx::B2IPoint &io_rDestPoint, std::vector< ::basegfx::B2IRange > &o_ClippedAreas, const ::basegfx::B2IRange &rBounds)
signed char sal_Int8