2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-08 10:00:18 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2006-09-17 02:29:54 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
#include <canvas/debug.hxx>
|
2008-06-24 09:56:25 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2004-11-26 16:11:13 +00:00
|
|
|
#include <canvas/verbosetrace.hxx>
|
2014-01-14 13:05:02 -02:00
|
|
|
#include <cppuhelper/supportsservice.hxx>
|
2004-11-26 16:11:13 +00:00
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
#include <rtl/math.hxx>
|
|
|
|
|
|
|
|
#include <vcl/outdev.hxx>
|
|
|
|
#include <vcl/bitmap.hxx>
|
2004-11-26 16:11:13 +00:00
|
|
|
#include <vcl/alpha.hxx>
|
|
|
|
#include <vcl/bitmapex.hxx>
|
2004-03-18 09:38:44 +00:00
|
|
|
#include <vcl/canvastools.hxx>
|
|
|
|
|
|
|
|
#include <basegfx/matrix/b2dhommatrix.hxx>
|
|
|
|
#include <basegfx/point/b2dpoint.hxx>
|
|
|
|
#include <basegfx/tools/canvastools.hxx>
|
2005-03-10 10:57:53 +00:00
|
|
|
#include <basegfx/polygon/b2dpolygon.hxx>
|
|
|
|
#include <basegfx/polygon/b2dpolygontools.hxx>
|
2005-05-06 08:16:52 +00:00
|
|
|
#include <basegfx/polygon/b2dpolypolygontools.hxx>
|
2004-11-26 16:11:13 +00:00
|
|
|
#include <basegfx/numeric/ftools.hxx>
|
|
|
|
|
|
|
|
#include <canvas/canvastools.hxx>
|
|
|
|
|
|
|
|
#include "canvascustomsprite.hxx"
|
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
namespace vclcanvas
|
|
|
|
{
|
|
|
|
|
2008-06-24 09:56:25 +00:00
|
|
|
CanvasCustomSprite::CanvasCustomSprite( const geometry::RealSize2D& rSpriteSize,
|
|
|
|
rendering::XGraphicDevice& rDevice,
|
|
|
|
const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
|
|
|
|
const OutDevProviderSharedPtr& rOutDevProvider,
|
|
|
|
bool bShowSpriteBounds )
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2008-06-24 09:56:25 +00:00
|
|
|
ENSURE_OR_THROW( rOwningSpriteCanvas.get() &&
|
|
|
|
rOutDevProvider,
|
|
|
|
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// setup back buffer
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
const ::Size aSize(
|
|
|
|
static_cast<sal_Int32>( ::std::max( 1.0,
|
|
|
|
ceil( rSpriteSize.Width ))), // round up to nearest int,
|
|
|
|
// enforce sprite to have at
|
|
|
|
// least (1,1) pixel size
|
|
|
|
static_cast<sal_Int32>( ::std::max( 1.0,
|
|
|
|
ceil( rSpriteSize.Height ))) );
|
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// create content backbuffer in screen depth
|
2008-06-24 09:56:25 +00:00
|
|
|
BackBufferSharedPtr pBackBuffer( new BackBuffer( rOutDevProvider->getOutDev() ) );
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
pBackBuffer->setSize( aSize );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// create mask backbuffer, with one bit color depth
|
2008-06-24 09:56:25 +00:00
|
|
|
BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(),
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
true ) );
|
|
|
|
pBackBufferMask->setSize( aSize );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// TODO(F1): Implement alpha vdev (could prolly enable
|
|
|
|
// antialiasing again, then)
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// disable font antialiasing (causes ugly shadows otherwise)
|
2008-06-24 09:56:25 +00:00
|
|
|
pBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
|
|
|
pBackBufferMask->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// set mask vdev drawmode, such that everything is painted
|
|
|
|
// black. That leaves us with a binary image, white for
|
|
|
|
// background, black for painted content
|
2008-06-24 09:56:25 +00:00
|
|
|
pBackBufferMask->getOutDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
|
|
|
|
2004-11-26 16:11:13 +00:00
|
|
|
// setup canvas helper
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
// always render into back buffer, don't preserve state (it's
|
|
|
|
// our private VDev, after all), have notion of alpha
|
2008-06-24 09:56:25 +00:00
|
|
|
maCanvasHelper.init( rDevice,
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
pBackBuffer,
|
|
|
|
false,
|
|
|
|
true );
|
|
|
|
maCanvasHelper.setBackgroundOutDev( pBackBufferMask );
|
2004-03-18 09:38:44 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
|
|
|
|
// setup sprite helper
|
2014-02-22 21:20:15 +01:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
|
|
|
|
maSpriteHelper.init( rSpriteSize,
|
2008-06-24 09:56:25 +00:00
|
|
|
rOwningSpriteCanvas,
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
pBackBuffer,
|
|
|
|
pBackBufferMask,
|
|
|
|
bShowSpriteBounds );
|
2007-07-17 13:25:27 +00:00
|
|
|
|
|
|
|
// clear sprite to 100% transparent
|
|
|
|
maCanvasHelper.clear();
|
2004-03-18 09:38:44 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException, std::exception )
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2014-01-14 13:05:02 -02:00
|
|
|
return OUString( "VCLCanvas.CanvasCustomSprite" );
|
2004-03-18 09:38:44 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException, std::exception )
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2014-01-14 13:05:02 -02:00
|
|
|
return cppu::supportsService( this, ServiceName );
|
2004-03-18 09:38:44 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2013-01-07 19:42:36 +01:00
|
|
|
uno::Sequence< OUString > aRet(1);
|
2014-01-14 13:05:02 -02:00
|
|
|
aRet[0] = "com.sun.star.rendering.CanvasCustomSprite";
|
2004-03-18 09:38:44 +00:00
|
|
|
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sprite
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
void CanvasCustomSprite::redraw( OutputDevice& rOutDev,
|
|
|
|
bool bBufferedUpdate ) const
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2010-10-14 23:38:23 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-11-26 16:11:13 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
redraw( rOutDev, maSpriteHelper.getPosPixel(), bBufferedUpdate );
|
2004-03-18 09:38:44 +00:00
|
|
|
}
|
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
void CanvasCustomSprite::redraw( OutputDevice& rOutDev,
|
|
|
|
const ::basegfx::B2DPoint& rOrigOutputPos,
|
|
|
|
bool bBufferedUpdate ) const
|
2004-03-18 09:38:44 +00:00
|
|
|
{
|
2010-10-14 23:38:23 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2004-11-26 16:11:13 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
maSpriteHelper.redraw( rOutDev,
|
|
|
|
rOrigOutputPos,
|
|
|
|
mbSurfaceDirty,
|
|
|
|
bBufferedUpdate );
|
2004-11-26 16:11:13 +00:00
|
|
|
|
INTEGRATION: CWS canvas02 (1.8.2); FILE MERGED
2005/10/08 12:53:51 thb 1.8.2.6: RESYNC: (1.8-1.9); FILE MERGED
2005/09/27 09:22:14 thb 1.8.2.5: #i48939# Removed alpha VDev option from BackBuffer (wasn't used since ages); correctly setting backbuffer size (rounded _up_, like the sprite size itself is calculated, too)
2005/09/22 21:00:53 thb 1.8.2.4: #i48939# Employing faster XOR masking for the special case nontransparent, non-alpha bitmap redraw in backbuffer (incidently, that matches the typical slide transition sprite update)
2005/07/21 14:52:47 thb 1.8.2.3: #i48939# Factored out round up/down to integer; removed backend specific methods from base Sprite interface; removed updateScreen overwrite from SpriteCanvasBase (too much backend specifics need to be passed to HW canvases); now passing the target OutputDevice directly via Sprite::redraw() method in VCL canvas; made XFont -> impl font conversion dynamic cast, too; removed the getSpriteTargetSurface crap from SpriteCanvas
2005/07/03 20:25:14 thb 1.8.2.2: #i48939# Reworked ParametricPolyPolygon, to extract state in an atomic operation; added more state checking 'isXDirty()' methods to canvascustomspritehelper; added various comments and notes
2005/06/17 23:49:49 thb 1.8.2.1: #i48939# Huge refactoring of canvas; as much functionality as possible is now common in a bunch of shared base classes (input checking, locking, sprite redraw, etc.); added scroll update optimization, transparently to all canvas implementations
2005-11-02 11:59:14 +00:00
|
|
|
mbSurfaceDirty = false;
|
2004-11-26 16:11:13 +00:00
|
|
|
}
|
2005-03-30 06:36:15 +00:00
|
|
|
|
|
|
|
bool CanvasCustomSprite::repaint( const GraphicObjectSharedPtr& rGrf,
|
2007-11-01 13:41:02 +00:00
|
|
|
const rendering::ViewState& viewState,
|
|
|
|
const rendering::RenderState& renderState,
|
2005-03-30 06:36:15 +00:00
|
|
|
const ::Point& rPt,
|
|
|
|
const ::Size& rSz,
|
|
|
|
const GraphicAttr& rAttr ) const
|
|
|
|
{
|
2010-10-14 23:38:23 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2005-03-30 06:36:15 +00:00
|
|
|
|
|
|
|
mbSurfaceDirty = true;
|
|
|
|
|
2007-11-01 13:41:02 +00:00
|
|
|
return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr );
|
2005-03-30 06:36:15 +00:00
|
|
|
}
|
2005-04-18 08:10:29 +00:00
|
|
|
|
2004-03-18 09:38:44 +00:00
|
|
|
}
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|