Files
libreoffice/canvas/source/cairo/cairo_canvashelper.cxx

2313 lines
107 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.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <canvas/debug.hxx>
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
#include <tools/diagnose_ex.h>
#include <rtl/math.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/util/Endianness.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/CompositeOperation.hpp>
#include <com/sun/star/rendering/RepaintResult.hpp>
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/XIntegerBitmapColorSpace.hpp>
#include <com/sun/star/rendering/IntegerBitmapLayout.hpp>
#include <com/sun/star/rendering/ColorSpaceType.hpp>
#include <com/sun/star/rendering/ColorComponentTag.hpp>
#include <com/sun/star/rendering/RenderingIntent.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/tools/keystoplerp.hxx>
#include <basegfx/tools/lerp.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/compbase1.hxx>
#include <canvas/canvastools.hxx>
#include <canvas/parametricpolypolygon.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/virdev.hxx>
#include "cairo_spritecanvas.hxx"
#include "cairo_cachedbitmap.hxx"
#include "cairo_canvashelper.hxx"
#include "cairo_canvasbitmap.hxx"
#include <boost/tuple/tuple.hpp>
#include <algorithm>
using namespace ::cairo;
using namespace ::com::sun::star;
namespace cairocanvas
{
CanvasHelper::CanvasHelper() :
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
mpSurfaceProvider(NULL),
mpDevice(NULL),
mpVirtualDevice(),
mbHaveAlpha(),
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
mpCairo(),
mpSurface(),
maSize()
{
}
void CanvasHelper::disposing()
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
mpSurface.reset();
mpCairo.reset();
mpVirtualDevice.disposeAndClear();
mpDevice = NULL;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
mpSurfaceProvider = NULL;
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
void CanvasHelper::init( const ::basegfx::B2ISize& rSizePixel,
SurfaceProvider& rSurfaceProvider,
rendering::XGraphicDevice* pDevice )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
maSize = rSizePixel;
mpSurfaceProvider = &rSurfaceProvider;
mpDevice = pDevice;
}
void CanvasHelper::setSize( const ::basegfx::B2ISize& rSize )
{
maSize = rSize;
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
void CanvasHelper::setSurface( const SurfaceSharedPtr& pSurface, bool bHasAlpha )
{
mbHaveAlpha = bHasAlpha;
mpVirtualDevice.disposeAndClear();
mpSurface = pSurface;
mpCairo = pSurface->getCairo();
}
static void setColor( cairo_t* pCairo,
const uno::Sequence<double>& rColor )
{
if( rColor.getLength() > 3 )
{
cairo_set_source_rgba( pCairo,
rColor[0],
rColor[1],
rColor[2],
rColor[3] );
}
else if( rColor.getLength() == 3 )
cairo_set_source_rgb( pCairo,
rColor[0],
rColor[1],
rColor[2] );
}
void CanvasHelper::useStates( const rendering::ViewState& viewState,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const rendering::RenderState& renderState,
bool bSetColor )
{
cairo_matrix_t aViewMatrix;
cairo_matrix_t aRenderMatrix;
cairo_matrix_t aCombinedMatrix;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_matrix_init( &aViewMatrix,
viewState.AffineTransform.m00, viewState.AffineTransform.m10, viewState.AffineTransform.m01,
viewState.AffineTransform.m11, viewState.AffineTransform.m02, viewState.AffineTransform.m12);
cairo_matrix_init( &aRenderMatrix,
renderState.AffineTransform.m00, renderState.AffineTransform.m10, renderState.AffineTransform.m01,
renderState.AffineTransform.m11, renderState.AffineTransform.m02, renderState.AffineTransform.m12);
cairo_matrix_multiply( &aCombinedMatrix, &aRenderMatrix, &aViewMatrix);
if( viewState.Clip.is() )
{
SAL_INFO( "canvas.cairo", "view clip");
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
aViewMatrix.x0 = basegfx::fround( aViewMatrix.x0 );
aViewMatrix.y0 = basegfx::fround( aViewMatrix.y0 );
cairo_set_matrix( mpCairo.get(), &aViewMatrix );
doPolyPolygonPath( viewState.Clip, Clip );
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
aCombinedMatrix.x0 = basegfx::fround( aCombinedMatrix.x0 );
aCombinedMatrix.y0 = basegfx::fround( aCombinedMatrix.y0 );
cairo_set_matrix( mpCairo.get(), &aCombinedMatrix );
if( renderState.Clip.is() )
{
SAL_INFO( "canvas.cairo", "render clip BEGIN");
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
doPolyPolygonPath( renderState.Clip, Clip );
SAL_INFO( "canvas.cairo", "render clip END");
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
}
if( bSetColor )
setColor(mpCairo.get(),renderState.DeviceColor);
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_operator_t compositingMode( CAIRO_OPERATOR_OVER );
switch( renderState.CompositeOperation )
{
case rendering::CompositeOperation::CLEAR:
compositingMode = CAIRO_OPERATOR_CLEAR;
break;
case rendering::CompositeOperation::SOURCE:
compositingMode = CAIRO_OPERATOR_SOURCE;
break;
case rendering::CompositeOperation::DESTINATION:
compositingMode = CAIRO_OPERATOR_DEST;
break;
case rendering::CompositeOperation::OVER:
compositingMode = CAIRO_OPERATOR_OVER;
break;
case rendering::CompositeOperation::UNDER:
compositingMode = CAIRO_OPERATOR_DEST;
break;
case rendering::CompositeOperation::INSIDE:
compositingMode = CAIRO_OPERATOR_IN;
break;
case rendering::CompositeOperation::INSIDE_REVERSE:
compositingMode = CAIRO_OPERATOR_OUT;
break;
case rendering::CompositeOperation::OUTSIDE:
compositingMode = CAIRO_OPERATOR_DEST_OVER;
break;
case rendering::CompositeOperation::OUTSIDE_REVERSE:
compositingMode = CAIRO_OPERATOR_DEST_OUT;
break;
case rendering::CompositeOperation::ATOP:
compositingMode = CAIRO_OPERATOR_ATOP;
break;
case rendering::CompositeOperation::ATOP_REVERSE:
compositingMode = CAIRO_OPERATOR_DEST_ATOP;
break;
case rendering::CompositeOperation::XOR:
compositingMode = CAIRO_OPERATOR_XOR;
break;
case rendering::CompositeOperation::ADD:
compositingMode = CAIRO_OPERATOR_ADD;
break;
case rendering::CompositeOperation::SATURATE:
compositingMode = CAIRO_OPERATOR_SATURATE;
break;
}
cairo_set_operator( mpCairo.get(), compositingMode );
}
void CanvasHelper::clear()
{
SAL_INFO( "canvas.cairo", "clear whole area: " << maSize.getX() << " x " << maSize.getY() );
if( mpCairo )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_save( mpCairo.get() );
cairo_identity_matrix( mpCairo.get() );
// this does not really differ from all-zero, as cairo
// internally converts to premultiplied alpha. but anyway,
// this keeps it consistent with the other canvas impls
if( mbHaveAlpha )
cairo_set_source_rgba( mpCairo.get(), 1.0, 1.0, 1.0, 0.0 );
else
cairo_set_source_rgb( mpCairo.get(), 1.0, 1.0, 1.0 );
cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE );
cairo_rectangle( mpCairo.get(), 0, 0, maSize.getX(), maSize.getY() );
cairo_fill( mpCairo.get() );
cairo_restore( mpCairo.get() );
}
}
void CanvasHelper::drawLine( const rendering::XCanvas* /*pCanvas*/,
const geometry::RealPoint2D& aStartPoint,
const geometry::RealPoint2D& aEndPoint,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
if( mpCairo )
{
cairo_save( mpCairo.get() );
cairo_set_line_width( mpCairo.get(), 1 );
useStates( viewState, renderState, true );
cairo_move_to( mpCairo.get(), aStartPoint.X + 0.5, aStartPoint.Y + 0.5 );
cairo_line_to( mpCairo.get(), aEndPoint.X + 0.5, aEndPoint.Y + 0.5 );
cairo_stroke( mpCairo.get() );
cairo_restore( mpCairo.get() );
}
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
void CanvasHelper::drawBezier( const rendering::XCanvas* ,
const geometry::RealBezierSegment2D& aBezierSegment,
const geometry::RealPoint2D& aEndPoint,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
if( mpCairo )
{
cairo_save( mpCairo.get() );
cairo_set_line_width( mpCairo.get(), 1 );
useStates( viewState, renderState, true );
cairo_move_to( mpCairo.get(), aBezierSegment.Px + 0.5, aBezierSegment.Py + 0.5 );
cairo_curve_to( mpCairo.get(),
aBezierSegment.C1x + 0.5, aBezierSegment.C1y + 0.5,
aBezierSegment.C2x + 0.5, aBezierSegment.C2y + 0.5,
aEndPoint.X + 0.5, aEndPoint.Y + 0.5 );
cairo_stroke( mpCairo.get() );
cairo_restore( mpCairo.get() );
}
}
#define PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME "Canvas::ParametricPolyPolygon"
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
/** surfaceFromXBitmap Create a surface from XBitmap
* @param xBitmap bitmap image that will be used for the surface
* @param bHasAlpha will be set to true if resulting surface has alpha
*
* This is a helper function for the other surfaceFromXBitmap().
* This function tries to create surface from xBitmap by checking if xBitmap is CanvasBitmap or SpriteCanvas.
*
* @return created surface or NULL
**/
static SurfaceSharedPtr surfaceFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap )
{
CanvasBitmap* pBitmapImpl = dynamic_cast< CanvasBitmap* >( xBitmap.get() );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( pBitmapImpl )
return pBitmapImpl->getSurface();
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() );
if( pSurfaceProvider )
return pSurfaceProvider->getSurface();
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
return SurfaceSharedPtr();
}
static ::BitmapEx bitmapExFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
// TODO(F1): Add support for floating point bitmap formats
uno::Reference<rendering::XIntegerReadOnlyBitmap> xIntBmp(xBitmap,
uno::UNO_QUERY_THROW);
::BitmapEx aBmpEx = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( !!aBmpEx )
return aBmpEx;
// TODO(F1): extract pixel from XBitmap interface
ENSURE_OR_THROW( false,
"bitmapExFromXBitmap(): could not extract BitmapEx" );
return ::BitmapEx();
}
static sal_uInt8 lcl_GetColor(BitmapColor const& rColor)
{
sal_uInt8 nTemp(0);
if (rColor.IsIndex())
{
nTemp = rColor.GetIndex();
}
else
{
nTemp = rColor.GetBlue();
// greyscale expected here, or what would non-grey colors mean?
assert(rColor.GetRed() == nTemp && rColor.GetGreen() == nTemp);
}
return nTemp;
}
static bool readAlpha( BitmapReadAccess* pAlphaReadAcc, long nY, const long nWidth, unsigned char* data, long nOff )
{
bool bIsAlpha = false;
long nX;
int nAlpha;
Scanline pReadScan;
nOff += 3;
switch( pAlphaReadAcc->GetScanlineFormat() )
{
case BMP_FORMAT_8BIT_TC_MASK:
pReadScan = pAlphaReadAcc->GetScanline( nY );
for( nX = 0; nX < nWidth; nX++ )
{
nAlpha = data[ nOff ] = 255 - ( *pReadScan++ );
if( nAlpha != 255 )
bIsAlpha = true;
nOff += 4;
}
break;
case BMP_FORMAT_8BIT_PAL:
pReadScan = pAlphaReadAcc->GetScanline( nY );
for( nX = 0; nX < nWidth; nX++ )
{
BitmapColor const& rColor(
pAlphaReadAcc->GetPaletteColor(*pReadScan));
pReadScan++;
nAlpha = data[ nOff ] = 255 - lcl_GetColor(rColor);
if( nAlpha != 255 )
bIsAlpha = true;
nOff += 4;
}
break;
default:
SAL_INFO( "canvas.cairo", "fallback to GetColor for alpha - slow, format: " << pAlphaReadAcc->GetScanlineFormat() );
for( nX = 0; nX < nWidth; nX++ )
{
nAlpha = data[ nOff ] = 255 - pAlphaReadAcc->GetColor( nY, nX ).GetIndex();
if( nAlpha != 255 )
bIsAlpha = true;
nOff += 4;
}
}
return bIsAlpha;
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
/** surfaceFromXBitmap Create a surface from XBitmap
* @param xBitmap bitmap image that will be used for the surface
* @param rDevice reference to the device into which we want to draw
* @param data will be filled with alpha data, if xBitmap is alpha/transparent image
* @param bHasAlpha will be set to true if resulting surface has alpha
*
* This function tries various methods for creating a surface from xBitmap. It also uses
* the helper function surfaceFromXBitmap( xBitmap, bHasAlpha )
*
* @return created surface or NULL
**/
static SurfaceSharedPtr surfaceFromXBitmap( const uno::Reference< rendering::XBitmap >& xBitmap, const SurfaceProviderRef& rSurfaceProvider, unsigned char*& data, bool& bHasAlpha )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
bHasAlpha = xBitmap->hasAlpha();
SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap );
if( pSurface )
data = NULL;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
else
{
::BitmapEx aBmpEx = bitmapExFromXBitmap(xBitmap);
::Bitmap aBitmap = aBmpEx.GetBitmap();
// there's no pixmap for alpha bitmap. we might still
// use rgb pixmap and only access alpha pixels the
// slow way. now we just speedup rgb bitmaps
if( !aBmpEx.IsTransparent() && !aBmpEx.IsAlpha() )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
pSurface = rSurfaceProvider->createSurface( aBitmap );
data = NULL;
bHasAlpha = false;
}
if( !pSurface )
{
AlphaMask aAlpha = aBmpEx.GetAlpha();
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
::BitmapReadAccess* pBitmapReadAcc = aBitmap.AcquireReadAccess();
::BitmapReadAccess* pAlphaReadAcc = NULL;
const long nWidth = pBitmapReadAcc->Width();
const long nHeight = pBitmapReadAcc->Height();
long nX, nY;
bool bIsAlpha = false;
if( aBmpEx.IsTransparent() || aBmpEx.IsAlpha() )
pAlphaReadAcc = aAlpha.AcquireReadAccess();
data = static_cast<unsigned char*>(malloc( nWidth*nHeight*4 ));
long nOff = 0;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
::Color aColor;
unsigned int nAlpha = 255;
for( nY = 0; nY < nHeight; nY++ )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
::Scanline pReadScan;
switch( pBitmapReadAcc->GetScanlineFormat() )
{
case BMP_FORMAT_8BIT_PAL:
pReadScan = pBitmapReadAcc->GetScanline( nY );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff++ ];
else
nAlpha = data[ nOff++ ] = 255;
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
#endif
aColor = pBitmapReadAcc->GetPaletteColor( *pReadScan++ );
#ifdef OSL_BIGENDIAN
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetRed() ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetGreen() ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetBlue() ) )/255 );
#else
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetBlue() ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetGreen() ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( aColor.GetRed() ) )/255 );
nOff++;
#endif
}
break;
case BMP_FORMAT_24BIT_TC_BGR:
pReadScan = pBitmapReadAcc->GetScanline( nY );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff ];
else
nAlpha = data[ nOff ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff + 3 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff + 2 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff + 1 ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
nOff += 4;
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
nOff++;
#endif
}
break;
case BMP_FORMAT_24BIT_TC_RGB:
pReadScan = pBitmapReadAcc->GetScanline( nY );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff++ ];
else
nAlpha = data[ nOff++ ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
pReadScan += 3;
nOff++;
#endif
}
break;
case BMP_FORMAT_32BIT_TC_BGRA:
pReadScan = pBitmapReadAcc->GetScanline( nY );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff++ ];
else
nAlpha = data[ nOff++ ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
pReadScan += 4;
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
pReadScan++;
nOff++;
#endif
}
break;
case BMP_FORMAT_32BIT_TC_RGBA:
pReadScan = pBitmapReadAcc->GetScanline( nY );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff ++ ];
else
nAlpha = data[ nOff ++ ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( *pReadScan++ ) )/255 );
pReadScan++;
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 2 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 1 ] ) )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*( pReadScan[ 0 ] ) )/255 );
pReadScan += 4;
nOff++;
#endif
}
break;
default:
SAL_INFO( "canvas.cairo", "fallback to GetColor - slow, format: " << pBitmapReadAcc->GetScanlineFormat() );
if( pAlphaReadAcc )
if( readAlpha( pAlphaReadAcc, nY, nWidth, data, nOff ) )
bIsAlpha = true;
for( nX = 0; nX < nWidth; nX++ )
{
aColor = pBitmapReadAcc->GetColor( nY, nX );
// cairo need premultiplied color values
Many spelling fixes: directories a* - g*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit a6efc99d19d533fcf53106b6667bafba4d364370) Conflicts: accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java accessibility/bridge/org/openoffice/java/accessibility/Component.java accessibility/bridge/org/openoffice/java/accessibility/Container.java accessibility/bridge/org/openoffice/java/accessibility/DescendantManager.java accessibility/bridge/org/openoffice/java/accessibility/Dialog.java accessibility/bridge/org/openoffice/java/accessibility/Frame.java accessibility/bridge/org/openoffice/java/accessibility/List.java accessibility/bridge/org/openoffice/java/accessibility/Menu.java accessibility/bridge/org/openoffice/java/accessibility/Table.java accessibility/bridge/org/openoffice/java/accessibility/Tree.java accessibility/bridge/org/openoffice/java/accessibility/Window.java accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx accessibility/source/extended/accessibleiconchoicectrlentry.cxx accessibility/source/extended/accessiblelistboxentry.cxx accessibility/source/extended/accessibletablistbox.cxx accessibility/source/extended/accessibletablistboxtable.cxx accessibility/workben/org/openoffice/accessibility/awb/canvas/Canvas.java accessibility/workben/org/openoffice/accessibility/misc/OfficeConnection.java apple_remote/AppleRemote.m autodoc/inc/ary/cpp/c_gate.hxx autodoc/inc/ary/cpp/cp_ce.hxx autodoc/inc/ary/cpp/cp_def.hxx autodoc/inc/ary/cpp/cp_type.hxx autodoc/inc/ary/doc/d_parametrized.hxx autodoc/inc/ary/idl/i_type.hxx autodoc/source/ary/inc/cross_refs.hxx autodoc/source/ary/inc/sorted_idset.hxx autodoc/source/display/html/outfile.hxx autodoc/source/display/html/pagemake.cxx autodoc/source/display/idl/hi_env.hxx autodoc/source/parser/inc/tokens/tokproct.hxx autodoc/source/parser_i/inc/s2_luidl/tokproct.hxx autodoc/source/parser_i/inc/tokens/tkp2.hxx automation/inc/automation/commtypes.hxx automation/inc/automation/simplecm.hxx automation/source/server/recorder.cxx automation/source/server/recorder.hxx automation/source/server/statemnt.cxx automation/source/simplecm/packethandler.hxx automation/source/simplecm/simplecm.cxx avmedia/source/framework/soundhandler.cxx basegfx/inc/basegfx/range/rangeexpander.hxx basic/inc/basic/sbxdef.hxx basic/source/classes/sbunoobj.cxx basic/source/classes/sbxmod.cxx basic/source/comp/dim.cxx basic/source/comp/exprgen.cxx basic/source/runtime/step1.cxx basic/source/runtime/step2.cxx basic/source/sbx/sbxint.cxx basic/source/uno/namecont.cxx basic/workben/mgrtest.cxx bean/com/sun/star/beans/LocalOfficeConnection.java bean/com/sun/star/beans/LocalOfficeWindow.java bean/com/sun/star/comp/beans/LocalOfficeConnection.java bean/com/sun/star/comp/beans/LocalOfficeWindow.java bean/com/sun/star/comp/beans/OOoBean.java bridges/inc/bridges/cpp_uno/bridge.hxx bridges/source/cpp_uno/cc50_solaris_intel/cpp2uno.cxx bridges/source/cpp_uno/cc50_solaris_intel/except.cxx bridges/source/cpp_uno/cc50_solaris_intel/uno2cpp.cxx bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx bridges/source/cpp_uno/cc50_solaris_sparc/uno2cpp.cxx bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx bridges/source/cpp_uno/gcc3_netbsd_intel/cpp2uno.cxx bridges/source/cpp_uno/gcc3_netbsd_intel/except.cxx bridges/source/cpp_uno/gcc3_netbsd_intel/uno2cpp.cxx bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx bridges/source/cpp_uno/gcc3_os2_intel/except.cxx bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx bridges/source/cpp_uno/msvc_win32_intel/except.cxx bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx bridges/source/cpp_uno/shared/component.cxx bridges/source/jni_uno/jni_base.h bridges/source/jni_uno/jni_bridge.cxx bridges/source/jni_uno/jni_java2uno.cxx bridges/source/jni_uno/jni_uno2java.cxx canvas/inc/canvas/base/doublebitmapbase.hxx canvas/inc/canvas/base/floatbitmapbase.hxx canvas/inc/canvas/base/integerbitmapbase.hxx canvas/source/cairo/cairo_canvasbitmap.cxx canvas/source/cairo/cairo_textlayout.cxx chart2/source/controller/dialogs/ObjectNameProvider.cxx chart2/source/view/diagram/VDiagram.cxx chart2/source/view/main/ChartView.cxx cli_ure/source/native/makefile.mk cli_ure/source/uno_bridge/cli_data.cxx codemaker/source/javamaker/javatype.cxx comphelper/inc/comphelper/componentcontext.hxx comphelper/inc/comphelper/interaction.hxx comphelper/inc/comphelper/locale.hxx comphelper/inc/comphelper/string.hxx comphelper/source/container/embeddedobjectcontainer.cxx comphelper/source/misc/accessiblecontexthelper.cxx comphelper/source/misc/asyncnotification.cxx comphelper/source/misc/locale.cxx comphelper/source/misc/mediadescriptor.cxx comphelper/source/misc/numberedcollection.cxx comphelper/source/misc/proxyaggregation.cxx comphelper/source/misc/scopeguard.cxx comphelper/source/misc/sequenceashashmap.cxx configure.in connectivity/source/commontools/parameters.cxx connectivity/source/drivers/dbase/DTable.cxx connectivity/source/drivers/evoab2/NStatement.cxx connectivity/source/drivers/file/FPreparedStatement.cxx connectivity/source/drivers/jdbc/DatabaseMetaData.cxx connectivity/source/inc/flat/ETable.hxx connectivity/source/parse/sqlnode.cxx cosv/inc/cosv/persist.hxx cosv/inc/cosv/ploc_dir.hxx cosv/inc/cosv/tpl/dyn.hxx cppu/source/LogBridge/LogBridge.cxx cppu/source/uno/data.cxx cppuhelper/source/bootstrap.cxx cppuhelper/source/component_context.cxx cppuhelper/source/propshlp.cxx cppuhelper/source/servicefactory.cxx cpputools/source/registercomponent/registercomponent.cxx cui/source/customize/acccfg.cxx cui/source/dialogs/about.cxx cui/source/dialogs/commonlingui.hxx cui/source/dialogs/showcols.cxx cui/source/inc/cuihyperdlg.hxx cui/source/inc/cuitabline.hxx cui/source/options/optsave.src cui/source/tabpages/tpline.cxx cui/source/tabpages/transfrm.cxx dbaccess/source/core/api/CacheSet.cxx dbaccess/source/core/api/KeySet.cxx dbaccess/source/core/api/RowSet.cxx dbaccess/source/core/api/RowSet.hxx dbaccess/source/core/api/RowSetBase.cxx dbaccess/source/core/api/RowSetBase.hxx dbaccess/source/core/api/RowSetCache.cxx dbaccess/source/core/api/querycomposer.cxx dbaccess/source/ext/adabas/Acomponentmodule.hxx dbaccess/source/ui/app/AppControllerDnD.cxx dbaccess/source/ui/app/AppDetailView.cxx dbaccess/source/ui/browser/brwctrlr.cxx dbaccess/source/ui/browser/sbagrid.cxx dbaccess/source/ui/browser/unodatbr.cxx dbaccess/source/ui/dlg/AdabasStat.hxx dbaccess/source/ui/dlg/UserAdmin.cxx dbaccess/source/ui/dlg/directsql.cxx dbaccess/source/ui/dlg/generalpage.hxx dbaccess/source/ui/dlg/tablespage.cxx dbaccess/source/ui/inc/JoinTableView.hxx dbaccess/source/ui/inc/TableController.hxx dbaccess/source/ui/inc/UITools.hxx dbaccess/source/ui/inc/brwctrlr.hxx dbaccess/source/ui/inc/datasourcemap.hxx dbaccess/source/ui/querydesign/JoinTableView.cxx dbaccess/source/ui/querydesign/QueryDesignView.cxx dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx dbaccess/source/ui/querydesign/TableWindow.cxx dbaccess/source/ui/querydesign/querycontroller.cxx dbaccess/source/ui/relationdesign/RelationTableView.cxx dbaccess/source/ui/tabledesign/TableController.cxx desktop/source/app/app.cxx desktop/source/app/appinit.cxx desktop/source/app/langselect.cxx desktop/source/app/officeipcthread.cxx desktop/source/deployment/manager/dp_extensionmanager.cxx desktop/source/deployment/misc/dp_misc.cxx desktop/source/deployment/misc/dp_resource.cxx desktop/source/deployment/registry/dp_backend.cxx desktop/source/deployment/registry/package/dp_package.cxx desktop/source/migration/cfgfilter.cxx desktop/source/migration/migration.cxx desktop/source/splash/splash.cxx desktop/win32/source/QuickStart/QuickStart.cpp desktop/win32/source/setup/setup.cpp drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx dtrans/source/win32/clipb/MtaOleClipb.hxx dtrans/source/win32/clipb/WinClipbImpl.cxx editeng/source/editeng/editview.cxx editeng/source/editeng/impedit2.cxx editeng/source/editeng/impedit3.cxx editeng/source/editeng/impedit4.cxx editeng/source/editeng/textconv.hxx editeng/source/misc/unolingu.cxx embeddedobj/source/commonembedding/persistence.cxx embeddedobj/source/general/dummyobject.cxx embeddedobj/source/msole/olecomponent.cxx embeddedobj/source/msole/olepersist.cxx embeddedobj/test/Container1/NativeView.java extensions/source/bibliography/framectr.cxx extensions/source/macosx/spotlight/OOoContentDataParser.m extensions/source/macosx/spotlight/unzip.h extensions/source/macosx/spotlight/unzip.m extensions/source/oooimprovement/myconfigurationhelper.hxx extensions/source/propctrlr/eventhandler.cxx extensions/source/propctrlr/formcomponenthandler.cxx extensions/source/propctrlr/pcrcomponentcontext.hxx extensions/source/scanner/twain.cxx extensions/source/update/check/updatecheckconfig.hxx external/mingwheaders/mingw_atl_headers.patch extras/source/misc_config/wizard/web/layouts/source.xml.xsl fileaccess/source/FileAccess.cxx filter/inc/filter/msfilter/msocximex.hxx filter/inc/filter/msfilter/svxmsbas.hxx filter/qa/complex/filter/detection/typeDetection/Helper.java filter/source/config/cache/basecontainer.cxx filter/source/config/cache/cacheitem.hxx filter/source/config/cache/contenthandlerfactory.cxx filter/source/config/cache/filtercache.cxx filter/source/config/cache/filtercache.hxx filter/source/config/cache/filterfactory.cxx filter/source/config/cache/frameloaderfactory.cxx filter/source/config/cache/querytokenizer.hxx filter/source/config/cache/typedetection.cxx filter/source/config/cache/typedetection.hxx filter/source/config/cache/versions.hxx filter/source/config/fragments/makefile.mk filter/source/config/tools/merge/pyAltFCFGMerge filter/source/flash/swfwriter.cxx filter/source/flash/swfwriter1.cxx filter/source/msfilter/msdffimp.cxx filter/source/msfilter/msocximex.cxx filter/source/msfilter/msvbahelper.cxx filter/source/msfilter/svxmsbas.cxx filter/source/xmlfilterdetect/filterdetect.cxx filter/source/xslt/import/uof2/uof2odf.xsl filter/source/xslt/odf2xhtml/export/xhtml/body.xsl filter/source/xsltfilter/com/sun/star/comp/xsltfilter/Base64.java forms/source/xforms/convert.hxx forms/source/xforms/model.cxx fpicker/source/aqua/SalAquaFilePicker.mm fpicker/source/office/fpinteraction.cxx fpicker/source/unx/gnome/SalGtkFolderPicker.cxx fpicker/source/unx/kde4/KDE4FilePicker.cxx fpicker/source/win32/filepicker/PreviewCtrl.cxx fpicker/source/win32/filepicker/PreviewCtrl.hxx fpicker/source/win32/filepicker/VistaFilePicker.cxx fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx fpicker/source/win32/filepicker/helppopupwindow.hxx fpicker/source/win32/folderpicker/MtaFop.hxx framework/inc/classes/droptargetlistener.hxx framework/inc/classes/filtercache.hxx framework/inc/classes/filtercachedata.hxx framework/inc/classes/protocolhandlercache.hxx framework/inc/classes/servicemanager.hxx framework/inc/commands.h framework/inc/dispatch/basedispatcher.hxx framework/inc/dispatch/blankdispatcher.hxx framework/inc/dispatch/closedispatcher.hxx framework/inc/dispatch/createdispatcher.hxx framework/inc/dispatch/dispatchprovider.hxx framework/inc/dispatch/helpagentdispatcher.hxx framework/inc/dispatch/mailtodispatcher.hxx framework/inc/dispatch/menudispatcher.hxx framework/inc/dispatch/oxt_handler.hxx framework/inc/dispatch/popupmenudispatcher.hxx framework/inc/dispatch/selfdispatcher.hxx framework/inc/dispatch/servicehandler.hxx framework/inc/dispatch/startmoduledispatcher.hxx framework/inc/dispatch/systemexec.hxx framework/inc/helper/fixeddocumentproperties.hxx framework/inc/helper/ocomponentaccess.hxx framework/inc/helper/oframes.hxx framework/inc/helper/otasksenumeration.hxx framework/inc/helper/persistentwindowstate.hxx framework/inc/helper/statusindicator.hxx framework/inc/helper/statusindicatorfactory.hxx framework/inc/helper/tagwindowasmodified.hxx framework/inc/helper/titlebarupdate.hxx framework/inc/helper/vclstatusindicator.hxx framework/inc/interaction/quietinteraction.hxx framework/inc/jobs/helponstartup.hxx framework/inc/jobs/job.hxx framework/inc/jobs/jobdata.hxx framework/inc/jobs/jobexecutor.hxx framework/inc/loadstate.h framework/inc/macros/debug/assertion.hxx framework/inc/macros/debug/event.hxx framework/inc/macros/debug/filterdbg.hxx framework/inc/macros/debug/memorymeasure.hxx framework/inc/macros/debug/timemeasure.hxx framework/inc/macros/xserviceinfo.hxx framework/inc/queries.h framework/inc/recording/dispatchrecordersupplier.hxx framework/inc/services/autorecovery.hxx framework/inc/services/backingcomp.hxx framework/inc/services/contenthandlerfactory.hxx framework/inc/services/desktop.hxx framework/inc/services/detectorfactory.hxx framework/inc/services/frame.hxx framework/inc/services/frameloaderfactory.hxx framework/inc/services/layoutmanager.hxx framework/inc/services/license.hxx framework/inc/services/logindialog.hxx framework/inc/services/modulemanager.hxx framework/inc/services/pathsettings.hxx framework/inc/services/pluginframe.hxx framework/inc/services/substitutepathvars.hxx framework/inc/services/task.hxx framework/inc/services/taskcreatorsrv.hxx framework/inc/stdtypes.h framework/inc/threadhelp/fairrwlock.hxx framework/inc/threadhelp/inoncopyable.h framework/inc/threadhelp/itransactionmanager.h framework/inc/threadhelp/lockhelper.hxx framework/inc/threadhelp/readguard.hxx framework/inc/threadhelp/resetableguard.hxx framework/inc/threadhelp/transactionguard.hxx framework/inc/threadhelp/writeguard.hxx framework/inc/uifactory/uielementfactorymanager.hxx framework/inc/xml/acceleratorconfigurationreader.hxx framework/qa/complex/dispatches/checkdispatchapi.java framework/qa/complex/framework/autosave/AutoSave.java framework/qa/complex/framework/autosave/Protocol.java framework/qa/complex/framework/recovery/RecoveryTest.java framework/qa/complex/loadAllDocuments/StreamSimulator.java framework/source/accelerators/acceleratorconfiguration.cxx framework/source/accelerators/acceleratorexecute.cxx framework/source/accelerators/acceleratorexecute.hxx framework/source/accelerators/keymapping.cxx framework/source/accelerators/presethandler.cxx framework/source/application/framework.cxx framework/source/application/login.cxx framework/source/classes/framecontainer.cxx framework/source/classes/menumanager.cxx framework/source/classes/taskcreator.cxx framework/source/dispatch/closedispatcher.cxx framework/source/dispatch/dispatchprovider.cxx framework/source/dispatch/helpagentdispatcher.cxx framework/source/dispatch/interceptionhelper.cxx framework/source/dispatch/mailtodispatcher.cxx framework/source/dispatch/menudispatcher.cxx framework/source/dispatch/oxt_handler.cxx framework/source/dispatch/servicehandler.cxx framework/source/fwe/classes/framelistanalyzer.cxx framework/source/fwe/dispatch/interaction.cxx framework/source/fwe/helper/titlehelper.cxx framework/source/fwe/helper/undomanagerhelper.cxx framework/source/fwe/xml/eventsdocumenthandler.cxx framework/source/fwe/xml/statusbardocumenthandler.cxx framework/source/fwe/xml/toolboxdocumenthandler.cxx framework/source/fwi/classes/protocolhandlercache.cxx framework/source/fwi/threadhelp/lockhelper.cxx framework/source/fwi/threadhelp/transactionmanager.cxx framework/source/helper/persistentwindowstate.cxx framework/source/helper/statusindicatorfactory.cxx framework/source/helper/vclstatusindicator.cxx framework/source/inc/accelerators/acceleratorcache.hxx framework/source/inc/accelerators/acceleratorconfiguration.hxx framework/source/inc/accelerators/presethandler.hxx framework/source/inc/accelerators/storageholder.hxx framework/source/inc/loadenv/actionlockguard.hxx framework/source/inc/loadenv/loadenv.hxx framework/source/inc/loadenv/loadenvexception.hxx framework/source/inc/pattern/frame.hxx framework/source/inc/pattern/storages.hxx framework/source/inc/pattern/window.hxx framework/source/jobs/helponstartup.cxx framework/source/jobs/job.cxx framework/source/jobs/jobdata.cxx framework/source/jobs/jobdispatch.cxx framework/source/jobs/jobresult.cxx framework/source/jobs/joburl.cxx framework/source/jobs/shelljob.cxx framework/source/loadenv/loadenv.cxx framework/source/services/autorecovery.cxx framework/source/services/backingwindow.cxx framework/source/services/desktop.cxx framework/source/services/frame.cxx framework/source/services/modulemanager.cxx framework/source/services/pathsettings.cxx framework/source/services/substitutepathvars.cxx framework/source/uiconfiguration/moduleuicfgsupplier.cxx framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx framework/source/uiconfiguration/uicategorydescription.cxx framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx framework/source/uiconfiguration/windowstateconfiguration.cxx framework/source/uielement/uicommanddescription.cxx framework/source/unotypes/fwk.xml framework/source/xml/imagesdocumenthandler.cxx framework/test/test.cxx framework/test/test_componentenumeration.bas framework/test/test_statusindicatorfactory.bas framework/test/threadtest.cxx framework/test/threadtest/threadtest.cxx framework/test/typecfg/cfgview.cxx framework/test/typecfg/xml2xcd.cxx include/basegfx/polygon/b2dpolygon.hxx include/canvas/base/graphicdevicebase.hxx include/canvas/canvastools.hxx include/comphelper/configurationhelper.hxx include/comphelper/embeddedobjectcontainer.hxx include/comphelper/propagg.hxx include/comphelper/sequenceashashmap.hxx include/connectivity/sqlerror.hxx include/connectivity/sqlnode.hxx include/cppuhelper/propshlp.hxx include/editeng/AccessibleContextBase.hxx include/framework/framelistanalyzer.hxx sfx2/source/dialog/backingcomp.cxx vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx Change-Id: I2618bf83c0e30f68f23ff25f6eb466df04d34c6d
2014-04-29 19:05:05 +00:00
// TODO(rodo) handle endianness
#ifdef OSL_BIGENDIAN
if( pAlphaReadAcc )
nAlpha = data[ nOff++ ];
else
nAlpha = data[ nOff++ ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetRed() )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetGreen() )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetBlue() )/255 );
#else
if( pAlphaReadAcc )
nAlpha = data[ nOff + 3 ];
else
nAlpha = data[ nOff + 3 ] = 255;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetBlue() )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetGreen() )/255 );
data[ nOff++ ] = sal::static_int_cast<unsigned char>(( nAlpha*aColor.GetRed() )/255 );
nOff ++;
#endif
}
}
}
::Bitmap::ReleaseAccess( pBitmapReadAcc );
if( pAlphaReadAcc )
aAlpha.ReleaseAccess( pAlphaReadAcc );
SurfaceSharedPtr pImageSurface = rSurfaceProvider->getOutputDevice()->CreateSurface(
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
CairoSurfaceSharedPtr(
cairo_image_surface_create_for_data(
data,
bIsAlpha ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24,
nWidth, nHeight, nWidth*4 ),
&cairo_surface_destroy) );
pSurface = pImageSurface;
bHasAlpha = bIsAlpha;
SAL_INFO( "canvas.cairo","image: " << nWidth << " x " << nHeight << " alpha: " << bIsAlpha << " alphaRead " << std::hex << pAlphaReadAcc);
}
}
return pSurface;
}
static void addColorStops( cairo_pattern_t* pPattern, const uno::Sequence< uno::Sequence< double > >& rColors, const uno::Sequence< double >& rStops, bool bReverseStops = false )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
int i;
OSL_ASSERT( rColors.getLength() == rStops.getLength() );
for( i = 0; i < rColors.getLength(); i++ )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const uno::Sequence< double >& rColor( rColors[i] );
float stop = bReverseStops ? 1 - rStops[i] : rStops[i];
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( rColor.getLength() == 3 )
cairo_pattern_add_color_stop_rgb( pPattern, stop, rColor[0], rColor[1], rColor[2] );
else if( rColor.getLength() == 4 )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
double alpha = rColor[3];
// cairo expects premultiplied alpha
cairo_pattern_add_color_stop_rgba( pPattern, stop, rColor[0]*alpha, rColor[1]*alpha, rColor[2]*alpha, alpha );
}
}
}
static uno::Sequence<double> lerp(const uno::Sequence<double>& rLeft, const uno::Sequence<double>& rRight, double fAlpha)
{
if( rLeft.getLength() == 3 )
{
uno::Sequence<double> aRes(3);
aRes[0] = basegfx::tools::lerp(rLeft[0],rRight[0],fAlpha);
aRes[1] = basegfx::tools::lerp(rLeft[1],rRight[1],fAlpha);
aRes[2] = basegfx::tools::lerp(rLeft[2],rRight[2],fAlpha);
return aRes;
}
else if( rLeft.getLength() == 4 )
{
uno::Sequence<double> aRes(4);
aRes[0] = basegfx::tools::lerp(rLeft[0],rRight[0],fAlpha);
aRes[1] = basegfx::tools::lerp(rLeft[1],rRight[1],fAlpha);
aRes[2] = basegfx::tools::lerp(rLeft[2],rRight[2],fAlpha);
aRes[3] = basegfx::tools::lerp(rLeft[3],rRight[3],fAlpha);
return aRes;
}
return uno::Sequence<double>();
}
static cairo_pattern_t* patternFromParametricPolyPolygon( ::canvas::ParametricPolyPolygon& rPolygon )
{
cairo_pattern_t* pPattern = NULL;
const ::canvas::ParametricPolyPolygon::Values aValues = rPolygon.getValues();
double x0, x1, y0, y1, cx, cy, r0, r1;
switch( aValues.meType )
{
case ::canvas::ParametricPolyPolygon::GRADIENT_LINEAR:
x0 = 0;
y0 = 0;
x1 = 1;
y1 = 0;
pPattern = cairo_pattern_create_linear( x0, y0, x1, y1 );
addColorStops( pPattern, aValues.maColors, aValues.maStops );
break;
case ::canvas::ParametricPolyPolygon::GRADIENT_ELLIPTICAL:
cx = 0;
cy = 0;
r0 = 0;
r1 = 1;
pPattern = cairo_pattern_create_radial( cx, cy, r0, cy, cy, r1 );
addColorStops( pPattern, aValues.maColors, aValues.maStops, true );
break;
default:
break;
}
return pPattern;
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
static void doOperation( Operation aOperation,
cairo_t* pCairo,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const uno::Sequence< rendering::Texture >* pTextures,
const SurfaceProviderRef& pDevice,
const basegfx::B2DRange& rBounds )
{
switch( aOperation )
{
case Fill:
/* TODO: multitexturing */
if( pTextures )
{
const ::com::sun::star::rendering::Texture& aTexture ( (*pTextures)[0] );
if( aTexture.Bitmap.is() )
{
unsigned char* data = NULL;
bool bHasAlpha = false;
SurfaceSharedPtr pSurface = surfaceFromXBitmap( (*pTextures)[0].Bitmap, pDevice, data, bHasAlpha );
if( pSurface )
{
cairo_pattern_t* pPattern;
cairo_save( pCairo );
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
cairo_matrix_t aScaleMatrix, aTextureMatrix, aScaledTextureMatrix;
cairo_matrix_init( &aTextureMatrix,
aTransform.m00, aTransform.m10, aTransform.m01,
aTransform.m11, aTransform.m02, aTransform.m12);
geometry::IntegerSize2D aSize = aTexture.Bitmap->getSize();
cairo_matrix_init_scale( &aScaleMatrix, 1.0/aSize.Width, 1.0/aSize.Height );
cairo_matrix_multiply( &aScaledTextureMatrix, &aTextureMatrix, &aScaleMatrix );
cairo_matrix_invert( &aScaledTextureMatrix );
// we don't care about repeat mode yet, so the workaround is disabled for now
pPattern = cairo_pattern_create_for_surface( pSurface->getCairoSurface().get() );
if( aTexture.RepeatModeX == rendering::TexturingMode::REPEAT &&
aTexture.RepeatModeY == rendering::TexturingMode::REPEAT )
{
cairo_pattern_set_extend( pPattern, CAIRO_EXTEND_REPEAT );
}
else if ( aTexture.RepeatModeX == rendering::TexturingMode::NONE &&
aTexture.RepeatModeY == rendering::TexturingMode::NONE )
{
cairo_pattern_set_extend( pPattern, CAIRO_EXTEND_NONE );
}
else if ( aTexture.RepeatModeX == rendering::TexturingMode::CLAMP &&
aTexture.RepeatModeY == rendering::TexturingMode::CLAMP )
{
cairo_pattern_set_extend( pPattern, CAIRO_EXTEND_PAD );
}
aScaledTextureMatrix.x0 = basegfx::fround( aScaledTextureMatrix.x0 );
aScaledTextureMatrix.y0 = basegfx::fround( aScaledTextureMatrix.y0 );
cairo_pattern_set_matrix( pPattern, &aScaledTextureMatrix );
cairo_set_source( pCairo, pPattern );
if( !bHasAlpha )
cairo_set_operator( pCairo, CAIRO_OPERATOR_SOURCE );
cairo_fill( pCairo );
cairo_restore( pCairo );
cairo_pattern_destroy( pPattern );
}
if( data )
free( data );
}
else if( aTexture.Gradient.is() )
{
uno::Reference< lang::XServiceInfo > xRef( aTexture.Gradient, uno::UNO_QUERY );
SAL_INFO( "canvas.cairo", "gradient fill" );
2012-04-06 14:09:04 +02:00
if( xRef.is() && xRef->getImplementationName() == PARAMETRICPOLYPOLYGON_IMPLEMENTATION_NAME )
{
// TODO(Q1): Maybe use dynamic_cast here
// TODO(E1): Return value
// TODO(F1): FillRule
SAL_INFO( "canvas.cairo", "known implementation" );
::canvas::ParametricPolyPolygon* pPolyImpl = static_cast< ::canvas::ParametricPolyPolygon* >( aTexture.Gradient.get() );
::com::sun::star::geometry::AffineMatrix2D aTransform( aTexture.AffineTransform );
cairo_matrix_t aTextureMatrix;
cairo_matrix_init( &aTextureMatrix,
aTransform.m00, aTransform.m10, aTransform.m01,
aTransform.m11, aTransform.m02, aTransform.m12);
if( pPolyImpl->getValues().meType == canvas::ParametricPolyPolygon::GRADIENT_RECTANGULAR )
{
// no general path gradient yet in cairo; emulate then
cairo_save( pCairo );
cairo_clip( pCairo );
// fill bound rect with start color
cairo_rectangle( pCairo, rBounds.getMinX(), rBounds.getMinY(),
rBounds.getWidth(), rBounds.getHeight() );
setColor(pCairo,pPolyImpl->getValues().maColors[0]);
cairo_fill(pCairo);
cairo_transform( pCairo, &aTextureMatrix );
// longest line in gradient bound rect
const unsigned int nGradientSize(
static_cast<unsigned int>(
::basegfx::B2DVector(rBounds.getMinimum() - rBounds.getMaximum()).getLength() + 1.0 ) );
// typical number for pixel of the same color (strip size)
const unsigned int nStripSize( nGradientSize < 50 ? 2 : 4 );
// use at least three steps, and at utmost the number of color
// steps
const unsigned int nStepCount(
::std::max(
3U,
::std::min(
nGradientSize / nStripSize,
128U )) + 1 );
const uno::Sequence<double>* pColors=&pPolyImpl->getValues().maColors[0];
basegfx::tools::KeyStopLerp aLerper(pPolyImpl->getValues().maStops);
for( unsigned int i=1; i<nStepCount; ++i )
{
const double fT( i/double(nStepCount) );
std::ptrdiff_t nIndex;
double fAlpha;
boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT);
setColor(pCairo, lerp(pColors[nIndex], pColors[nIndex+1], fAlpha));
cairo_rectangle( pCairo, -1+fT, -1+fT, 2-2*fT, 2-2*fT );
cairo_fill(pCairo);
}
cairo_restore( pCairo );
}
else
{
cairo_pattern_t* pPattern = patternFromParametricPolyPolygon( *pPolyImpl );
if( pPattern )
{
SAL_INFO( "canvas.cairo", "filling with pattern" );
cairo_save( pCairo );
cairo_transform( pCairo, &aTextureMatrix );
cairo_set_source( pCairo, pPattern );
cairo_fill( pCairo );
cairo_restore( pCairo );
cairo_pattern_destroy( pPattern );
}
}
}
}
}
else
cairo_fill( pCairo );
SAL_INFO( "canvas.cairo", "fill");
break;
case Stroke:
cairo_stroke( pCairo );
SAL_INFO( "canvas.cairo", "stroke");
break;
case Clip:
cairo_clip( pCairo );
SAL_INFO( "canvas.cairo", "clip");
break;
}
}
static void clipNULL( cairo_t *pCairo )
{
SAL_INFO( "canvas.cairo", "clipNULL");
cairo_matrix_t aOrigMatrix, aIdentityMatrix;
/* we set identity matrix here to overcome bug in cairo 0.9.2
where XCreatePixmap is called with zero width and height.
it also reaches faster path in cairo clipping code.
*/
cairo_matrix_init_identity( &aIdentityMatrix );
cairo_get_matrix( pCairo, &aOrigMatrix );
cairo_set_matrix( pCairo, &aIdentityMatrix );
cairo_reset_clip( pCairo );
cairo_rectangle( pCairo, 0, 0, 1, 1 );
cairo_clip( pCairo );
cairo_rectangle( pCairo, 2, 0, 1, 1 );
cairo_clip( pCairo );
/* restore the original matrix */
cairo_set_matrix( pCairo, &aOrigMatrix );
}
void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
Operation aOperation,
cairo_t* pCairo,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const uno::Sequence< rendering::Texture >* pTextures,
const SurfaceProviderRef& pDevice,
rendering::FillRule eFillrule )
{
if( pTextures )
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
ENSURE_ARG_OR_THROW( pTextures->getLength(),
"CanvasHelper::fillTexturedPolyPolygon: empty texture sequence");
bool bOpToDo = false;
cairo_matrix_t aOrigMatrix, aIdentityMatrix;
double nX, nY, nBX, nBY, nAX, nAY;
cairo_get_matrix( pCairo, &aOrigMatrix );
cairo_matrix_init_identity( &aIdentityMatrix );
cairo_set_matrix( pCairo, &aIdentityMatrix );
cairo_set_fill_rule( pCairo,
eFillrule == rendering::FillRule_EVEN_ODD ?
CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING );
for( sal_uInt32 nPolygonIndex = 0; nPolygonIndex < aPolyPolygon.count(); nPolygonIndex++ )
{
::basegfx::B2DPolygon aPolygon( aPolyPolygon.getB2DPolygon( nPolygonIndex ) );
const sal_uInt32 nPointCount( aPolygon.count() );
// to correctly render closed curves, need to output first
// point twice (so output one additional point)
const sal_uInt32 nExtendedPointCount( nPointCount +
int(aPolygon.isClosed() && aPolygon.areControlPointsUsed()) );
if( nPointCount > 1)
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
{
bool bIsBezier = aPolygon.areControlPointsUsed();
bool bIsRectangle = ::basegfx::tools::isRectangle( aPolygon );
::basegfx::B2DPoint aA, aB, aP;
for( sal_uInt32 j=0; j < nExtendedPointCount; j++ )
{
aP = aPolygon.getB2DPoint( j % nPointCount );
nX = aP.getX();
nY = aP.getY();
cairo_matrix_transform_point( &aOrigMatrix, &nX, &nY );
if( ! bIsBezier && (bIsRectangle || aOperation == Clip) )
{
nX = basegfx::fround( nX );
nY = basegfx::fround( nY );
}
if( aOperation == Stroke )
{
nX += 0.5;
nY += 0.5;
}
if( j==0 )
{
cairo_move_to( pCairo, nX, nY );
SAL_INFO( "canvas.cairo", "move to " << nX << "," << nY );
}
else
{
if( bIsBezier )
{
aA = aPolygon.getNextControlPoint( (j-1) % nPointCount );
aB = aPolygon.getPrevControlPoint( j % nPointCount );
nAX = aA.getX();
nAY = aA.getY();
nBX = aB.getX();
nBY = aB.getY();
cairo_matrix_transform_point( &aOrigMatrix, &nAX, &nAY );
cairo_matrix_transform_point( &aOrigMatrix, &nBX, &nBY );
if( aOperation == Stroke )
{
nAX += 0.5;
nAY += 0.5;
nBX += 0.5;
nBY += 0.5;
}
cairo_curve_to( pCairo, nAX, nAY, nBX, nBY, nX, nY );
}
else
{
cairo_line_to( pCairo, nX, nY );
SAL_INFO( "canvas.cairo", "line to " << nX << "," << nY );
}
bOpToDo = true;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
}
}
if( aPolygon.isClosed() )
cairo_close_path( pCairo );
}
else
{
SAL_INFO( "canvas.cairo", "empty polygon for op: " << aOperation );
if( aOperation == Clip )
{
clipNULL( pCairo );
return;
}
}
}
if( aOperation == Fill && pTextures )
{
cairo_set_matrix( pCairo, &aOrigMatrix );
doOperation( aOperation, pCairo, pTextures, pDevice, aPolyPolygon.getB2DRange() );
cairo_set_matrix( pCairo, &aIdentityMatrix );
}
if( bOpToDo && ( aOperation != Fill || !pTextures ) )
doOperation( aOperation, pCairo, pTextures, pDevice, aPolyPolygon.getB2DRange() );
cairo_set_matrix( pCairo, &aOrigMatrix );
if( aPolyPolygon.count() == 0 && aOperation == Clip )
clipNULL( pCairo );
}
void CanvasHelper::doPolyPolygonPath( const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
Operation aOperation,
bool bNoLineJoin,
const uno::Sequence< rendering::Texture >* pTextures,
cairo_t* pCairo ) const
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const ::basegfx::B2DPolyPolygon& rPolyPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( !pCairo )
pCairo = mpCairo.get();
if(bNoLineJoin && Stroke == aOperation)
{
// emulate rendering::PathJoinType::NONE by painting single edges
for(sal_uInt32 a(0); a < rPolyPoly.count(); a++)
{
const basegfx::B2DPolygon aCandidate(rPolyPoly.getB2DPolygon(a));
const sal_uInt32 nPointCount(aCandidate.count());
if(nPointCount)
{
2011-02-17 15:55:19 +01:00
const sal_uInt32 nEdgeCount(aCandidate.isClosed() ? nPointCount: nPointCount - 1);
basegfx::B2DPolygon aEdge;
aEdge.append(aCandidate.getB2DPoint(0));
aEdge.append(basegfx::B2DPoint(0.0, 0.0));
for(sal_uInt32 b(0); b < nEdgeCount; b++)
{
const sal_uInt32 nNextIndex((b + 1) % nPointCount);
aEdge.setB2DPoint(1, aCandidate.getB2DPoint(nNextIndex));
aEdge.setNextControlPoint(0, aCandidate.getNextControlPoint(b % nPointCount));
aEdge.setPrevControlPoint(1, aCandidate.getPrevControlPoint(nNextIndex));
doPolyPolygonImplementation( basegfx::B2DPolyPolygon(aEdge),
aOperation,
pCairo, pTextures,
mpSurfaceProvider,
xPolyPolygon->getFillRule() );
// prepare next step
aEdge.setB2DPoint(0, aEdge.getB2DPoint(1));
}
}
}
}
else
{
doPolyPolygonImplementation( rPolyPoly, aOperation,
pCairo, pTextures,
mpSurfaceProvider,
xPolyPolygon->getFillRule() );
}
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +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 canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
if( mpCairo )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_save( mpCairo.get() );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_line_width( mpCairo.get(), 1 );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
useStates( viewState, renderState, true );
doPolyPolygonPath( xPolyPolygon, Stroke );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_restore( mpCairo.get() );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "drawPolyPolygon" );
#endif
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
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 )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
if( mpCairo )
{
cairo_save( mpCairo.get() );
useStates( viewState, renderState, true );
cairo_matrix_t aMatrix;
double w = strokeAttributes.StrokeWidth, h = 0;
cairo_get_matrix( mpCairo.get(), &aMatrix );
cairo_matrix_transform_distance( &aMatrix, &w, &h );
cairo_set_line_width( mpCairo.get(), w );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_miter_limit( mpCairo.get(), strokeAttributes.MiterLimit );
// FIXME: cairo doesn't handle end cap so far (rodo)
switch( strokeAttributes.StartCapType )
{
case rendering::PathCapType::BUTT:
cairo_set_line_cap( mpCairo.get(), CAIRO_LINE_CAP_BUTT );
break;
case rendering::PathCapType::ROUND:
cairo_set_line_cap( mpCairo.get(), CAIRO_LINE_CAP_ROUND );
break;
case rendering::PathCapType::SQUARE:
cairo_set_line_cap( mpCairo.get(), CAIRO_LINE_CAP_SQUARE );
break;
}
bool bNoLineJoin(false);
switch( strokeAttributes.JoinType )
{
case rendering::PathJoinType::NONE:
bNoLineJoin = true;
// cairo doesn't have join type NONE so we use MITER as it's pretty close
case rendering::PathJoinType::MITER:
cairo_set_line_join( mpCairo.get(), CAIRO_LINE_JOIN_MITER );
break;
case rendering::PathJoinType::ROUND:
cairo_set_line_join( mpCairo.get(), CAIRO_LINE_JOIN_ROUND );
break;
case rendering::PathJoinType::BEVEL:
cairo_set_line_join( mpCairo.get(), CAIRO_LINE_JOIN_BEVEL );
break;
}
if( strokeAttributes.DashArray.getLength() > 0 )
{
double* pDashArray = new double[ strokeAttributes.DashArray.getLength() ];
for( sal_Int32 i=0; i<strokeAttributes.DashArray.getLength(); i++ )
pDashArray[i] = strokeAttributes.DashArray[i] * w;
cairo_set_dash( mpCairo.get(), pDashArray, strokeAttributes.DashArray.getLength(), 0 );
delete[] pDashArray;
}
// TODO(rodo) use LineArray of strokeAttributes
doPolyPolygonPath( xPolyPolygon, Stroke, bNoLineJoin );
cairo_restore( mpCairo.get() );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "strokePolyPolygon" );
#endif
// TODO(P1): Provide caching here.
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/,
const rendering::ViewState& /*viewState*/,
const rendering::RenderState& /*renderState*/,
const uno::Sequence< rendering::Texture >& /*textures*/,
const rendering::StrokeAttributes& /*strokeAttributes*/ )
{
// TODO
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/,
const rendering::ViewState& /*viewState*/,
const rendering::RenderState& /*renderState*/,
const uno::Sequence< rendering::Texture >& /*textures*/,
const uno::Reference< geometry::XMapping2D >& /*xMapping*/,
const rendering::StrokeAttributes& /*strokeAttributes*/ )
{
// TODO
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/,
const rendering::ViewState& /*viewState*/,
const rendering::RenderState& /*renderState*/,
const rendering::StrokeAttributes& /*strokeAttributes*/ )
{
// TODO
return uno::Reference< rendering::XPolyPolygon2D >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
if( mpCairo )
{
cairo_save( mpCairo.get() );
useStates( viewState, renderState, true );
doPolyPolygonPath( xPolyPolygon, Fill );
cairo_restore( mpCairo.get() );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "fillPolyPolygon" );
#endif
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const uno::Sequence< rendering::Texture >& textures )
{
if( mpCairo )
{
cairo_save( mpCairo.get() );
useStates( viewState, renderState, true );
doPolyPolygonPath( xPolyPolygon, Fill, false, &textures );
cairo_restore( mpCairo.get() );
}
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* ,
const uno::Reference< rendering::XPolyPolygon2D >& /*xPolyPolygon*/,
const rendering::ViewState& /*viewState*/,
const rendering::RenderState& /*renderState*/,
const uno::Sequence< rendering::Texture >& /*textures*/,
const uno::Reference< geometry::XMapping2D >& /*xMapping*/ )
{
// TODO
return uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmapSurface( const rendering::XCanvas* pCanvas,
const SurfaceSharedPtr& pInputSurface,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const geometry::IntegerSize2D& rSize,
bool bModulateColors,
bool bHasAlpha )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
SurfaceSharedPtr pSurface=pInputSurface;
uno::Reference< rendering::XCachedPrimitive > rv = uno::Reference< rendering::XCachedPrimitive >(NULL);
geometry::IntegerSize2D aBitmapSize = rSize;
if( mpCairo )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_save( mpCairo.get() );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_rectangle( mpCairo.get(), 0, 0, maSize.getX(), maSize.getY() );
cairo_clip( mpCairo.get() );
useStates( viewState, renderState, true );
cairo_matrix_t aMatrix;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_get_matrix( mpCairo.get(), &aMatrix );
if( ! ::rtl::math::approxEqual( aMatrix.xx, 1 ) &&
! ::rtl::math::approxEqual( aMatrix.yy, 1 ) &&
::rtl::math::approxEqual( aMatrix.x0, 0 ) &&
::rtl::math::approxEqual( aMatrix.y0, 0 ) &&
basegfx::fround( rSize.Width * aMatrix.xx ) > 8 &&
basegfx::fround( rSize.Height* aMatrix.yy ) > 8 )
{
double dWidth, dHeight;
dWidth = basegfx::fround( rSize.Width * aMatrix.xx );
dHeight = basegfx::fround( rSize.Height* aMatrix.yy );
aBitmapSize.Width = static_cast<sal_Int32>( dWidth );
aBitmapSize.Height = static_cast<sal_Int32>( dHeight );
SurfaceSharedPtr pScaledSurface = mpSurfaceProvider->createSurface(
::basegfx::B2ISize( aBitmapSize.Width, aBitmapSize.Height ),
bHasAlpha ? CAIRO_CONTENT_COLOR_ALPHA : CAIRO_CONTENT_COLOR );
CairoSharedPtr pCairo = pScaledSurface->getCairo();
cairo_set_operator( pCairo.get(), CAIRO_OPERATOR_SOURCE );
// add 0.5px to size to avoid rounding errors in cairo, leading sometimes to random data on the image right/bottom borders
cairo_scale( pCairo.get(), (dWidth+0.5)/rSize.Width, (dHeight+0.5)/rSize.Height );
cairo_set_source_surface( pCairo.get(), pSurface->getCairoSurface().get(), 0, 0 );
cairo_paint( pCairo.get() );
pSurface = pScaledSurface;
aMatrix.xx = aMatrix.yy = 1;
cairo_set_matrix( mpCairo.get(), &aMatrix );
rv = uno::Reference< rendering::XCachedPrimitive >(
new CachedBitmap( pSurface, 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 canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( !bHasAlpha && mbHaveAlpha )
{
double x, y, width, height;
x = y = 0;
width = aBitmapSize.Width;
height = aBitmapSize.Height;
cairo_matrix_transform_point( &aMatrix, &x, &y );
cairo_matrix_transform_distance( &aMatrix, &width, &height );
// in case the bitmap doesn't have alpha and covers whole area
// we try to change surface to plain rgb
SAL_INFO( "canvas.cairo","chance to change surface to rgb, " << x << ", " << y << ", " << width << " x " << height << " (" << maSize.getX() << " x " << maSize.getY() << ")" );
if( x <= 0 && y <= 0 && x + width >= maSize.getX() && y + height >= maSize.getY() )
{
SAL_INFO( "canvas.cairo","trying to change surface to rgb");
if( mpSurfaceProvider ) {
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
SurfaceSharedPtr pNewSurface = mpSurfaceProvider->changeSurface( false, false );
if( pNewSurface )
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
setSurface( pNewSurface, false );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
// set state to new mpCairo.get()
useStates( viewState, renderState, true );
// use the possibly modified matrix
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_matrix( mpCairo.get(), &aMatrix );
}
}
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_source_surface( mpCairo.get(), pSurface->getCairoSurface().get(), 0, 0 );
if( !bHasAlpha &&
::rtl::math::approxEqual( aMatrix.xx, 1 ) &&
::rtl::math::approxEqual( aMatrix.yy, 1 ) &&
::rtl::math::approxEqual( aMatrix.x0, 0 ) &&
::rtl::math::approxEqual( aMatrix.y0, 0 ) )
cairo_set_operator( mpCairo.get(), CAIRO_OPERATOR_SOURCE );
cairo_pattern_set_extend( cairo_get_source(mpCairo.get()), CAIRO_EXTEND_PAD );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_rectangle( mpCairo.get(), 0, 0, aBitmapSize.Width, aBitmapSize.Height );
cairo_clip( mpCairo.get() );
if( bModulateColors )
cairo_paint_with_alpha( mpCairo.get(), renderState.DeviceColor[3] );
else
cairo_paint( mpCairo.get() );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_restore( mpCairo.get() );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
return rv; // uno::Reference< rendering::XCachedPrimitive >(NULL);
}
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas,
const uno::Reference< rendering::XBitmap >& xBitmap,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
uno::Reference< rendering::XCachedPrimitive > rv;
unsigned char* data = NULL;
bool bHasAlpha = false;
SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap, mpSurfaceProvider, data, bHasAlpha );
geometry::IntegerSize2D aSize = xBitmap->getSize();
if( pSurface )
{
rv = implDrawBitmapSurface( pCanvas, pSurface, viewState, renderState, aSize, false, bHasAlpha );
if( data )
free( data );
}
else
rv = uno::Reference< rendering::XCachedPrimitive >(NULL);
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "drawBitmap" );
#endif
return rv;
}
uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas,
const uno::Reference< rendering::XBitmap >& xBitmap,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
uno::Reference< rendering::XCachedPrimitive > rv;
unsigned char* data = NULL;
bool bHasAlpha = false;
SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap, mpSurfaceProvider, data, bHasAlpha );
geometry::IntegerSize2D aSize = xBitmap->getSize();
if( pSurface )
{
rv = implDrawBitmapSurface( pCanvas, pSurface, viewState, renderState, aSize, true, bHasAlpha );
if( data )
free( data );
}
else
rv = uno::Reference< rendering::XCachedPrimitive >(NULL);
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "drawBitmap" );
#endif
return rv;
}
geometry::IntegerSize2D CanvasHelper::getSize()
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( !mpSurfaceProvider )
geometry::IntegerSize2D(1, 1); // we're disposed
return ::basegfx::unotools::integerSize2DFromB2ISize( maSize );
}
uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D& newSize,
bool /*beFast*/ )
{
#ifdef CAIRO_CANVAS_PERF_TRACE
struct timespec aTimer;
mxDevice->startPerfTrace( &aTimer );
#endif
if( mpCairo )
{
return uno::Reference< rendering::XBitmap >( new CanvasBitmap( ::basegfx::B2ISize( ::canvas::tools::roundUp( newSize.Width ),
::canvas::tools::roundUp( newSize.Height ) ),
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
mpSurfaceProvider, mpDevice, false ) );
}
else
SAL_INFO( "canvas.cairo", "CanvasHelper called after it was disposed");
#ifdef CAIRO_CANVAS_PERF_TRACE
mxDevice->stopPerfTrace( &aTimer, "getScaledBitmap" );
#endif
return uno::Reference< rendering::XBitmap >();
}
uno::Sequence< sal_Int8 > CanvasHelper::getData( rendering::IntegerBitmapLayout& aLayout,
const geometry::IntegerRectangle2D& rect )
{
if( mpCairo )
{
const sal_Int32 nWidth( rect.X2 - rect.X1 );
const sal_Int32 nHeight( rect.Y2 - rect.Y1 );
const cairo_format_t eFormat( mbHaveAlpha ? CAIRO_FORMAT_ARGB32 : CAIRO_FORMAT_RGB24 );
uno::Sequence< sal_Int8 > aRes( 4*nWidth*nHeight );
sal_Int8* pData = aRes.getArray();
cairo_surface_t* pImageSurface = cairo_image_surface_create_for_data( reinterpret_cast<unsigned char *>(pData),
eFormat,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
nWidth, nHeight, 4*nWidth );
cairo_t* pCairo = cairo_create( pImageSurface );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_source_surface( pCairo, mpSurface->getCairoSurface().get(), -rect.X1, -rect.Y1);
cairo_paint( pCairo );
cairo_destroy( pCairo );
cairo_surface_destroy( pImageSurface );
aLayout = impl_getMemoryLayout( nWidth, nHeight );
return aRes;
}
return uno::Sequence< sal_Int8 >();
}
uno::Sequence< sal_Int8 > CanvasHelper::getPixel( rendering::IntegerBitmapLayout& /*bitmapLayout*/,
const geometry::IntegerPoint2D& /*pos*/ )
{
return uno::Sequence< sal_Int8 >();
}
namespace
{
class CairoColorSpace : public cppu::WeakImplHelper1< com::sun::star::rendering::XIntegerBitmapColorSpace >
{
private:
uno::Sequence< sal_Int8 > maComponentTags;
uno::Sequence< sal_Int32 > maBitCounts;
virtual ::sal_Int8 SAL_CALL getType( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return rendering::ColorSpaceType::RGB;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL getComponentTags( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return maComponentTags;
}
virtual ::sal_Int8 SAL_CALL getRenderingIntent( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return rendering::RenderingIntent::PERCEPTUAL;
}
virtual uno::Sequence< beans::PropertyValue > SAL_CALL getProperties( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return uno::Sequence< beans::PropertyValue >();
}
virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException,
uno::RuntimeException, std::exception) SAL_OVERRIDE
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertToARGB(deviceColor));
return targetColorSpace->convertFromARGB(aIntermediate);
}
virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::RGBColor > aRes(nLen/4);
rendering::RGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
const double fAlpha(pIn[3]);
if( fAlpha == 0.0 )
*pOut++ = rendering::RGBColor(0.0, 0.0, 0.0);
else
*pOut++ = rendering::RGBColor(pIn[2]/fAlpha,pIn[1]/fAlpha,pIn[0]/fAlpha);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
const double fAlpha(pIn[3]);
if( fAlpha == 0.0 )
*pOut++ = rendering::ARGBColor(0.0, 0.0, 0.0, 0.0);
else
*pOut++ = rendering::ARGBColor(fAlpha,pIn[2]/fAlpha,pIn[1]/fAlpha,pIn[0]/fAlpha);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::ARGBColor(pIn[3],pIn[2],pIn[1],pIn[1]);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::RGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< double > aRes(nLen*4);
double* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = pIn->Blue;
*pColors++ = pIn->Green;
*pColors++ = pIn->Red;
*pColors++ = 1.0;
++pIn;
}
return aRes;
}
virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< double > aRes(nLen*4);
double* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = pIn->Alpha*pIn->Blue;
*pColors++ = pIn->Alpha*pIn->Green;
*pColors++ = pIn->Alpha*pIn->Red;
*pColors++ = pIn->Alpha;
++pIn;
}
return aRes;
}
virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< double > aRes(nLen*4);
double* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = pIn->Blue;
*pColors++ = pIn->Green;
*pColors++ = pIn->Red;
*pColors++ = pIn->Alpha;
++pIn;
}
return aRes;
}
// XIntegerBitmapColorSpace
virtual ::sal_Int32 SAL_CALL getBitsPerPixel( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return 32;
}
virtual uno::Sequence< ::sal_Int32 > SAL_CALL getComponentBitCounts( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return maBitCounts;
}
virtual ::sal_Int8 SAL_CALL getEndianness( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return util::Endianness::LITTLE;
}
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence<double> aRes(nLen);
double* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
}
return aRes;
}
else
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertIntegerToARGB(deviceColor));
return targetColorSpace->convertFromARGB(aIntermediate);
}
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
// it's us, so simply pass-through the data
return deviceColor;
}
else
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertIntegerToARGB(deviceColor));
return targetColorSpace->convertIntegerFromARGB(aIntermediate);
}
}
virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::RGBColor > aRes(nLen/4);
rendering::RGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
const double fAlpha((sal_uInt8)pIn[3]);
if( fAlpha )
*pOut++ = rendering::RGBColor(
pIn[2]/fAlpha,
pIn[1]/fAlpha,
pIn[0]/fAlpha);
else
*pOut++ = rendering::RGBColor(0,0,0);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
const double fAlpha((sal_uInt8)pIn[3]);
if( fAlpha )
*pOut++ = rendering::ARGBColor(
fAlpha/255.0,
pIn[2]/fAlpha,
pIn[1]/fAlpha,
pIn[0]/fAlpha);
else
*pOut++ = rendering::ARGBColor(0,0,0,0);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::ARGBColor(
vcl::unotools::toDoubleColor(pIn[3]),
vcl::unotools::toDoubleColor(pIn[2]),
vcl::unotools::toDoubleColor(pIn[1]),
vcl::unotools::toDoubleColor(pIn[0]));
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::RGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< sal_Int8 > aRes(nLen*4);
sal_Int8* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = vcl::unotools::toByteColor(pIn->Blue);
*pColors++ = vcl::unotools::toByteColor(pIn->Green);
*pColors++ = vcl::unotools::toByteColor(pIn->Red);
*pColors++ = -1;
++pIn;
}
return aRes;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< sal_Int8 > aRes(nLen*4);
sal_Int8* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
const double fAlpha(pIn->Alpha);
*pColors++ = vcl::unotools::toByteColor(fAlpha*pIn->Blue);
*pColors++ = vcl::unotools::toByteColor(fAlpha*pIn->Green);
*pColors++ = vcl::unotools::toByteColor(fAlpha*pIn->Red);
*pColors++ = vcl::unotools::toByteColor(fAlpha);
++pIn;
}
return aRes;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< sal_Int8 > aRes(nLen*4);
sal_Int8* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = vcl::unotools::toByteColor(pIn->Blue);
*pColors++ = vcl::unotools::toByteColor(pIn->Green);
*pColors++ = vcl::unotools::toByteColor(pIn->Red);
*pColors++ = vcl::unotools::toByteColor(pIn->Alpha);
++pIn;
}
return aRes;
}
public:
CairoColorSpace() :
maComponentTags(4),
maBitCounts(4)
{
sal_Int8* pTags = maComponentTags.getArray();
sal_Int32* pBitCounts = maBitCounts.getArray();
pTags[0] = rendering::ColorComponentTag::RGB_BLUE;
pTags[1] = rendering::ColorComponentTag::RGB_GREEN;
pTags[2] = rendering::ColorComponentTag::RGB_RED;
pTags[3] = rendering::ColorComponentTag::PREMULTIPLIED_ALPHA;
pBitCounts[0] =
pBitCounts[1] =
pBitCounts[2] =
pBitCounts[3] = 8;
}
};
class CairoNoAlphaColorSpace : public cppu::WeakImplHelper1< com::sun::star::rendering::XIntegerBitmapColorSpace >
{
private:
uno::Sequence< sal_Int8 > maComponentTags;
uno::Sequence< sal_Int32 > maBitCounts;
virtual ::sal_Int8 SAL_CALL getType( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return rendering::ColorSpaceType::RGB;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL getComponentTags( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return maComponentTags;
}
virtual ::sal_Int8 SAL_CALL getRenderingIntent( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return rendering::RenderingIntent::PERCEPTUAL;
}
virtual uno::Sequence< beans::PropertyValue > SAL_CALL getProperties( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return uno::Sequence< beans::PropertyValue >();
}
virtual uno::Sequence< double > SAL_CALL convertColorSpace( const uno::Sequence< double >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace ) throw (lang::IllegalArgumentException,
uno::RuntimeException, std::exception) SAL_OVERRIDE
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertToARGB(deviceColor));
return targetColorSpace->convertFromARGB(aIntermediate);
}
virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::RGBColor > aRes(nLen/4);
rendering::RGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::RGBColor(pIn[2], pIn[1], pIn[0]);
pIn += 4;
}
return aRes;
}
uno::Sequence< rendering::ARGBColor > impl_convertToARGB( const uno::Sequence< double >& deviceColor )
{
const double* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::ARGBColor(1.0, pIn[2], pIn[1], pIn[0]);
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertToARGB( deviceColor );
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertToARGB( deviceColor );
}
virtual uno::Sequence< double > SAL_CALL convertFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::RGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< double > aRes(nLen*4);
double* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = pIn->Blue;
*pColors++ = pIn->Green;
*pColors++ = pIn->Red;
*pColors++ = 1.0; // the value does not matter
++pIn;
}
return aRes;
}
uno::Sequence< double > impl_convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< double > aRes(nLen*4);
double* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = pIn->Blue;
*pColors++ = pIn->Green;
*pColors++ = pIn->Red;
*pColors++ = 1.0; // the value does not matter
++pIn;
}
return aRes;
}
virtual uno::Sequence< double > SAL_CALL convertFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertFromARGB( rgbColor );
}
virtual uno::Sequence< double > SAL_CALL convertFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor ) throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertFromARGB( rgbColor );
}
// XIntegerBitmapColorSpace
virtual ::sal_Int32 SAL_CALL getBitsPerPixel( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return 32;
}
virtual uno::Sequence< ::sal_Int32 > SAL_CALL getComponentBitCounts( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return maBitCounts;
}
virtual ::sal_Int8 SAL_CALL getEndianness( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return util::Endianness::LITTLE;
}
virtual uno::Sequence<double> SAL_CALL convertFromIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XColorSpace >& targetColorSpace )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
if( dynamic_cast<CairoColorSpace*>(targetColorSpace.get()) )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence<double> aRes(nLen);
double* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = vcl::unotools::toDoubleColor(*pIn++);
*pOut++ = 1.0; // the value does not matter
}
return aRes;
}
else
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertIntegerToARGB(deviceColor));
return targetColorSpace->convertFromARGB(aIntermediate);
}
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertToIntegerColorSpace( const uno::Sequence< ::sal_Int8 >& deviceColor,
const uno::Reference< rendering::XIntegerBitmapColorSpace >& targetColorSpace )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
if( dynamic_cast<CairoNoAlphaColorSpace*>(targetColorSpace.get()) )
{
// it's us, so simply pass-through the data
return deviceColor;
}
else
{
// TODO(P3): if we know anything about target
// colorspace, this can be greatly sped up
uno::Sequence<rendering::ARGBColor> aIntermediate(
convertIntegerToARGB(deviceColor));
return targetColorSpace->convertIntegerFromARGB(aIntermediate);
}
}
virtual uno::Sequence< rendering::RGBColor > SAL_CALL convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::RGBColor > aRes(nLen/4);
rendering::RGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::RGBColor( pIn[2], pIn[1], pIn[0] );
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertIntegerToARGB( deviceColor );
}
virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertIntegerToARGB( deviceColor );
}
uno::Sequence< rendering::ARGBColor > impl_convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor )
{
const sal_Int8* pIn( deviceColor.getConstArray() );
const sal_Size nLen( deviceColor.getLength() );
ENSURE_ARG_OR_THROW2(nLen%4==0,
"number of channels no multiple of 4",
static_cast<rendering::XColorSpace*>(this), 0);
uno::Sequence< rendering::ARGBColor > aRes(nLen/4);
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
*pOut++ = rendering::ARGBColor(
1.0,
vcl::unotools::toDoubleColor(pIn[2]),
vcl::unotools::toDoubleColor(pIn[1]),
vcl::unotools::toDoubleColor(pIn[0]));
pIn += 4;
}
return aRes;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromRGB( const uno::Sequence< rendering::RGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
const rendering::RGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< sal_Int8 > aRes(nLen*4);
sal_Int8* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = vcl::unotools::toByteColor(pIn->Blue);
*pColors++ = vcl::unotools::toByteColor(pIn->Green);
*pColors++ = vcl::unotools::toByteColor(pIn->Red);
*pColors++ = -1; // the value does not matter
++pIn;
}
return aRes;
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertIntegerFromARGB( rgbColor );
}
virtual uno::Sequence< ::sal_Int8 > SAL_CALL convertIntegerFromPARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) SAL_OVERRIDE
{
return impl_convertIntegerFromARGB( rgbColor );
}
uno::Sequence< ::sal_Int8 > impl_convertIntegerFromARGB( const uno::Sequence< rendering::ARGBColor >& rgbColor )
{
const rendering::ARGBColor* pIn( rgbColor.getConstArray() );
const sal_Size nLen( rgbColor.getLength() );
uno::Sequence< sal_Int8 > aRes(nLen*4);
sal_Int8* pColors=aRes.getArray();
for( sal_Size i=0; i<nLen; ++i )
{
*pColors++ = vcl::unotools::toByteColor(pIn->Blue);
*pColors++ = vcl::unotools::toByteColor(pIn->Green);
*pColors++ = vcl::unotools::toByteColor(pIn->Red);
*pColors++ = -1; // the value does not matter
++pIn;
}
return aRes;
}
public:
CairoNoAlphaColorSpace() :
maComponentTags(3),
maBitCounts(3)
{
sal_Int8* pTags = maComponentTags.getArray();
sal_Int32* pBitCounts = maBitCounts.getArray();
pTags[0] = rendering::ColorComponentTag::RGB_BLUE;
pTags[1] = rendering::ColorComponentTag::RGB_GREEN;
pTags[2] = rendering::ColorComponentTag::RGB_RED;
pBitCounts[0] =
pBitCounts[1] =
pBitCounts[2] = 8;
}
};
struct CairoNoAlphaColorSpaceHolder : public rtl::StaticWithInit<uno::Reference<rendering::XIntegerBitmapColorSpace>,
CairoNoAlphaColorSpaceHolder>
{
uno::Reference<rendering::XIntegerBitmapColorSpace> operator()()
{
return new CairoNoAlphaColorSpace();
}
};
struct CairoColorSpaceHolder : public rtl::StaticWithInit<uno::Reference<rendering::XIntegerBitmapColorSpace>,
CairoColorSpaceHolder>
{
uno::Reference<rendering::XIntegerBitmapColorSpace> operator()()
{
return new CairoColorSpace();
}
};
}
rendering::IntegerBitmapLayout CanvasHelper::getMemoryLayout()
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
if( !mpCairo )
return rendering::IntegerBitmapLayout(); // we're disposed
const geometry::IntegerSize2D aSize(getSize());
return impl_getMemoryLayout( aSize.Width, aSize.Height );
}
rendering::IntegerBitmapLayout
CanvasHelper::impl_getMemoryLayout( const sal_Int32 nWidth, const sal_Int32 nHeight )
{
rendering::IntegerBitmapLayout aLayout;
aLayout.ScanLines = nHeight;
aLayout.ScanLineBytes = nWidth*4;
aLayout.ScanLineStride = aLayout.ScanLineBytes;
aLayout.PlaneStride = 0;
aLayout.ColorSpace = mbHaveAlpha ? CairoColorSpaceHolder::get() : CairoNoAlphaColorSpaceHolder::get();
aLayout.Palette.clear();
aLayout.IsMsbFirst = sal_False;
return aLayout;
}
bool CanvasHelper::repaint( const SurfaceSharedPtr& pSurface,
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
const rendering::ViewState& viewState,
const rendering::RenderState& renderState )
{
SAL_INFO( "canvas.cairo", "CanvasHelper::repaint");
if( mpCairo )
{
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_save( mpCairo.get() );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_rectangle( mpCairo.get(), 0, 0, maSize.getX(), maSize.getY() );
cairo_clip( mpCairo.get() );
useStates( viewState, renderState, true );
cairo_matrix_t aMatrix;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_get_matrix( mpCairo.get(), &aMatrix );
aMatrix.xx = aMatrix.yy = 1;
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_matrix( mpCairo.get(), &aMatrix );
INTEGRATION: CWS canvas05 (1.9.14); FILE MERGED 2008/06/03 15:39:06 thb 1.9.14.17: #i85116# Revived lost changes in cairocanvas 2008/05/30 16:03:39 thb 1.9.14.16: Added test of VirtualDevice::GetCanvas(); corrected one tiny bit in cairocanvas::clear 2008/05/21 13:32:03 thb 1.9.14.15: Made vcl and cairo canvas work with emf+ patches; smoothed out internal cairo makefile changes; corrected cairocanvas sprite update 2008/04/21 07:32:31 thb 1.9.14.14: RESYNC: (1.14-1.15); FILE MERGED 2008/04/20 23:36:08 thb 1.9.14.13: Made canvasdemo work again on dev300; made sure GDIPlusUser is always destroyed _last_ (as it kills all other GDIPlus objects); made cairocanvas sensitive to outdev size 2008/04/07 14:34:10 thb 1.9.14.12: RESYNC: (1.12-1.14); FILE MERGED 2008/04/04 22:08:33 thb 1.9.14.11: Fixed output of bezier polygons for cairo; fixed missing surfaces here and there; removed useless refcounted SurfaceProvider arguments (that lead to premature canvas death, as called during ctor) 2008/04/03 16:02:25 thb 1.9.14.10: Merged in cairoquartz01 changes, reworked into the polymorphic Surface concept now 2008/04/02 22:56:27 thb 1.9.14.9: Reworked Surface class to abstract interface; changed all manual refcount handling to RAII 2008/03/28 23:38:46 thb 1.9.14.8: Backbuffer-less canvas implementation on top of cairo 2008/03/18 22:00:56 thb 1.9.14.7: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/03/13 22:48:50 thb 1.9.14.6: merging in remaining ooo-build cairocanvas fixes; completing std color space implementation 2008/03/13 14:57:21 thb 1.9.14.5: Finishing touches to StdColorSpace; move cairocanvas to new color space mechanisms 2008/01/22 00:50:46 thb 1.9.14.4: RESYNC: (1.10-1.12); FILE MERGED 2007/12/20 22:18:56 thb 1.9.14.3: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering 2007/11/06 12:36:43 thb 1.9.14.2: RESYNC: (1.9-1.10); FILE MERGED 2007/10/01 13:02:01 thb 1.9.14.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
2008-06-24 09:20:51 +00:00
cairo_set_source_surface( mpCairo.get(), pSurface->getCairoSurface().get(), 0, 0 );
cairo_paint( mpCairo.get() );
cairo_restore( mpCairo.get() );
}
return true;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */