INTEGRATION: CWS canvas05 (1.12.26); FILE MERGED
2008/04/21 07:27:58 thb 1.12.26.4: RESYNC: (1.13-1.14); FILE MERGED 2007/12/20 22:18:59 thb 1.12.26.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:52 thb 1.12.26.2: RESYNC: (1.12-1.13); FILE MERGED 2007/10/01 13:02:03 thb 1.12.26.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: canvascustomsprite.cxx,v $
|
* $RCSfile: canvascustomsprite.cxx,v $
|
||||||
* $Revision: 1.14 $
|
* $Revision: 1.15 $
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "precompiled_canvas.hxx"
|
#include "precompiled_canvas.hxx"
|
||||||
|
|
||||||
#include <canvas/debug.hxx>
|
#include <canvas/debug.hxx>
|
||||||
|
#include <tools/diagnose_ex.h>
|
||||||
#include <canvas/verbosetrace.hxx>
|
#include <canvas/verbosetrace.hxx>
|
||||||
|
|
||||||
#include <rtl/math.hxx>
|
#include <rtl/math.hxx>
|
||||||
@@ -62,12 +63,13 @@ namespace vclcanvas
|
|||||||
{
|
{
|
||||||
|
|
||||||
CanvasCustomSprite::CanvasCustomSprite( const geometry::RealSize2D& rSpriteSize,
|
CanvasCustomSprite::CanvasCustomSprite( const geometry::RealSize2D& rSpriteSize,
|
||||||
const SpriteCanvasRef& rSpriteCanvas,
|
rendering::XGraphicDevice& rDevice,
|
||||||
bool bShowSpriteBounds ) :
|
const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
|
||||||
mpSpriteCanvas( rSpriteCanvas )
|
const OutDevProviderSharedPtr& rOutDevProvider,
|
||||||
|
bool bShowSpriteBounds )
|
||||||
{
|
{
|
||||||
ENSURE_AND_THROW( rSpriteCanvas.get() &&
|
ENSURE_OR_THROW( rOwningSpriteCanvas.get() &&
|
||||||
rSpriteCanvas->getOutDev(),
|
rOutDevProvider,
|
||||||
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
|
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
|
||||||
|
|
||||||
// setup back buffer
|
// setup back buffer
|
||||||
@@ -82,11 +84,11 @@ namespace vclcanvas
|
|||||||
ceil( rSpriteSize.Height ))) );
|
ceil( rSpriteSize.Height ))) );
|
||||||
|
|
||||||
// create content backbuffer in screen depth
|
// create content backbuffer in screen depth
|
||||||
BackBufferSharedPtr pBackBuffer( new BackBuffer( *rSpriteCanvas->getOutDev() ) );
|
BackBufferSharedPtr pBackBuffer( new BackBuffer( rOutDevProvider->getOutDev() ) );
|
||||||
pBackBuffer->setSize( aSize );
|
pBackBuffer->setSize( aSize );
|
||||||
|
|
||||||
// create mask backbuffer, with one bit color depth
|
// create mask backbuffer, with one bit color depth
|
||||||
BackBufferSharedPtr pBackBufferMask( new BackBuffer( *rSpriteCanvas->getOutDev(),
|
BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(),
|
||||||
true ) );
|
true ) );
|
||||||
pBackBufferMask->setSize( aSize );
|
pBackBufferMask->setSize( aSize );
|
||||||
|
|
||||||
@@ -94,13 +96,13 @@ namespace vclcanvas
|
|||||||
// antialiasing again, then)
|
// antialiasing again, then)
|
||||||
|
|
||||||
// disable font antialiasing (causes ugly shadows otherwise)
|
// disable font antialiasing (causes ugly shadows otherwise)
|
||||||
pBackBuffer->getVirDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
pBackBuffer->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
||||||
pBackBufferMask->getVirDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
pBackBufferMask->getOutDev().SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
|
||||||
|
|
||||||
// set mask vdev drawmode, such that everything is painted
|
// set mask vdev drawmode, such that everything is painted
|
||||||
// black. That leaves us with a binary image, white for
|
// black. That leaves us with a binary image, white for
|
||||||
// background, black for painted content
|
// background, black for painted content
|
||||||
pBackBufferMask->getVirDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
|
pBackBufferMask->getOutDev().SetDrawMode( DRAWMODE_BLACKLINE | DRAWMODE_BLACKFILL | DRAWMODE_BLACKTEXT |
|
||||||
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
|
DRAWMODE_BLACKGRADIENT | DRAWMODE_BLACKBITMAP );
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +111,7 @@ namespace vclcanvas
|
|||||||
|
|
||||||
// always render into back buffer, don't preserve state (it's
|
// always render into back buffer, don't preserve state (it's
|
||||||
// our private VDev, after all), have notion of alpha
|
// our private VDev, after all), have notion of alpha
|
||||||
maCanvasHelper.init( *rSpriteCanvas.get(),
|
maCanvasHelper.init( rDevice,
|
||||||
pBackBuffer,
|
pBackBuffer,
|
||||||
false,
|
false,
|
||||||
true );
|
true );
|
||||||
@@ -120,7 +122,7 @@ namespace vclcanvas
|
|||||||
// -------------------
|
// -------------------
|
||||||
|
|
||||||
maSpriteHelper.init( rSpriteSize,
|
maSpriteHelper.init( rSpriteSize,
|
||||||
rSpriteCanvas,
|
rOwningSpriteCanvas,
|
||||||
pBackBuffer,
|
pBackBuffer,
|
||||||
pBackBufferMask,
|
pBackBufferMask,
|
||||||
bShowSpriteBounds );
|
bShowSpriteBounds );
|
||||||
@@ -133,8 +135,6 @@ namespace vclcanvas
|
|||||||
{
|
{
|
||||||
tools::LocalGuard aGuard;
|
tools::LocalGuard aGuard;
|
||||||
|
|
||||||
mpSpriteCanvas.clear();
|
|
||||||
|
|
||||||
// forward to parent
|
// forward to parent
|
||||||
CanvasCustomSpriteBaseT::disposing();
|
CanvasCustomSpriteBaseT::disposing();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user