svpgdi.cxx (e6f63103) svpgdi.cxx (5f27b83c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 61 unchanged lines hidden (view full) ---

70// ===========================================================================
71
72bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect&, const SalBitmap& /*rSourceBitmap*/, const SalBitmap& /*rAlphaBitmap*/ )
73{
74 // TODO(P3) implement alpha blending
75 return false;
76}
77
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 61 unchanged lines hidden (view full) ---

70// ===========================================================================
71
72bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect&, const SalBitmap& /*rSourceBitmap*/, const SalBitmap& /*rAlphaBitmap*/ )
73{
74 // TODO(P3) implement alpha blending
75 return false;
76}
77
78bool SvpSalGraphics::drawTransformedBitmap(
79 const basegfx::B2DPoint& rNull,
80 const basegfx::B2DPoint& rX,
81 const basegfx::B2DPoint& rY,
82 const SalBitmap& rSourceBitmap,
83 const SalBitmap* pAlphaBitmap)
84{
85 // here direct support for transformed bitmaps can be impemented
86 (void)rNull; (void)rX; (void)rY; (void)rSourceBitmap; (void)pAlphaBitmap;
87 return false;
88}
89
78bool SvpSalGraphics::drawAlphaRect( long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/, sal_uInt8 /*nTransparency*/ )
79{
80 // TODO(P3) implement alpha blending
81 return false;
82}
83
84SvpSalGraphics::SvpSalGraphics() :
85 m_bUseLineColor( true ),

--- 364 unchanged lines hidden (view full) ---

450 sal_uInt16 /*nFlags*/ )
451{
452 B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
453 B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
454 m_aDevice->drawBitmap( m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
455 dbgOut( m_aDevice );
456}
457
90bool SvpSalGraphics::drawAlphaRect( long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/, sal_uInt8 /*nTransparency*/ )
91{
92 // TODO(P3) implement alpha blending
93 return false;
94}
95
96SvpSalGraphics::SvpSalGraphics() :
97 m_bUseLineColor( true ),

--- 364 unchanged lines hidden (view full) ---

462 sal_uInt16 /*nFlags*/ )
463{
464 B2IRange aSrcRect( nSrcX, nSrcY, nSrcX+nSrcWidth, nSrcY+nSrcHeight );
465 B2IRange aDestRect( nDestX, nDestY, nDestX+nSrcWidth, nDestY+nSrcHeight );
466 m_aDevice->drawBitmap( m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
467 dbgOut( m_aDevice );
468}
469
458void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
470void SvpSalGraphics::copyBits( const SalTwoRect& rPosAry,
459 SalGraphics* pSrcGraphics )
460{
461 SvpSalGraphics* pSrc = pSrcGraphics ?
462 static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
471 SalGraphics* pSrcGraphics )
472{
473 SvpSalGraphics* pSrc = pSrcGraphics ?
474 static_cast<SvpSalGraphics*>(pSrcGraphics) : this;
463 B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
464 pPosAry->mnSrcX+pPosAry->mnSrcWidth,
465 pPosAry->mnSrcY+pPosAry->mnSrcHeight );
466 B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
467 pPosAry->mnDestX+pPosAry->mnDestWidth,
468 pPosAry->mnDestY+pPosAry->mnDestHeight );
475 B2IRange aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
476 rPosAry.mnSrcX+rPosAry.mnSrcWidth,
477 rPosAry.mnSrcY+rPosAry.mnSrcHeight );
478 B2IRange aDestRect( rPosAry.mnDestX, rPosAry.mnDestY,
479 rPosAry.mnDestX+rPosAry.mnDestWidth,
480 rPosAry.mnDestY+rPosAry.mnDestHeight );
469 m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
470 dbgOut( m_aDevice );
471}
472
481 m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
482 dbgOut( m_aDevice );
483}
484
473void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
474 const SalBitmap& rSalBitmap )
485void SvpSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap )
475{
476 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
486{
487 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
477 B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
478 pPosAry->mnSrcX+pPosAry->mnSrcWidth,
479 pPosAry->mnSrcY+pPosAry->mnSrcHeight );
480 B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
481 pPosAry->mnDestX+pPosAry->mnDestWidth,
482 pPosAry->mnDestY+pPosAry->mnDestHeight );
488 B2IRange aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
489 rPosAry.mnSrcX+rPosAry.mnSrcWidth,
490 rPosAry.mnSrcY+rPosAry.mnSrcHeight );
491 B2IRange aDestRect( rPosAry.mnDestX, rPosAry.mnDestY,
492 rPosAry.mnDestX+rPosAry.mnDestWidth,
493 rPosAry.mnDestY+rPosAry.mnDestHeight );
483 m_aDevice->drawBitmap( rSrc.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
484 dbgOut( m_aDevice );
485}
486
494 m_aDevice->drawBitmap( rSrc.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
495 dbgOut( m_aDevice );
496}
497
487void SvpSalGraphics::drawBitmap( const SalTwoRect*,
498void SvpSalGraphics::drawBitmap( const SalTwoRect&,
488 const SalBitmap&,
489 SalColor )
490{
491 // SNI, as in X11 plugin
492}
493
499 const SalBitmap&,
500 SalColor )
501{
502 // SNI, as in X11 plugin
503}
504
494void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
505void SvpSalGraphics::drawBitmap( const SalTwoRect& rPosAry,
495 const SalBitmap& rSalBitmap,
496 const SalBitmap& rTransparentBitmap )
497{
498 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
499 const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap);
506 const SalBitmap& rSalBitmap,
507 const SalBitmap& rTransparentBitmap )
508{
509 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
510 const SvpSalBitmap& rSrcTrans = static_cast<const SvpSalBitmap&>(rTransparentBitmap);
500 B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
501 pPosAry->mnSrcX+pPosAry->mnSrcWidth,
502 pPosAry->mnSrcY+pPosAry->mnSrcHeight );
503 B2IRange aDestRect( pPosAry->mnDestX, pPosAry->mnDestY,
504 pPosAry->mnDestX+pPosAry->mnDestWidth,
505 pPosAry->mnDestY+pPosAry->mnDestHeight );
511 B2IRange aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
512 rPosAry.mnSrcX+rPosAry.mnSrcWidth,
513 rPosAry.mnSrcY+rPosAry.mnSrcHeight );
514 B2IRange aDestRect( rPosAry.mnDestX, rPosAry.mnDestY,
515 rPosAry.mnDestX+rPosAry.mnDestWidth,
516 rPosAry.mnDestY+rPosAry.mnDestHeight );
506 m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
507 dbgOut( m_aDevice );
508}
509
517 m_aDevice->drawMaskedBitmap( rSrc.getBitmap(), rSrcTrans.getBitmap(), aSrcRect, aDestRect, DrawMode_PAINT, m_aClipMap );
518 dbgOut( m_aDevice );
519}
520
510void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
521void SvpSalGraphics::drawMask( const SalTwoRect& rPosAry,
511 const SalBitmap& rSalBitmap,
512 SalColor nMaskColor )
513{
514 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
522 const SalBitmap& rSalBitmap,
523 SalColor nMaskColor )
524{
525 const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSalBitmap);
515 B2IRange aSrcRect( pPosAry->mnSrcX, pPosAry->mnSrcY,
516 pPosAry->mnSrcX+pPosAry->mnSrcWidth,
517 pPosAry->mnSrcY+pPosAry->mnSrcHeight );
518 B2IPoint aDestPoint( pPosAry->mnDestX, pPosAry->mnDestY );
526 B2IRange aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
527 rPosAry.mnSrcX+rPosAry.mnSrcWidth,
528 rPosAry.mnSrcY+rPosAry.mnSrcHeight );
529 B2IPoint aDestPoint( rPosAry.mnDestX, rPosAry.mnDestY );
519
520 // BitmapDevice::drawMaskedColor works with 0==transparent,
521 // 255==opaque. drawMask() semantic is the other way
522 // around. Therefore, invert mask.
523 BitmapDeviceSharedPtr aCopy =
530
531 // BitmapDevice::drawMaskedColor works with 0==transparent,
532 // 255==opaque. drawMask() semantic is the other way
533 // around. Therefore, invert mask.
534 BitmapDeviceSharedPtr aCopy =
524 cloneBitmapDevice( B2IVector( pPosAry->mnSrcWidth, pPosAry->mnSrcHeight ),
535 cloneBitmapDevice( B2IVector( rPosAry.mnSrcWidth, rPosAry.mnSrcHeight ),
525 rSrc.getBitmap() );
526 basebmp::Color aBgColor( COL_WHITE );
527 aCopy->clear(aBgColor);
528 basebmp::Color aFgColor( COL_BLACK );
529 aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() );
530
531 basebmp::Color aColor( nMaskColor );
536 rSrc.getBitmap() );
537 basebmp::Color aBgColor( COL_WHITE );
538 aCopy->clear(aBgColor);
539 basebmp::Color aFgColor( COL_BLACK );
540 aCopy->drawMaskedColor( aFgColor, rSrc.getBitmap(), aSrcRect, B2IPoint() );
541
542 basebmp::Color aColor( nMaskColor );
532 B2IRange aSrcRect2( 0, 0, pPosAry->mnSrcWidth, pPosAry->mnSrcHeight );
543 B2IRange aSrcRect2( 0, 0, rPosAry.mnSrcWidth, rPosAry.mnSrcHeight );
533 m_aDevice->drawMaskedColor( aColor, aCopy, aSrcRect, aDestPoint, m_aClipMap );
534 dbgOut( m_aDevice );
535}
536
537SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight )
538{
539 BitmapDeviceSharedPtr aCopy =
540 cloneBitmapDevice( B2IVector( nWidth, nHeight ),

--- 72 unchanged lines hidden ---
544 m_aDevice->drawMaskedColor( aColor, aCopy, aSrcRect, aDestPoint, m_aClipMap );
545 dbgOut( m_aDevice );
546}
547
548SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight )
549{
550 BitmapDeviceSharedPtr aCopy =
551 cloneBitmapDevice( B2IVector( nWidth, nHeight ),

--- 72 unchanged lines hidden ---