#i105939# Adds clip state handling class to basegfx; makes use of that also from slideshow
This commit is contained in:
parent
4a30b933fa
commit
f2100460c1
2 changed files with 9 additions and 8 deletions
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include <basegfx/range/b2drange.hxx>
|
#include <basegfx/range/b2drange.hxx>
|
||||||
#include <basegfx/range/b1drange.hxx>
|
#include <basegfx/range/b1drange.hxx>
|
||||||
#include <basegfx/range/b2dmultirange.hxx>
|
#include <basegfx/range/b2dpolyrange.hxx>
|
||||||
#include <basegfx/matrix/b2dhommatrix.hxx>
|
#include <basegfx/matrix/b2dhommatrix.hxx>
|
||||||
#include <basegfx/polygon/b2dpolypolygon.hxx>
|
#include <basegfx/polygon/b2dpolypolygon.hxx>
|
||||||
|
|
||||||
|
@ -202,7 +202,8 @@ namespace slideshow
|
||||||
{
|
{
|
||||||
// TODO(Q1): move this to B2DMultiRange
|
// TODO(Q1): move this to B2DMultiRange
|
||||||
if( !rUpdateRange.isEmpty() )
|
if( !rUpdateRange.isEmpty() )
|
||||||
maUpdateAreas.addRange( rUpdateRange );
|
maUpdateAreas.appendElement( rUpdateRange,
|
||||||
|
basegfx::ORIENTATION_POSITIVE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::updateBounds( ShapeSharedPtr const& rShape )
|
void Layer::updateBounds( ShapeSharedPtr const& rShape )
|
||||||
|
@ -248,7 +249,7 @@ namespace slideshow
|
||||||
|
|
||||||
void Layer::clearUpdateRanges()
|
void Layer::clearUpdateRanges()
|
||||||
{
|
{
|
||||||
maUpdateAreas.reset();
|
maUpdateAreas.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::clearContent()
|
void Layer::clearContent()
|
||||||
|
@ -284,12 +285,12 @@ namespace slideshow
|
||||||
|
|
||||||
Layer::EndUpdater Layer::beginUpdate()
|
Layer::EndUpdater Layer::beginUpdate()
|
||||||
{
|
{
|
||||||
if( !maUpdateAreas.isEmpty() )
|
if( maUpdateAreas.count() )
|
||||||
{
|
{
|
||||||
// perform proper layer update. That means, setup proper
|
// perform proper layer update. That means, setup proper
|
||||||
// clipping, and render each shape that intersects with
|
// clipping, and render each shape that intersects with
|
||||||
// the calculated update area
|
// the calculated update area
|
||||||
::basegfx::B2DPolyPolygon aClip( maUpdateAreas.getPolyPolygon() );
|
::basegfx::B2DPolyPolygon aClip( maUpdateAreas.solveCrossovers() );
|
||||||
|
|
||||||
// actually, if there happen to be shapes with zero
|
// actually, if there happen to be shapes with zero
|
||||||
// update area in the maUpdateAreas vector, the
|
// update area in the maUpdateAreas vector, the
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef INCLUDED_SLIDESHOW_LAYER_HXX
|
#ifndef INCLUDED_SLIDESHOW_LAYER_HXX
|
||||||
#define INCLUDED_SLIDESHOW_LAYER_HXX
|
#define INCLUDED_SLIDESHOW_LAYER_HXX
|
||||||
|
|
||||||
#include <basegfx/range/b2dmultirange.hxx>
|
#include <basegfx/range/b2dpolyrange.hxx>
|
||||||
#include <cppcanvas/spritecanvas.hxx>
|
#include <cppcanvas/spritecanvas.hxx>
|
||||||
|
|
||||||
#include "view.hxx"
|
#include "view.hxx"
|
||||||
|
@ -187,7 +187,7 @@ namespace slideshow
|
||||||
@return true, if any non-empty addUpdateRange() calls
|
@return true, if any non-empty addUpdateRange() calls
|
||||||
have been made since the last render()/update() call.
|
have been made since the last render()/update() call.
|
||||||
*/
|
*/
|
||||||
bool isUpdatePending() const { return !maUpdateAreas.isEmpty(); }
|
bool isUpdatePending() const { return maUpdateAreas.count()!=0; }
|
||||||
|
|
||||||
/** Update layer bound rect from shape bounds
|
/** Update layer bound rect from shape bounds
|
||||||
*/
|
*/
|
||||||
|
@ -297,7 +297,7 @@ namespace slideshow
|
||||||
typedef ::std::vector< ViewEntry > ViewEntryVector;
|
typedef ::std::vector< ViewEntry > ViewEntryVector;
|
||||||
|
|
||||||
ViewEntryVector maViewEntries;
|
ViewEntryVector maViewEntries;
|
||||||
basegfx::B2DMultiRange maUpdateAreas;
|
basegfx::B2DPolyRange maUpdateAreas;
|
||||||
basegfx::B2DRange maBounds;
|
basegfx::B2DRange maBounds;
|
||||||
basegfx::B2DRange maNewBounds;
|
basegfx::B2DRange maNewBounds;
|
||||||
const basegfx::B2DRange maMaxBounds; // maBounds is clipped against this
|
const basegfx::B2DRange maMaxBounds; // maBounds is clipped against this
|
||||||
|
|
Loading…
Reference in a new issue