Files
libreoffice/canvas/source/vcl/canvascustomsprite.cxx

518 lines
19 KiB
C++
Raw Normal View History

/*************************************************************************
*
* $RCSfile: canvascustomsprite.cxx,v $
*
* $Revision: 1.4 $
*
* last change: $Author: kz $ $Date: 2005-01-21 16:26:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (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.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
#ifndef INCLUDED_RTL_MATH_HXX
#include <rtl/math.hxx>
#endif
#ifndef _SV_OUTDEV_HXX
#include <vcl/outdev.hxx>
#endif
#ifndef _SV_BITMAP_HXX
#include <vcl/bitmap.hxx>
#endif
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#ifndef _SV_ALPHA_HXX
#include <vcl/alpha.hxx>
#endif
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#ifndef _SV_BITMAPEX_HXX
#include <vcl/bitmapex.hxx>
#endif
#ifndef _VCL_CANVASTOOLS_HXX
#include <vcl/canvastools.hxx>
#endif
#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
#include <basegfx/matrix/b2dhommatrix.hxx>
#endif
#ifndef _BGFX_POINT_B2DPOINT_HXX
#include <basegfx/point/b2dpoint.hxx>
#endif
#ifndef _BGFX_TOOLS_CANVASTOOLS_HXX
#include <basegfx/tools/canvastools.hxx>
#endif
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#ifndef _BGFX_NUMERIC_FTOOLS_HXX
#include <basegfx/numeric/ftools.hxx>
#endif
#include <canvas/canvastools.hxx>
#include "canvascustomsprite.hxx"
using namespace ::com::sun::star;
using namespace ::drafts::com::sun::star;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
namespace vclcanvas
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
CanvasCustomSprite::CanvasCustomSprite( const geometry::RealSize2D& rSpriteSize,
const WindowGraphicDevice::ImplRef& rDevice,
const SpriteCanvas::ImplRef& rSpriteCanvas ) :
mpBackBuffer(),
mpBackBufferMask(),
mpSpriteCanvas( rSpriteCanvas ),
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
maContent(),
maPosition(0.0, 0.0),
maSize( ::vcl::unotools::sizeFromRealSize2D( rSpriteSize ) ),
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
mxClipPoly(),
mfAlpha(0.0),
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
mbActive(false)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
ENSURE_AND_THROW( rDevice.get() && rSpriteCanvas.get(),
"CanvasBitmap::CanvasBitmap(): Invalid device or sprite canvas" );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// to prevent truncations due to round-offs
maSize.Width() += 1; maSize.Height() += 1;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// setup graphic device
maCanvasHelper.setGraphicDevice( rDevice );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// setup back buffer
// -----------------
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// create content backbuffer in screen depth
mpBackBuffer.reset( new BackBuffer( *rDevice->getOutDev() ) );
mpBackBuffer->getVirDev().SetOutputSizePixel( maSize );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// create mask backbuffer, with one bit color depth
mpBackBufferMask.reset( new BackBuffer( *rDevice->getOutDev(), true ) );
mpBackBufferMask->getVirDev().SetOutputSizePixel( maSize );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// TODO(F1): Implement alpha vdev (could prolly enable
// antialiasing again, then)
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// disable font antialiasing (causes ugly shadows otherwise)
mpBackBuffer->getVirDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
mpBackBufferMask->getVirDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
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
mpBackBufferMask->getVirDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// setup canvas helper
// -------------------
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// always render into back buffer, don't preserve state
// (it's our private VDev, after all)
maCanvasHelper.setOutDev( mpBackBuffer, false );
maCanvasHelper.setBackgroundOutDev( mpBackBufferMask );
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
CanvasCustomSprite::~CanvasCustomSprite()
{
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::disposing()
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
mpSpriteCanvas.clear();
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// forward to parent
CanvasCustomSprite_Base::disposing();
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::setAlpha( double alpha ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
tools::LocalGuard aGuard;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
if( !mpSpriteCanvas.get() )
return; // we're disposed
::canvas::tools::checkRange(alpha, 0.0, 1.0);
if( alpha != mfAlpha )
{
if( mbActive )
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
mfAlpha = alpha;
}
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::move( const geometry::RealPoint2D& aNewPos,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
if( !mpSpriteCanvas.get() )
return; // we're disposed
::basegfx::B2DHomMatrix aTransform;
::canvas::tools::mergeViewAndRenderTransform(aTransform,
viewState,
renderState);
::basegfx::B2DPoint aPoint( ::basegfx::unotools::b2DPointFromRealPoint2D(aNewPos) );
aPoint *= aTransform;
if( aPoint != maPosition )
{
if( mbActive )
mpSpriteCanvas->moveSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
::vcl::unotools::pointFromB2DPoint( aPoint ) );
maPosition = aPoint;
}
}
void SAL_CALL CanvasCustomSprite::transform( const geometry::AffineMatrix2D& aTransformation ) throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
// TODO(P3): Implement transformed sprites
if( mbActive )
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
}
void SAL_CALL CanvasCustomSprite::clip( const uno::Reference< rendering::XPolyPolygon2D >& xClip ) throw (uno::RuntimeException)
{
tools::LocalGuard aGuard;
mxClipPoly = xClip;
if( mbActive )
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::setPriority( double nPriority ) throw (uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
// TODO(F2): Implement sprite priority
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::show() throw (uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
if( !mpSpriteCanvas.get() )
return; // we're disposed
if( !mbActive )
{
mpSpriteCanvas->showSprite( Sprite::ImplRef( this ) );
mbActive = true;
if( mfAlpha != 0.0 )
{
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
}
}
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
void SAL_CALL CanvasCustomSprite::hide() throw (uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
if( !mpSpriteCanvas.get() )
return; // we're disposed
if( mbActive )
{
mpSpriteCanvas->hideSprite( Sprite::ImplRef( this ) );
mbActive = false;
if( mfAlpha != 0.0 )
{
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
}
}
}
uno::Reference< rendering::XCanvas > SAL_CALL CanvasCustomSprite::getContentCanvas() throw (uno::RuntimeException)
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
if( !mpSpriteCanvas.get() || !mpBackBuffer.get() )
uno::Reference< rendering::XCanvas >(); // we're disposed
if( mbActive )
{
// the client is about to render into the sprite. Thus,
// potentially the whole sprite area has changed.
mpSpriteCanvas->updateSprite( Sprite::ImplRef( this ),
::vcl::unotools::pointFromB2DPoint( maPosition ),
Rectangle( ::vcl::unotools::pointFromB2DPoint( maPosition ),
maSize ) );
}
// clear surface
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
OutputDevice& rOutDev( mpBackBuffer->getOutDev() );
rOutDev.EnableMapMode( FALSE );
rOutDev.SetFillColor( Color( COL_WHITE ) );
rOutDev.SetLineColor();
rOutDev.DrawRect( Rectangle(Point(), maSize) );
OutputDevice& rMaskOutDev( mpBackBufferMask->getOutDev() );
rMaskOutDev.SetDrawMode( DRAWMODE_DEFAULT );
rMaskOutDev.EnableMapMode( FALSE );
rMaskOutDev.SetFillColor( Color( COL_WHITE ) );
rMaskOutDev.SetLineColor();
rMaskOutDev.DrawRect( Rectangle(Point(), maSize) );
rMaskOutDev.SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// surface content has changed (we cleared it, at least)
mbSurfaceDirty = true;
return this;
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#define SERVICE_NAME "drafts.com.sun.star.rendering.CanvasCustomSprite"
::rtl::OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CANVASCUSTOMSPRITE_IMPLEMENTATION_NAME ) );
}
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );
}
uno::Sequence< ::rtl::OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< ::rtl::OUString > aRet(1);
aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
return aRet;
}
// Sprite
void CanvasCustomSprite::redraw( OutputDevice& rTargetSurface ) const
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
redraw( rTargetSurface,
::vcl::unotools::pointFromB2DPoint( maPosition ) );
}
void CanvasCustomSprite::redraw( OutputDevice& rTargetSurface, const Point& rOutputPos ) const
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
if( !mpSpriteCanvas.get() || !mpBackBuffer.get() )
return; // we're disposed
// log output pos in device pixel
VERBOSE_TRACE( "CanvasCustomSprite::redraw(): output pos is (%f, %f)",
maPosition.getX(),
maPosition.getY() );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// Prepare the outdev
rTargetSurface.EnableMapMode( FALSE );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
rTargetSurface.SetClipRegion();
if( mbActive &&
!::basegfx::fTools::equalZero( mfAlpha ) )
{
const Point aEmptyPoint;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// TODO(F3): Support for alpha-VDev
// apply clip (if any)
if( mxClipPoly.is() )
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
{
const ::basegfx::B2DPolyPolygon& rClipPoly( tools::polyPolygonFromXPolyPolygon2D( mxClipPoly ) );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
if( rClipPoly.count() )
{
PolyPolygon aPolyPoly( rClipPoly );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
aPolyPoly.Translate( rOutputPos );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
const Region aClipRegion( aPolyPoly );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
rTargetSurface.SetClipRegion( aClipRegion );
}
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// To we have to update our bitmaps (necessary when virdev was
// painted to)?
if( mbSurfaceDirty ||
maContent->IsEmpty() )
{
mbSurfaceDirty = false;
Bitmap aBmp( mpBackBuffer->getOutDev().GetBitmap( aEmptyPoint, maSize ) );
Bitmap aMask( mpBackBufferMask->getOutDev().GetBitmap( aEmptyPoint, maSize ) );
if( aMask.GetBitCount() != 1 )
{
OSL_ENSURE(false,
"CanvasCustomSprite::redraw(): Mask bitmap is not monochrome (performance!)");
aMask.MakeMono(255);
}
maContent = BitmapEx( aBmp.CreateDisplayBitmap( &rTargetSurface ),
aMask.CreateDisplayBitmap( &rTargetSurface ) );
}
if( ::rtl::math::approxEqual(mfAlpha, 1.0) )
{
// fully opaque -> copy to output
rTargetSurface.DrawBitmapEx( rOutputPos, *maContent );
}
else
{
// TODO(P3): Switch to OutputDevice::DrawTransparent()
// here
// draw semi-transparent
BYTE nColor( static_cast<UINT8>( ::basegfx::fround( 255.0*(1.0 - mfAlpha) + .5) ) );
AlphaMask aAlpha( maSize, &nColor );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// mask out fully transparent areas
aAlpha.Replace( maContent->GetMask(), 255 );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// alpha-blend to output
rTargetSurface.DrawBitmapEx( rOutputPos,
BitmapEx( maContent->GetBitmap(),
aAlpha ) );
}
rTargetSurface.SetClipRegion();
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
#if defined(VERBOSE) && defined(DBG_UTIL)
// Paint little red sprite area markers
rTargetSurface.SetLineColor( Color( 255,0,0 ) );
rTargetSurface.SetFillColor();
rTargetSurface.DrawLine( Point( rOutputPos.X(),
rOutputPos.Y() ),
Point( rOutputPos.X()+4,
rOutputPos.Y() ) );
rTargetSurface.DrawLine( Point( rOutputPos.X(),
rOutputPos.Y() ),
Point( rOutputPos.X(),
rOutputPos.Y()+4 ) );
rTargetSurface.DrawLine( Point( rOutputPos.X()+maSize.Width()-5,
rOutputPos.Y() ),
Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y() ) );
rTargetSurface.DrawLine( Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y() ),
Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y()+4 ) );
rTargetSurface.DrawLine( Point( rOutputPos.X(),
rOutputPos.Y()+maSize.Height()-1 ),
Point( rOutputPos.X()+4,
rOutputPos.Y()+maSize.Height()-1 ) );
rTargetSurface.DrawLine( Point( rOutputPos.X(),
rOutputPos.Y()+maSize.Height()-5 ),
Point( rOutputPos.X(),
rOutputPos.Y()+maSize.Height()-1 ) );
rTargetSurface.DrawLine( Point( rOutputPos.X()+maSize.Width()-5,
rOutputPos.Y()+maSize.Height()-1 ),
Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y()+maSize.Height()-1 ) );
rTargetSurface.DrawLine( Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y()+maSize.Height()-5 ),
Point( rOutputPos.X()+maSize.Width()-1,
rOutputPos.Y()+maSize.Height()-1 ) );
#endif
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
::basegfx::B2DPoint CanvasCustomSprite::getPos() const
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
return maPosition;
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
::basegfx::B2DSize CanvasCustomSprite::getSize() const
{
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
tools::LocalGuard aGuard;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:28 thb 1.2.2.20: #118514# Canvas module reorg 2004/10/26 23:36:58 thb 1.2.2.19: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/25 19:07:44 thb 1.2.2.18: #i20518# Improved canvas performance for sprite rendering 2004/10/11 00:00:05 thb 1.2.2.17: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/09 14:44:31 thb 1.2.2.16: #110496# Fixed minor map file issues; changed order of canvas instantiations in canvas factory; added sprite clipping to DirectX canvas 2004/09/06 13:33:45 thb 1.2.2.15: #110496# Improved documentation 2004/09/01 10:50:36 thb 1.2.2.14: #110496# Optimized sprite repaint (for static sprite content) 2004/08/27 18:46:16 thb 1.2.2.13: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/26 12:23:40 thb 1.2.2.12: #110496# Fixed a nasty update bug (hidden sprites where not cleared, when not part of other update areas by chance) 2004/08/20 00:27:10 thb 1.2.2.11: #110496# Added TODO comment 2004/08/06 14:00:09 thb 1.2.2.10: #110496# Adapted XSprite API to match reality (the way it was simply wasn't logical). Implemented sprite clipping 2004/08/02 17:50:59 thb 1.2.2.9: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 20:38:27 thb 1.2.2.8: #110496# Adapted to setData/setPixel API change 2004/07/22 18:40:42 thb 1.2.2.7: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:55 thb 1.2.2.6: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/06/17 10:33:25 thb 1.2.2.5: #110496# Handle huge shrinks correctly for font scaling; added some more debug code 2004/05/27 20:51:24 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:52 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:24 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:57:57 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:11:13 +00:00
// TODO(Q1): Use AW's wrappers once resynced
return ::basegfx::B2DSize( maSize.Width(),
maSize.Height() );
}
}