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

1453 lines
63 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
*
* This file incorporates work covered by the following license notice:
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <rtl/math.hxx>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/util/Endianness.hpp>
#include <com/sun/star/rendering/TextDirection.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/drawing/LineCap.hpp>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <tools/poly.hxx>
#include <vcl/window.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/canvastools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/range/b2drectangle.hxx>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <utility>
#include <comphelper/sequence.hxx>
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
#include <canvas/canvastools.hxx>
#include "textlayout.hxx"
#include "canvashelper.hxx"
#include "canvasbitmap.hxx"
#include "impltools.hxx"
#include "canvasfont.hxx"
using namespace ::com::sun::star;
namespace vclcanvas
{
namespace
{
basegfx::B2DLineJoin b2DJoineFromJoin( sal_Int8 nJoinType )
{
switch( nJoinType )
{
case rendering::PathJoinType::NONE:
return basegfx::B2DLINEJOIN_NONE;
case rendering::PathJoinType::MITER:
return basegfx::B2DLINEJOIN_MITER;
case rendering::PathJoinType::ROUND:
return basegfx::B2DLINEJOIN_ROUND;
case rendering::PathJoinType::BEVEL:
return basegfx::B2DLINEJOIN_BEVEL;
default:
ENSURE_OR_THROW( false,
"b2DJoineFromJoin(): Unexpected join type" );
}
return basegfx::B2DLINEJOIN_NONE;
}
drawing::LineCap unoCapeFromCap( sal_Int8 nCapType)
{
switch ( nCapType)
{
case rendering::PathCapType::BUTT:
return drawing::LineCap_BUTT;
case rendering::PathCapType::ROUND:
return drawing::LineCap_ROUND;
case rendering::PathCapType::SQUARE:
return drawing::LineCap_SQUARE;
default:
ENSURE_OR_THROW( false,
"unoCapeFromCap(): Unexpected cap type" );
}
return drawing::LineCap_BUTT;
}
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
CanvasHelper::CanvasHelper() :
mpDevice(),
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mpProtectedOutDev(),
mpOutDev(),
mp2ndOutDev(),
mbHaveAlpha( false )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
}
void CanvasHelper::disposing()
{
mpDevice = NULL;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mpProtectedOutDev.reset();
mpOutDev.reset();
mp2ndOutDev.reset();
}
void CanvasHelper::init( rendering::XGraphicDevice& rDevice,
const OutDevProviderSharedPtr& rOutDev,
bool bProtect,
bool bHaveAlpha )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// cast away const, need to change refcount (as this is
// ~invisible to client code, still logically const)
mpDevice = &rDevice;
mbHaveAlpha = bHaveAlpha;
setOutDev( rOutDev, bProtect );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
void CanvasHelper::setOutDev( const OutDevProviderSharedPtr& rOutDev,
bool bProtect )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( bProtect )
mpProtectedOutDev = rOutDev;
else
mpProtectedOutDev.reset();
mpOutDev = rOutDev;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
void CanvasHelper::setBackgroundOutDev( const OutDevProviderSharedPtr& rOutDev )
{
mp2ndOutDev = rOutDev;
mp2ndOutDev->getOutDev().EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
mp2ndOutDev->getOutDev().SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
void CanvasHelper::clear()
{
// are we disposed?
if( mpOutDev )
{
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev.SetLineColor( COL_WHITE );
rOutDev.SetFillColor( COL_WHITE );
rOutDev.SetClipRegion();
rOutDev.DrawRect( Rectangle( Point(),
rOutDev.GetOutputSizePixel()) );
if( mp2ndOutDev )
{
OutputDevice& rOutDev2( mp2ndOutDev->getOutDev() );
rOutDev2.SetDrawMode( DRAWMODE_DEFAULT );
rOutDev2.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev2.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
rOutDev2.SetLineColor( COL_WHITE );
rOutDev2.SetFillColor( COL_WHITE );
rOutDev2.SetClipRegion();
rOutDev2.DrawRect( Rectangle( Point(),
rOutDev2.GetOutputSizePixel()) );
rOutDev2.SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
}
}
}
void CanvasHelper::drawPoint( const rendering::XCanvas* ,
const geometry::RealPoint2D& aPoint,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// are we disposed?
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// nope, render
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, LINE_COLOR );
const Point aOutPoint( tools::mapRealPoint2D( aPoint,
viewState, renderState ) );
// TODO(F1): alpha
mpOutDev->getOutDev().DrawPixel( aOutPoint );
if( mp2ndOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mp2ndOutDev->getOutDev().DrawPixel( aOutPoint );
}
}
void CanvasHelper::drawLine( const rendering::XCanvas* ,
const geometry::RealPoint2D& aStartRealPoint2D,
const geometry::RealPoint2D& aEndRealPoint2D,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// are we disposed?
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// nope, render
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, LINE_COLOR );
const Point aStartPoint( tools::mapRealPoint2D( aStartRealPoint2D,
viewState, renderState ) );
const Point aEndPoint( tools::mapRealPoint2D( aEndRealPoint2D,
viewState, renderState ) );
// TODO(F2): alpha
mpOutDev->getOutDev().DrawLine( aStartPoint, aEndPoint );
if( mp2ndOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mp2ndOutDev->getOutDev().DrawLine( aStartPoint, aEndPoint );
}
}
void CanvasHelper::drawBezier( const rendering::XCanvas* ,
const geometry::RealBezierSegment2D& aBezierSegment,
const geometry::RealPoint2D& _aEndPoint,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, LINE_COLOR );
const Point& rStartPoint( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.Px,
aBezierSegment.Py),
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
viewState, renderState ) );
const Point& rCtrlPoint1( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C1x,
aBezierSegment.C1y),
viewState, renderState ) );
const Point& rCtrlPoint2( tools::mapRealPoint2D( geometry::RealPoint2D(aBezierSegment.C2x,
aBezierSegment.C2y),
viewState, renderState ) );
const Point& rEndPoint( tools::mapRealPoint2D( _aEndPoint,
viewState, renderState ) );
::Polygon aPoly(4);
aPoly.SetPoint( rStartPoint, 0 );
aPoly.SetFlags( 0, POLY_NORMAL );
aPoly.SetPoint( rCtrlPoint1, 1 );
aPoly.SetFlags( 1, POLY_CONTROL );
aPoly.SetPoint( rCtrlPoint2, 2 );
aPoly.SetFlags( 2, POLY_CONTROL );
aPoly.SetPoint( rEndPoint, 3 );
aPoly.SetFlags( 3, POLY_NORMAL );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): alpha
mpOutDev->getOutDev().DrawPolygon( aPoly );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolygon( aPoly );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xPolyPolygon.is(),
"polygon is NULL");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, LINE_COLOR );
const ::basegfx::B2DPolyPolygon& rPolyPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
const ::tools::PolyPolygon aPolyPoly( tools::mapPolyPolygon( rPolyPoly, viewState, renderState ) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( rPolyPoly.isClosed() )
{
mpOutDev->getOutDev().DrawPolyPolygon( aPolyPoly );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly );
}
else
{
// mixed open/closed state. Cannot render open polygon
// via DrawPolyPolygon(), since that implicitley
// closed every polygon. OTOH, no need to distinguish
// further and render closed polygons via
// DrawPolygon(), and open ones via DrawPolyLine():
// closed polygons will simply already contain the
// closing segment.
sal_uInt16 nSize( aPolyPoly.Count() );
for( sal_uInt16 i=0; i<nSize; ++i )
{
mpOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolyLine( aPolyPoly[i] );
}
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
// TODO(P1): Provide caching here.
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const rendering::StrokeAttributes& strokeAttributes )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xPolyPolygon.is(),
"polygon is NULL");
if( mpOutDev )
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
::basegfx::B2DHomMatrix aMatrix;
::canvas::tools::mergeViewAndRenderTransform(aMatrix, viewState, renderState);
::basegfx::B2DSize aLinePixelSize(strokeAttributes.StrokeWidth,
strokeAttributes.StrokeWidth);
aLinePixelSize *= aMatrix;
::basegfx::B2DPolyPolygon aPolyPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
if( aPolyPoly.areControlPointsUsed() )
{
// AW: Not needed for ApplyLineDashing anymore; should be removed
aPolyPoly = ::basegfx::tools::adaptiveSubdivideByAngle(aPolyPoly);
}
// apply dashing, if any
if( strokeAttributes.DashArray.getLength() )
{
const ::std::vector<double>& aDashArray(
::comphelper::sequenceToContainer< ::std::vector<double> >(strokeAttributes.DashArray) );
::basegfx::B2DPolyPolygon aDashedPolyPoly;
for( sal_uInt32 i=0; i<aPolyPoly.count(); ++i )
{
// AW: new interface; You may also get gaps in the same run now
basegfx::tools::applyLineDashing(aPolyPoly.getB2DPolygon(i), aDashArray, &aDashedPolyPoly);
//aDashedPolyPoly.append(
// ::basegfx::tools::applyLineDashing( aPolyPoly.getB2DPolygon(i),
// aDashArray ) );
}
aPolyPoly = aDashedPolyPoly;
}
::basegfx::B2DPolyPolygon aStrokedPolyPoly;
if( aLinePixelSize.getLength() < 1.42 )
{
// line width < 1.0 in device pixel, thus, output as a
// simple hairline poly-polygon
setupOutDevState( viewState, renderState, LINE_COLOR );
aStrokedPolyPoly = aPolyPoly;
}
else
{
// render as a 'thick' line
setupOutDevState( viewState, renderState, FILL_COLOR );
for( sal_uInt32 i=0; i<aPolyPoly.count(); ++i )
{
// TODO(F2): Use MiterLimit from StrokeAttributes,
// need to convert it here to angle.
// TODO(F2): Also use Cap settings from
// StrokeAttributes, the
// createAreaGeometryForLineStartEnd() method does not
// seem to fit very well here
// AW: New interface, will create bezier polygons now
aStrokedPolyPoly.append(basegfx::tools::createAreaGeometry(
aPolyPoly.getB2DPolygon(i),
strokeAttributes.StrokeWidth*0.5,
re-base on ALv2 code. Includes (at least) relevant parts of: linecap: Reintegrating finished LineCap feature Patch contributed by Regina Henschel http://svn.apache.org/viewvc?view=revision&revision=1232507 Patches contributed by Sven Jacobi impress212: #i81610# fixed animation export http://svn.apache.org/viewvc?view=revision&revision=1167620 impress212: drawinglayer gbuild environment changes http://svn.apache.org/viewvc?view=revision&revision=1167627 http://svn.apache.org/viewvc?view=revision&revision=1167628 impress212: DffPropSet -> minor code improvements, removing table http://svn.apache.org/viewvc?view=revision&revision=1167634 impress212: #158494# fixed excel import (text rotation) http://svn.apache.org/viewvc?view=revision&revision=1167638 Patches contributed by Armin Le Grand Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement http://svn.apache.org/viewvc?view=revision&revision=1220836 #118728# changed indentifying definitions for Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1229961 #118838# LineGeometry creation for complicated cases optimized to create single Polygons http://svn.apache.org/viewvc?view=revision&revision=1236232 #119176# corrected file type detection for SVG for svg files without xml header http://svn.apache.org/viewvc?view=revision&revision=1309445 #118728# Extended Svg file detection http://svn.apache.org/viewvc?view=revision&revision=1230531 #118529# solve break converters and convert commands for OLEs and images http://svn.apache.org/viewvc?view=revision&revision=1186168 svg: added WaE changes from branch svgreplacement to trunc http://svn.apache.org/viewvc?view=revision&revision=1222974 svg: corrected missing member initialization http://svn.apache.org/viewvc?view=revision&revision=1226134 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert metafiles to bitmapEx ... http://svn.apache.org/viewvc?view=revision&revision=1293316 fix for #118525#: removed no longer used variable maOriginalMapMode, one more exception eliminated http://svn.apache.org/viewvc?view=revision&revision=1227097 #16758# Added buffering to the VDev usages of the VclProcessor2D derivates... http://svn.apache.org/viewvc?view=revision&revision=1229521 #116758# Secured VDev buffer device to Vcl deinit http://svn.apache.org/viewvc?view=revision&revision=1230574 #116758# added remembering allocated VDevs for VDevBuffer to be able to also delete these when vcl goes down; it should never happen, but You never know http://svn.apache.org/viewvc?view=revision&revision=1230927 #118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive representation instead of TransparencePrimitive2D http://svn.apache.org/viewvc?view=revision&revision=1231198 #118822# secured 3D geometry creation (slices) by subdividing the 2D source polyPolygon early http://svn.apache.org/viewvc?view=revision&revision=1234749 #118829# enhanced Svg gradient quality, obstacles avoided http://svn.apache.org/viewvc?view=revision&revision=1235361 #118834# Unified usage of TextBreakupHelper as single tooling class for i18n text primitive breakup http://svn.apache.org/viewvc?view=revision&revision=1236110 #118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action http://svn.apache.org/viewvc?view=revision&revision=1237656 #118824# coreccted mirroring and boundrect when the graphicmanager is used for bitmap output http://svn.apache.org/viewvc?view=revision&revision=1240097 #115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for various optimization scenarios http://svn.apache.org/viewvc?view=revision&revision=1241434 #118783# Corrected errors in ID strings, corrected Svg line/fill export, corrected polygon close state http://svn.apache.org/viewvc?view=revision&revision=1232006 #118796# corrected null-pointer usage in SVG text exporter http://svn.apache.org/viewvc?view=revision&revision=1240262 #118729# Use GraphicStreamUrl and GraphicUrl to allow multi image import with linked graphics, too http://svn.apache.org/viewvc?view=revision&revision=1229962 #118898# corrected error in GDIMetaFile::GetBoundRect in handling MetaFloatTransparentAction http://svn.apache.org/viewvc?view=revision&revision=1293349 #118855# Corrected handling of possibly created empty clipRegions after PolyPolygon clipping http://svn.apache.org/viewvc?view=revision&revision=1237725 #115962# Better (but not yet optimal, see comments in task) handling of MetaFloatTransparentAction in PDF export http://svn.apache.org/viewvc?view=revision&revision=1241078 IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ... http://svn.apache.org/viewvc?view=revision&revision=1200879 118779# Added svg content streaming in/out to ImpGraphic stream operators http://svn.apache.org/viewvc?view=revision&revision=1231908 linecap: correctons for WaE and mac drawing http://svn.apache.org/viewvc?view=revision&revision=1232793 svg: uses current system Dpi for Svg replacement image creation http://svn.apache.org/viewvc?view=revision&revision=1233948 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1394326 Remove duplicate header includes. cws mba34issues01: #i117720#: convert assertion into warning http://svn.apache.org/viewvc?view=revision&revision=1172352 118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand. http://svn.apache.org/viewvc?view=revision&revision=1182166 cws mba34issues01: #i117714#: remove assertion http://svn.apache.org/viewvc?view=revision&revision=1172357 Patch contributed by Jurgen Schmidt add some additional checks to ensure proper reading operations http://svn.apache.org/viewvc?view=revision&revision=1209022 mostly prefer our stream / bounds checking work. Patches contributed by Herbert Duerr #i118816# add clarifying comment regarding Font::*Color*() methods http://svn.apache.org/viewvc?view=revision&revision=1233833 extend macro->string handling for empty strings http://svn.apache.org/viewvc?view=revision&revision=1175801 avoid magic constants for SALCOLOR_NONE http://svn.apache.org/viewvc?view=revision&revision=1177543 initialize slant properly in ImplFontMetricData constructor (author=iorsh) http://svn.apache.org/viewvc?view=revision&revision=1177551 #i118675# make check for extension updates more stable http://svn.apache.org/viewvc?view=revision&revision=1214797 #a118617# remove VBasicEventListener.dll binary There are no known users depending on its CLSID http://svn.apache.org/viewvc?view=revision&revision=1203697 Patches contributed by Ariel Constenla-Haile Fix build breaker on Linux/gcc http://svn.apache.org/viewvc?view=revision&revision=1221104 Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG http://svn.apache.org/viewvc?view=revision&revision=1215559 Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider instances of <SwFlyDrawObj> http://svn.apache.org/viewvc?view=revision&revision=1172120 sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 gnumake4 work variously from Hans-Joachim Lankenau http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1396782 http://svn.apache.org/viewvc?view=revision&revision=1394707 plus some amount of re-splitting of legacy headers. Patch contributed by Pavel Janik WaE: Remove unused variables. http://svn.apache.org/viewvc?view=revision&revision=1230697 Patches contributed by Takashi Ono mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 mingwport35: i#117795: MinGW port fix for vcl2gnumake http://svn.apache.org/viewvc?view=revision&revision=1172091 Patch contributed by Christian Lippka impress212: #i98044# re enable Text menu for outline and title shapes http://svn.apache.org/viewvc?view=revision&revision=1167639 Patch contributed by Andre Fischer 118674: Made category B code optional and disabled by default. http://svn.apache.org/viewvc?view=revision&revision=1215131 118881: Ignore empty paragraphs after bullets. http://svn.apache.org/viewvc?view=revision&revision=1296205 Patches contributed by Philipp Lohmann ooo340fixes: #i117780# use rtl allocator http://svn.apache.org/viewvc?view=revision&revision=1172087 ooo34gsl02: #i117807# fix an off by one error (index actually inside the pfb section header) http://svn.apache.org/viewvc?view=revision&revision=1167576 various cleanups, related compilation fixes, warning cleanups, re-working of obsolete stl template pieces to use boost instead, changed string classes, re-adapt KDE about data, about dialog, fixing warnings, and other fixes & improvements. Disable svg import / render for about/ branding code-paths for now. Restore full icon theme set. Remove OS/2 conditionals and sources. Remove conflicting gtk/full-screen monitors support. Retain existing svg rasterizer files - temporarily disabled. Standardize stringificaiton and fixup dllpostfix issues. Rename SvgGradientHelper::== to equalTo to avoid overloading issues. Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01:00
b2DJoineFromJoin(strokeAttributes.JoinType),
unoCapeFromCap(strokeAttributes.StartCapType)
));
//aStrokedPolyPoly.append(
// ::basegfx::tools::createAreaGeometryForPolygon( aPolyPoly.getB2DPolygon(i),
// strokeAttributes.StrokeWidth*0.5,
// b2DJoineFromJoin(strokeAttributes.JoinType) ) );
}
}
// transform only _now_, all the StrokeAttributes are in
// user coordinates.
aStrokedPolyPoly.transform( aMatrix );
const ::tools::PolyPolygon aVCLPolyPoly( aStrokedPolyPoly );
// TODO(F2): When using alpha here, must handle that via
// temporary surface or somesuch.
// Note: the generated stroke poly-polygon is NOT free of
// self-intersections. Therefore, if we would render it
// via OutDev::DrawPolyPolygon(), on/off fill would
// generate off areas on those self-intersections.
sal_uInt16 nSize( aVCLPolyPoly.Count() );
for( sal_uInt16 i=0; i<nSize; ++i )
{
if( aStrokedPolyPoly.getB2DPolygon( i ).isClosed() ) {
mpOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawPolygon( aVCLPolyPoly[i] );
} else {
const sal_uInt16 nPolySize = aVCLPolyPoly[i].GetSize();
if( nPolySize ) {
Point rPrevPoint = aVCLPolyPoly[i].GetPoint( 0 );
Point rPoint;
for( sal_uInt16 j=1; j<nPolySize; j++ ) {
rPoint = aVCLPolyPoly[i].GetPoint( j );
mpOutDev->getOutDev().DrawLine( rPrevPoint, rPoint );
if( mp2ndOutDev )
mp2ndOutDev->getOutDev().DrawLine( rPrevPoint, rPoint );
rPrevPoint = rPoint;
}
}
}
}
}
// TODO(P1): Provide caching here.
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& ,
const rendering::ViewState& ,
const rendering::RenderState& ,
const uno::Sequence< rendering::Texture >& ,
const rendering::StrokeAttributes& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& ,
const rendering::ViewState& ,
const rendering::RenderState& ,
const uno::Sequence< rendering::Texture >& ,
const uno::Reference< geometry::XMapping2D >& ,
const rendering::StrokeAttributes& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& ,
const rendering::ViewState& ,
const rendering::RenderState& ,
const rendering::StrokeAttributes& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
return uno::Reference< rendering::XPolyPolygon2D >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xPolyPolygon.is(),
"polygon is NULL");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
const int nTransparency( setupOutDevState( viewState, renderState, FILL_COLOR ) );
::basegfx::B2DPolyPolygon aB2DPolyPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
aB2DPolyPoly.setClosed(true); // ensure closed poly, otherwise VCL does not fill
const ::tools::PolyPolygon aPolyPoly( tools::mapPolyPolygon(
aB2DPolyPoly,
viewState, renderState ) );
const bool bSourceAlpha( renderState.CompositeOperation == rendering::CompositeOperation::SOURCE );
if( !nTransparency || bSourceAlpha )
{
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mpOutDev->getOutDev().DrawPolyPolygon( aPolyPoly );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
else
{
const int nTransPercent( (nTransparency * 100 + 128) / 255 ); // normal rounding, no truncation here
mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mp2ndOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// HACK. Normally, CanvasHelper does not care about
// actually what mp2ndOutDev is... well, here we do &
// assume a 1bpp target - everything beyond 97%
// transparency is fully transparent
if( nTransparency < 253 )
{
mp2ndOutDev->getOutDev().SetFillColor( COL_BLACK );
mp2ndOutDev->getOutDev().DrawPolyPolygon( aPolyPoly );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
// TODO(P1): Provide caching here.
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& ,
const rendering::ViewState& ,
const rendering::RenderState& ,
const uno::Sequence< rendering::Texture >& ,
const uno::Reference< geometry::XMapping2D >& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* ,
const rendering::FontRequest& fontRequest,
const uno::Sequence< beans::PropertyValue >& extraFontProperties,
const geometry::Matrix2D& fontMatrix )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( mpOutDev && mpDevice )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// TODO(F2): font properties and font matrix
return uno::Reference< rendering::XCanvasFont >(
new CanvasFont(fontRequest, extraFontProperties, fontMatrix,
*mpDevice, mpOutDev) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
return uno::Reference< rendering::XCanvasFont >();
}
uno::Sequence< rendering::FontInfo > CanvasHelper::queryAvailableFonts( const rendering::XCanvas* ,
const rendering::FontInfo& ,
const uno::Sequence< beans::PropertyValue >& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// TODO(F2)
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Sequence< rendering::FontInfo >();
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawText( const rendering::XCanvas* ,
const rendering::StringContext& text,
const uno::Reference< rendering::XCanvasFont >& xFont,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
sal_Int8 textDirection )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xFont.is(),
"font is NULL");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
::Point aOutpos;
if( !setupTextOutput( aOutpos, viewState, renderState, xFont ) )
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// change text direction and layout mode
ComplexTextLayoutMode nLayoutMode(TEXT_LAYOUT_DEFAULT);
switch( textDirection )
{
case rendering::TextDirection::WEAK_LEFT_TO_RIGHT:
// FALLTHROUGH intended
case rendering::TextDirection::STRONG_LEFT_TO_RIGHT:
nLayoutMode |= TEXT_LAYOUT_BIDI_STRONG;
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_LEFT;
break;
case rendering::TextDirection::WEAK_RIGHT_TO_LEFT:
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL;
// FALLTHROUGH intended
case rendering::TextDirection::STRONG_RIGHT_TO_LEFT:
nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG;
nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_RIGHT;
break;
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): alpha
mpOutDev->getOutDev().SetLayoutMode( nLayoutMode );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mpOutDev->getOutDev().DrawText( aOutpos,
text.Text,
::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mp2ndOutDev )
{
mp2ndOutDev->getOutDev().SetLayoutMode( nLayoutMode );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mp2ndOutDev->getOutDev().DrawText( aOutpos,
text.Text,
::canvas::tools::numeric_cast<sal_uInt16>(text.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(text.Length) );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* ,
const uno::Reference< rendering::XTextLayout >& xLayoutedText,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xLayoutedText.is(),
"layout is NULL");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
TextLayout* pTextLayout = dynamic_cast< TextLayout* >( xLayoutedText.get() );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( pTextLayout )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( mpOutDev )
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
// TODO(T3): Race condition. We're taking the font
// from xLayoutedText, and then calling draw() at it,
// without exclusive access. Move setupTextOutput(),
// e.g. to impltools?
::Point aOutpos;
if( !setupTextOutput( aOutpos, viewState, renderState, xLayoutedText->getFont() ) )
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// TODO(F2): What about the offset scalings?
// TODO(F2): alpha
pTextLayout->draw( mpOutDev->getOutDev(), aOutpos, viewState, renderState );
if( mp2ndOutDev )
pTextLayout->draw( mp2ndOutDev->getOutDev(), aOutpos, viewState, renderState );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
else
{
ENSURE_ARG_OR_THROW( false,
"TextLayout not compatible with this canvas" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmap( const rendering::XCanvas* pCanvas,
const uno::Reference< rendering::XBitmap >& xBitmap,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
bool bModulateColors )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_ARG_OR_THROW( xBitmap.is(),
"bitmap is NULL");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
::canvas::tools::verifyInput( renderState,
BOOST_CURRENT_FUNCTION,
mpDevice,
4,
bModulateColors ? 3 : 0 );
if( mpOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, IGNORE_COLOR );
::basegfx::B2DHomMatrix aMatrix;
::canvas::tools::mergeViewAndRenderTransform(aMatrix, viewState, renderState);
::basegfx::B2DPoint aOutputPos( 0.0, 0.0 );
aOutputPos *= aMatrix;
BitmapEx aBmpEx( tools::bitmapExFromXBitmap(xBitmap) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): Implement modulation again for other color
// channels (currently, works only for alpha). Note: this
// is already implemented in transformBitmap()
if( bModulateColors &&
renderState.DeviceColor.getLength() > 3 )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// optimize away the case where alpha modulation value
// is 1.0 - we then simply switch off modulation at all
bModulateColors = !::rtl::math::approxEqual(
renderState.DeviceColor[3], 1.0);
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
// check whether we can render bitmap as-is: must not
// modulate colors, matrix must either be the identity
// transform (that's clear), _or_ contain only
// translational components.
if( !bModulateColors &&
(aMatrix.isIdentity() ||
(::basegfx::fTools::equalZero( aMatrix.get(0,1) ) &&
::basegfx::fTools::equalZero( aMatrix.get(1,0) ) &&
::rtl::math::approxEqual(aMatrix.get(0,0), 1.0) &&
::rtl::math::approxEqual(aMatrix.get(1,1), 1.0)) ) )
{
// optimized case: identity matrix, or only
// translational components.
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mpOutDev->getOutDev().DrawBitmapEx( ::vcl::unotools::pointFromB2DPoint( aOutputPos ),
aBmpEx );
if( mp2ndOutDev )
{
// HACK. Normally, CanvasHelper does not care about
// actually what mp2ndOutDev is... well, here we do &
// assume a 1bpp target - everything beyond 97%
// transparency is fully transparent
if( aBmpEx.IsAlpha() )
{
Bitmap aMask( aBmpEx.GetAlpha().GetBitmap() );
aMask.MakeMono( 253 );
aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMask );
}
else if( aBmpEx.IsTransparent() )
{
aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aBmpEx.GetMask() );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mp2ndOutDev->getOutDev().DrawBitmapEx( ::vcl::unotools::pointFromB2DPoint( aOutputPos ),
aBmpEx );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// Returning a cache object is not useful, the XBitmap
// itself serves this purpose
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
else
{
// Matrix contains non-trivial transformation (or
// color modulation is requested), decompose to check
// whether GraphicObject suffices
::basegfx::B2DVector aScale;
double nRotate;
double nShearX;
aMatrix.decompose( aScale, aOutputPos, nRotate, nShearX );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
GraphicAttr aGrfAttr;
GraphicObjectSharedPtr pGrfObj;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
::Size aBmpSize( aBmpEx.GetSizePixel() );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// setup alpha modulation
if( bModulateColors )
{
const double nAlphaModulation( renderState.DeviceColor[3] );
// TODO(F1): Note that the GraphicManager has a
// subtle difference in how it calculates the
// resulting alpha value: it's using the inverse
// alpha values (i.e. 'transparency'), and
// calculates transOrig + transModulate, instead
// of transOrig + transModulate -
// transOrig*transModulate (which would be
// equivalent to the origAlpha*modulateAlpha the
// DX canvas performs)
aGrfAttr.SetTransparency(
static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - nAlphaModulation ) ) ) );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( ::basegfx::fTools::equalZero( nShearX ) )
{
// no shear, GraphicObject is enough (the
// GraphicObject only supports scaling, rotation
// and translation)
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// #i75339# don't apply mirror flags, having
// negative size values is enough to make
// GraphicObject flip the bitmap
// The angle has to be mapped from radian to tenths of
// degress with the orientation reversed: [0,2Pi) ->
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
pGrfObj.reset( new GraphicObject( aBmpEx ) );
}
else
{
// modify output position, to account for the fact
// that transformBitmap() always normalizes its output
// bitmap into the smallest enclosing box.
::basegfx::B2DRectangle aDestRect;
::canvas::tools::calcTransformedRectBounds( aDestRect,
::basegfx::B2DRectangle(0,
0,
aBmpSize.Width(),
aBmpSize.Height()),
aMatrix );
aOutputPos.setX( aDestRect.getMinX() );
aOutputPos.setY( aDestRect.getMinY() );
// complex transformation, use generic affine bitmap
// transformation
aBmpEx = tools::transformBitmap( aBmpEx,
aMatrix,
renderState.DeviceColor,
tools::MODULATE_NONE );
pGrfObj.reset( new GraphicObject( aBmpEx ) );
// clear scale values, generated bitmap already
// contains scaling
aScale.setX( 1.0 ); aScale.setY( 1.0 );
// update bitmap size, bitmap has changed above.
aBmpSize = aBmpEx.GetSizePixel();
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// output GraphicObject
const ::Point aPt( ::vcl::unotools::pointFromB2DPoint( aOutputPos ) );
const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width() ),
::basegfx::fround( aScale.getY() * aBmpSize.Height() ) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
pGrfObj->Draw( &mpOutDev->getOutDev(),
aPt,
aSz,
&aGrfAttr );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( mp2ndOutDev )
pGrfObj->Draw( &mp2ndOutDev->getOutDev(),
aPt,
aSz,
&aGrfAttr );
// created GraphicObject, which possibly cached
// display bitmap - return cache object, to retain
// that information.
return uno::Reference< rendering::XCachedPrimitive >(
new CachedBitmap( pGrfObj,
aPt,
aSz,
aGrfAttr,
viewState,
renderState,
// cast away const, need to
// change refcount (as this is
// ~invisible to client code,
// still logically const)
const_cast< rendering::XCanvas* >(pCanvas)) );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
// Nothing rendered
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas,
const uno::Reference< rendering::XBitmap >& xBitmap,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
return implDrawBitmap( pCanvas,
xBitmap,
viewState,
renderState,
false );
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas,
const uno::Reference< rendering::XBitmap >& xBitmap,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
return implDrawBitmap( pCanvas,
xBitmap,
viewState,
renderState,
true );
}
void CanvasHelper::copyRect( const rendering::XCanvas* ,
const uno::Reference< rendering::XBitmapCanvas >& ,
const geometry::RealRectangle2D& ,
const rendering::ViewState& ,
const rendering::RenderState& ,
const geometry::RealRectangle2D& ,
const rendering::ViewState& ,
const rendering::RenderState& )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// TODO(F1)
}
geometry::IntegerSize2D CanvasHelper::getSize()
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return geometry::IntegerSize2D(); // we're disposed
return ::vcl::unotools::integerSize2DFromSize( mpOutDev->getOutDev().GetOutputSizePixel() );
}
uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize,
bool beFast )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() || !mpDevice )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Reference< rendering::XBitmap >(); // we're disposed
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): Support alpha vdev canvas here
const Point aEmptyPoint(0,0);
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
Bitmap aBitmap( rOutDev.GetBitmap(aEmptyPoint, aBmpSize) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
aBitmap.Scale( ::vcl::unotools::sizeFromRealSize2D(newSize),
beFast ? BMP_SCALE_DEFAULT : BMP_SCALE_BESTQUALITY );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap( aBitmap, *mpDevice, mpOutDev ) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& rLayout,
const geometry::IntegerRectangle2D& rect )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return uno::Sequence< sal_Int8 >(); // we're disposed
rLayout = getMemoryLayout();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): Support alpha canvas here
const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
Bitmap aBitmap( rOutDev.GetBitmap(aRect.TopLeft(),
aRect.GetSize()) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
Bitmap::ScopedReadAccess pReadAccess( aBitmap );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
ENSURE_OR_THROW( pReadAccess.get() != NULL,
"Could not acquire read access to OutDev bitmap" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
const sal_Int32 nWidth( rect.X2 - rect.X1 );
const sal_Int32 nHeight( rect.Y2 - rect.Y1 );
rLayout.ScanLines = nHeight;
rLayout.ScanLineBytes = nWidth*4;
rLayout.ScanLineStride = rLayout.ScanLineBytes;
uno::Sequence< sal_Int8 > aRes( 4*nWidth*nHeight );
sal_Int8* pRes = aRes.getArray();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
int nCurrPos(0);
for( int y=0; y<nHeight; ++y )
{
for( int x=0; x<nWidth; ++x )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetRed();
pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetGreen();
pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetBlue();
pRes[ nCurrPos++ ] = -1;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
return aRes;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
void CanvasHelper::setData( const uno::Sequence< sal_Int8 >& data,
const rendering::IntegerBitmapLayout& aLayout,
const geometry::IntegerRectangle2D& rect )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return; // we're disposed
const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() );
ENSURE_ARG_OR_THROW( aRefLayout.PlaneStride != aLayout.PlaneStride ||
aRefLayout.ColorSpace != aLayout.ColorSpace ||
aRefLayout.Palette != aLayout.Palette ||
aRefLayout.IsMsbFirst != aLayout.IsMsbFirst,
"Mismatching memory layout" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
const Rectangle aRect( ::vcl::unotools::rectangleFromIntegerRectangle2D(rect) );
const sal_uInt16 nBitCount( ::std::min( (sal_uInt16)24U,
(sal_uInt16)rOutDev.GetBitCount() ) );
const BitmapPalette* pPalette = NULL;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( nBitCount <= 8 )
{
// TODO(Q1): Extract this to a common place, e.g. GraphicDevice
// try to determine palette from output device (by
// extracting a 1,1 bitmap, and querying it)
const Point aEmptyPoint;
const Size aSize(1,1);
Bitmap aTmpBitmap( rOutDev.GetBitmap( aEmptyPoint,
aSize ) );
Bitmap::ScopedReadAccess pReadAccess( aTmpBitmap );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
pPalette = &pReadAccess->GetPalette();
}
// TODO(F2): Support alpha canvas here
Bitmap aBitmap( aRect.GetSize(), nBitCount, pPalette );
bool bCopyBack( false ); // only copy something back, if we
// actually changed some pixel
{
Bitmap::ScopedWriteAccess pWriteAccess( aBitmap );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
ENSURE_OR_THROW( pWriteAccess.get() != NULL,
"Could not acquire write access to OutDev bitmap" );
// for the time being, always read as RGB
const sal_Int32 nWidth( rect.X2 - rect.X1 );
const sal_Int32 nHeight( rect.Y2 - rect.Y1 );
int x, y, nCurrPos(0);
for( y=0; y<nHeight; ++y )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
switch( pWriteAccess->GetScanlineFormat() )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
case BMP_FORMAT_8BIT_PAL:
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
Scanline pScan = pWriteAccess->GetScanline( y );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
for( x=0; x<nWidth; ++x )
{
*pScan++ = (sal_uInt8)pWriteAccess->GetBestPaletteIndex(
BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
nCurrPos += 4;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
break;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
case BMP_FORMAT_24BIT_TC_BGR:
{
Scanline pScan = pWriteAccess->GetScanline( y );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
for( x=0; x<nWidth; ++x )
{
*pScan++ = data[ nCurrPos+2 ];
*pScan++ = data[ nCurrPos+1 ];
*pScan++ = data[ nCurrPos ];
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
nCurrPos += 4;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
break;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
case BMP_FORMAT_24BIT_TC_RGB:
{
Scanline pScan = pWriteAccess->GetScanline( y );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
for( x=0; x<nWidth; ++x )
{
*pScan++ = data[ nCurrPos ];
*pScan++ = data[ nCurrPos+1 ];
*pScan++ = data[ nCurrPos+2 ];
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
nCurrPos += 4;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
break;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
default:
{
for( x=0; x<nWidth; ++x )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
pWriteAccess->SetPixel( y, x, BitmapColor( data[ nCurrPos ],
data[ nCurrPos+1 ],
data[ nCurrPos+2 ] ) );
nCurrPos += 4;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
break;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
bCopyBack = true;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
// copy back only here, since the BitmapAccessors must be
// destroyed beforehand
if( bCopyBack )
{
// TODO(F2): Support alpha canvas here
rOutDev.DrawBitmap(aRect.TopLeft(), aBitmap);
}
}
void CanvasHelper::setPixel( const uno::Sequence< sal_Int8 >& color,
const rendering::IntegerBitmapLayout& rLayout,
const geometry::IntegerPoint2D& pos )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return; // we're disposed
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(),
"X coordinate out of bounds" );
ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(),
"Y coordinate out of bounds" );
ENSURE_ARG_OR_THROW( color.getLength() > 3,
"not enough color components" );
const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() );
ENSURE_ARG_OR_THROW( aRefLayout.PlaneStride != rLayout.PlaneStride ||
aRefLayout.ColorSpace != rLayout.ColorSpace ||
aRefLayout.Palette != rLayout.Palette ||
aRefLayout.IsMsbFirst != rLayout.IsMsbFirst,
"Mismatching memory layout" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): Support alpha canvas here
rOutDev.DrawPixel( ::vcl::unotools::pointFromIntegerPoint2D( pos ),
::canvas::tools::stdIntSequenceToColor( color ));
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& rLayout,
const geometry::IntegerPoint2D& pos )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return uno::Sequence< sal_Int8 >(); // we're disposed
rLayout = getMemoryLayout();
rLayout.ScanLines = 1;
rLayout.ScanLineBytes = 4;
rLayout.ScanLineStride = rLayout.ScanLineBytes;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
OutputDevice& rOutDev( mpOutDev->getOutDev() );
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
const Size aBmpSize( rOutDev.GetOutputSizePixel() );
ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(),
"X coordinate out of bounds" );
ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(),
"Y coordinate out of bounds" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// TODO(F2): Support alpha canvas here
return ::canvas::tools::colorToStdIntSequence(
rOutDev.GetPixel(
::vcl::unotools::pointFromIntegerPoint2D( pos )));
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
rendering::IntegerBitmapLayout CanvasHelper::getMemoryLayout()
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
if( !mpOutDev.get() )
return rendering::IntegerBitmapLayout(); // we're disposed
rendering::IntegerBitmapLayout xBitmapLayout( ::canvas::tools::getStdMemoryLayout(getSize()) );
if ( !mbHaveAlpha )
xBitmapLayout.ColorSpace = canvas::tools::getStdColorSpaceWithoutAlpha();
return xBitmapLayout;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
int CanvasHelper::setupOutDevState( const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
ColorType eColorType ) const
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_OR_THROW( mpOutDev.get(),
"outdev null. Are we disposed?" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
::canvas::tools::verifyInput( renderState,
BOOST_CURRENT_FUNCTION,
mpDevice,
2,
eColorType == IGNORE_COLOR ? 0 : 3 );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
OutputDevice& rOutDev( mpOutDev->getOutDev() );
OutputDevice* p2ndOutDev = NULL;
rOutDev.EnableMapMode( false );
Resolves: #i121534# Reintegrating changes for rotated bitmap support (cherry picked from commit b2cc0de3fc9adee90787ca760e86869f9255b380) Conflicts: canvas/source/vcl/spritecanvashelper.cxx drawinglayer/Library_drawinglayer.mk drawinglayer/source/processor2d/vclhelperbitmaprender.cxx drawinglayer/source/processor2d/vclhelperbitmaprender.hxx drawinglayer/source/processor2d/vclhelperbitmaptransform.cxx drawinglayer/source/processor2d/vclhelperbitmaptransform.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx officecfg/registry/schema/org/openoffice/Office/Draw.xcs svx/source/svdraw/svdograf.cxx vcl/aqua/source/gdi/salgdi.cxx vcl/inc/aqua/salgdi.h vcl/inc/os2/salgdi.h vcl/inc/salgdi.hxx vcl/inc/unx/pspgraphics.h vcl/inc/vcl/bitmapex.hxx vcl/inc/vcl/outdev.hxx vcl/inc/vcl/salbtype.hxx vcl/os2/source/gdi/salgdi2.cxx vcl/source/gdi/bitmapex.cxx vcl/source/gdi/outdev2.cxx vcl/source/gdi/salgdilayout.cxx vcl/source/gdi/salmisc.cxx vcl/unx/generic/gdi/pspgraphics.cxx vcl/unx/generic/gdi/salgdi2.cxx vcl/unx/headless/svpgdi.cxx vcl/unx/headless/svpgdi.hxx vcl/unx/headless/svppspgraphics.cxx vcl/unx/headless/svppspgraphics.hxx vcl/win/source/gdi/salbmp.cxx vcl/win/source/gdi/salgdi.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/gdi/salgdi_gdiplus.cxx vcl/win/source/gdi/winlayout.cxx Change-Id: I871d1d107b019758f3913e5eb63bc9bc0ba403fd Do not name unused arguments to prevent compiler warnings. (cherry picked from commit f3118889a0cd941f193e9b6557c0792015d77a34) Change-Id: I482d1f96d695c7bf9912ec464bb39e7fdd14adef Related: #i121534# fix graphite-enabled windows build (cherry picked from commit c90a6ca92b1239d01a2892e15488e4a183a88b1a) Conflicts: vcl/win/source/gdi/winlayout.cxx Change-Id: I95fd41ad6f7187f34ba9474674a471fb4fc65314
2013-01-23 13:27:50 +00:00
rOutDev.SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW );
if( mp2ndOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
p2ndOutDev = &mp2ndOutDev->getOutDev();
int nTransparency(0);
// TODO(P2): Don't change clipping all the time, maintain current clip
// state and change only when update is necessary
// accumulate non-empty clips into one region
// ==========================================
vcl::Region aClipRegion(true);
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( viewState.Clip.is() )
{
::basegfx::B2DPolyPolygon aClipPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(viewState.Clip) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( aClipPoly.count() )
{
// setup non-empty clipping
::basegfx::B2DHomMatrix aMatrix;
aClipPoly.transform(
::basegfx::unotools::homMatrixFromAffineMatrix( aMatrix,
viewState.AffineTransform ) );
aClipRegion = vcl::Region::GetRegionFromPolyPolygon( ::tools::PolyPolygon( aClipPoly ) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
else
{
// clip polygon is empty
aClipRegion.SetEmpty();
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
if( renderState.Clip.is() )
{
::basegfx::B2DPolyPolygon aClipPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(renderState.Clip) );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
::basegfx::B2DHomMatrix aMatrix;
aClipPoly.transform(
::canvas::tools::mergeViewAndRenderTransform( aMatrix,
viewState,
renderState ) );
if( aClipPoly.count() )
{
// setup non-empty clipping
vcl::Region aRegion = vcl::Region::GetRegionFromPolyPolygon( ::tools::PolyPolygon( aClipPoly ) );
aClipRegion.Intersect( aRegion );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
else
{
// clip polygon is empty
aClipRegion.SetEmpty();
}
}
// setup accumulated clip region. Note that setting an
// empty clip region denotes "clip everything" on the
// OutputDevice (which is why we translate that into
// SetClipRegion() here). When both view and render clip
// are empty, aClipRegion remains default-constructed,
// i.e. empty, too.
if( aClipRegion.IsNull() )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
rOutDev.SetClipRegion();
if( p2ndOutDev )
p2ndOutDev->SetClipRegion();
}
else
{
rOutDev.SetClipRegion( aClipRegion );
if( p2ndOutDev )
p2ndOutDev->SetClipRegion( aClipRegion );
}
Color aColor( COL_WHITE );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( renderState.DeviceColor.getLength() > 2 )
{
aColor = ::vcl::unotools::stdColorSpaceSequenceToColor(
renderState.DeviceColor );
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
// extract alpha, and make color opaque
// afterwards. Otherwise, OutputDevice won't draw anything
nTransparency = aColor.GetTransparency();
aColor.SetTransparency(0);
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( eColorType != IGNORE_COLOR )
{
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
switch( eColorType )
{
case LINE_COLOR:
rOutDev.SetLineColor( aColor );
rOutDev.SetFillColor();
if( p2ndOutDev )
{
p2ndOutDev->SetLineColor( aColor );
p2ndOutDev->SetFillColor();
}
break;
case FILL_COLOR:
rOutDev.SetFillColor( aColor );
rOutDev.SetLineColor();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
if( p2ndOutDev )
{
p2ndOutDev->SetFillColor( aColor );
p2ndOutDev->SetLineColor();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
break;
case TEXT_COLOR:
rOutDev.SetTextColor( aColor );
if( p2ndOutDev )
p2ndOutDev->SetTextColor( aColor );
break;
default:
ENSURE_OR_THROW( false,
"Unexpected color type");
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
break;
}
}
return nTransparency;
}
bool CanvasHelper::setupTextOutput( ::Point& o_rOutPos,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const uno::Reference< rendering::XCanvasFont >& xFont ) const
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
ENSURE_OR_THROW( mpOutDev.get(),
"outdev null. Are we disposed?" );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
setupOutDevState( viewState, renderState, TEXT_COLOR );
OutputDevice& rOutDev( mpOutDev->getOutDev() );
vcl::Font aVCLFont;
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() );
ENSURE_ARG_OR_THROW( pFont,
"Font not compatible with this canvas" );
aVCLFont = pFont->getVCLFont();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
Color aColor( COL_BLACK );
if( renderState.DeviceColor.getLength() > 2 )
{
aColor = ::vcl::unotools::stdColorSpaceSequenceToColor(
renderState.DeviceColor );
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
// setup font color
aVCLFont.SetColor( aColor );
aVCLFont.SetFillColor( aColor );
// no need to replicate this for mp2ndOutDev, we're modifying only aVCLFont here.
if( !tools::setupFontTransform( o_rOutPos, aVCLFont, viewState, renderState, rOutDev ) )
return false;
rOutDev.SetFont( aVCLFont );
if( mp2ndOutDev )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
mp2ndOutDev->getOutDev().SetFont( aVCLFont );
return true;
}
bool CanvasHelper::repaint( const GraphicObjectSharedPtr& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const
{
ENSURE_OR_RETURN_FALSE( rGrf,
"Invalid Graphic" );
if( !mpOutDev )
return false; // disposed
else
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
setupOutDevState( viewState, renderState, IGNORE_COLOR );
if( !rGrf->Draw( &mpOutDev->getOutDev(), rPt, rSz, &rAttr ) )
return false;
// #i80779# Redraw also into mask outdev
if( mp2ndOutDev )
return rGrf->Draw( &mp2ndOutDev->getOutDev(), rPt, rSz, &rAttr );
return true;
}
}
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
void CanvasHelper::flush() const
{
if( mpOutDev && mpOutDev->getOutDev().GetOutDevType() == OUTDEV_WINDOW )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// TODO(Q3): Evil downcast. And what's more, Window::Flush is
// not even const. Wah.
static_cast<vcl::Window&>(mpOutDev->getOutDev()).Flush();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
if( mp2ndOutDev && mp2ndOutDev->getOutDev().GetOutDevType() == OUTDEV_WINDOW )
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
{
// TODO(Q3): Evil downcast. And what's more, Window::Flush is
// not even const. Wah.
static_cast<vcl::Window&>(mp2ndOutDev->getOutDev()).Flush();
INTEGRATION: CWS presentationengine01 (1.1.2); FILE ADDED 2004/11/22 13:49:01 thb 1.1.2.11: #110496# Due to a Solaris compiler bug, avoiding ternary operator with temporaries and function calls 2004/11/17 17:00:29 thb 1.1.2.10: #118514# Canvas module reorg 2004/11/08 05:54:33 thb 1.1.2.9: #i36093#, #110496# Added native canvas gradients; improved bitmap performance by special-casing a few important formats; de-flickered full-content redraw, by performing that, too, in a bg VDev 2004/10/26 23:36:58 thb 1.1.2.8: #110496# Added dedicated alpha bitmap support: factory methods at the XGraphicDevice, and optimized handling internally 2004/10/11 00:00:05 thb 1.1.2.7: #i34997# Added new method XCanvas::drawBitmapModulated(), to facilitate global alpha channel changes when rendering bitmaps 2004/09/30 15:10:55 thb 1.1.2.6: #110496# Corrected clip setup for the case empty view clip, nonempty render state clip (was set to NULL clip before) 2004/09/27 20:12:31 thb 1.1.2.5: #110496# Fixed problem with CanvasBitmap instances with alpha channel (simply ignored that before) 2004/08/23 19:14:25 thb 1.1.2.4: #110496# Now properly setting up text color (also changing the font's color values 2004/08/19 00:12:28 thb 1.1.2.3: #110496# Changed clip setup to handle empty/NULL clips correctly 2004/08/03 19:45:36 thb 1.1.2.2: #110496# Changed vcl canvas to use B2DPolygons, and transforming clip polys before setting them 2004/07/20 19:22:33 thb 1.1.2.1: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases
2004-11-26 16:12:04 +00:00
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */