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

201 lines
7.6 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_canvas.hxx"
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 <tools/diagnose_ex.h>
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/verbosetrace.hxx>
#include <rtl/math.hxx>
#include <vcl/outdev.hxx>
#include <vcl/bitmap.hxx>
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 <vcl/alpha.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
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 <basegfx/numeric/ftools.hxx>
#include <canvas/canvastools.hxx>
#include "canvascustomsprite.hxx"
using namespace ::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
{
CanvasCustomSprite::CanvasCustomSprite( const geometry::RealSize2D& rSpriteSize,
rendering::XGraphicDevice& rDevice,
const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
const OutDevProviderSharedPtr& rOutDevProvider,
bool bShowSpriteBounds )
{
ENSURE_OR_THROW( rOwningSpriteCanvas.get() &&
rOutDevProvider,
"CanvasCustomSprite::CanvasCustomSprite(): Invalid 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
// setup back buffer
// -----------------
2005-11-02 11:59:14 +00:00
const ::Size aSize(
static_cast<sal_Int32>( ::std::max( 1.0,
ceil( rSpriteSize.Width ))), // round up to nearest int,
// enforce sprite to have at
// least (1,1) pixel size
static_cast<sal_Int32>( ::std::max( 1.0,
ceil( rSpriteSize.Height ))) );
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
BackBufferSharedPtr pBackBuffer( new BackBuffer( rOutDevProvider->getOutDev() ) );
2005-11-02 11:59:14 +00:00
pBackBuffer->setSize( aSize );
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
BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(),
2005-11-02 11:59:14 +00:00
true ) );
pBackBufferMask->setSize( aSize );
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)
pBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
pBackBufferMask->getOutDev().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
pBackBufferMask->getOutDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
2005-11-02 11:59:14 +00:00
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
// -------------------
2005-11-02 11:59:14 +00:00
// always render into back buffer, don't preserve state (it's
// our private VDev, after all), have notion of alpha
maCanvasHelper.init( rDevice,
2005-11-02 11:59:14 +00:00
pBackBuffer,
false,
true );
maCanvasHelper.setBackgroundOutDev( pBackBufferMask );
2005-11-02 11:59:14 +00:00
// setup sprite helper
// -------------------
maSpriteHelper.init( rSpriteSize,
rOwningSpriteCanvas,
2005-11-02 11:59:14 +00:00
pBackBuffer,
pBackBufferMask,
bShowSpriteBounds );
// clear sprite to 100% transparent
maCanvasHelper.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
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
// forward to parent
2005-11-02 11:59:14 +00:00
CanvasCustomSpriteBaseT::disposing();
}
2005-11-02 11:59:14 +00:00
#define IMPLEMENTATION_NAME "VCLCanvas.CanvasCustomSprite"
#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"
::rtl::OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
2005-11-02 11:59:14 +00:00
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 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
2005-11-02 11:59:14 +00:00
void CanvasCustomSprite::redraw( OutputDevice& rOutDev,
bool bBufferedUpdate ) 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;
2005-11-02 11:59:14 +00:00
redraw( rOutDev, maSpriteHelper.getPosPixel(), bBufferedUpdate );
}
2005-11-02 11:59:14 +00:00
void CanvasCustomSprite::redraw( OutputDevice& rOutDev,
const ::basegfx::B2DPoint& rOrigOutputPos,
bool bBufferedUpdate ) 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;
2005-11-02 11:59:14 +00:00
maSpriteHelper.redraw( rOutDev,
rOrigOutputPos,
mbSurfaceDirty,
bBufferedUpdate );
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
2005-11-02 11:59:14 +00:00
mbSurfaceDirty = 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
}
bool CanvasCustomSprite::repaint( const GraphicObjectSharedPtr& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const
{
tools::LocalGuard aGuard;
mbSurfaceDirty = true;
return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */