Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d9d82ffc
Kaydet (Commit)
d9d82ffc
authored
Eki 27, 2011
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
headless: cleanup degenerate clipping case to not render or warn.
üst
4b83c028
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
38 deletions
+55
-38
svpgdi.cxx
vcl/headless/svpgdi.cxx
+48
-34
svptext.cxx
vcl/headless/svptext.cxx
+5
-2
svpgdi.hxx
vcl/inc/headless/svpgdi.hxx
+2
-2
No files found.
vcl/headless/svpgdi.cxx
Dosyayı görüntüle @
d9d82ffc
...
...
@@ -196,13 +196,16 @@ SvpSalGraphics::ClipUndoHandle::~ClipUndoHandle()
// setup a clip rectangle -only- iff we have to; if aRange
// is entirely contained inside an existing clip frame, we
// will avoid setting up the clip bitmap.
SvpSalGraphics
::
ClipUndoHandle
SvpSalGraphics
::
ensureClipFor
(
const
basegfx
::
B2IRange
&
aRange
)
// will avoid setting up the clip bitmap. Similarly if the
// range doesn't appear at all we return true to avoid
// rendering
bool
SvpSalGraphics
::
isClippedSetup
(
const
basegfx
::
B2IRange
&
aRange
,
SvpSalGraphics
::
ClipUndoHandle
&
rUndo
)
{
ClipUndoHandle
aRet
(
this
);
if
(
m_bClipSetup
)
return
false
;
if
(
m_bClipSetup
)
return
aRet
;
if
(
m_aClipRegion
.
IsEmpty
()
)
// no clipping
return
false
;
// fprintf( stderr, "ensureClipFor: %d, %d %dx%d\n",
// aRange.getMinX(), aRange.getMinY(),
...
...
@@ -226,34 +229,32 @@ SvpSalGraphics::ClipUndoHandle SvpSalGraphics::ensureClipFor( const basegfx::B2I
}
m_aClipRegion
.
EndEnumRects
(
aHnd
);
if
(
nHit
==
0
)
if
(
nHit
==
0
)
// rendering outside any clipping region
{
// degenerate case - we're all clipped ... hmm.
#if defined( UNX )
fprintf
(
stderr
,
"FIXME: denegerate case detected ...
\n
"
);
#endif
// fprintf (stderr, "denegerate case detected ...\n");
return
true
;
}
else
if
(
nHit
==
1
)
else
if
(
nHit
==
1
)
// common path: rendering against just one clipping region
{
if
(
a
Iter
Rect
.
IsInside
(
aRect
)
)
if
(
a
Hit
Rect
.
IsInside
(
aRect
)
)
{
// fprintf (stderr, " is inside ! avoid deeper clip ...\n");
return
aRet
;
// fprintf (stderr, " is inside ! avoid deeper clip ...\n");
return
false
;
}
// fprintf (stderr, " operation only overlaps with a single clip zone\n" );
aRet
.
m_aDevice
=
m_aDevice
;
// fprintf (stderr, " operation only overlaps with a single clip zone\n" );
rUndo
.
m_aDevice
=
m_aDevice
;
m_aDevice
=
basebmp
::
subsetBitmapDevice
(
m_aOrigDevice
,
basegfx
::
B2IRange
(
aHitRect
.
Left
(),
aHitRect
.
Top
(),
aHitRect
.
Right
(),
aHitRect
.
Bottom
())
);
return
aRet
;
return
false
;
}
// else
//
fprintf (stderr, "URK: complex & slow clipping case\n" );
// fprintf (stderr, "URK: complex & slow clipping case\n" );
//
horribly slow & complicated case ...
ensureClip
();
return
aRet
;
return
false
;
}
...
...
@@ -534,8 +535,9 @@ void SvpSalGraphics::copyArea( long nDestX,
B2IRange
aDestRect
(
nDestX
,
nDestY
,
nDestX
+
nSrcWidth
,
nDestY
+
nSrcHeight
);
// fprintf( stderr, "copyArea %ld pixels - clip region %d\n",
// (long)(nSrcWidth * nSrcHeight), m_aClipMap.get() != NULL );
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRect
);
m_aDevice
->
drawBitmap
(
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRect
,
aUndo
)
)
m_aDevice
->
drawBitmap
(
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
@@ -550,8 +552,10 @@ void SvpSalGraphics::copyBits( const SalTwoRect* pPosAry,
B2IRange
aDestRect
(
pPosAry
->
mnDestX
,
pPosAry
->
mnDestY
,
pPosAry
->
mnDestX
+
pPosAry
->
mnDestWidth
,
pPosAry
->
mnDestY
+
pPosAry
->
mnDestHeight
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRect
);
m_aDevice
->
drawBitmap
(
pSrc
->
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRect
,
aUndo
)
)
m_aDevice
->
drawBitmap
(
pSrc
->
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
@@ -565,8 +569,10 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
B2IRange
aDestRect
(
pPosAry
->
mnDestX
,
pPosAry
->
mnDestY
,
pPosAry
->
mnDestX
+
pPosAry
->
mnDestWidth
,
pPosAry
->
mnDestY
+
pPosAry
->
mnDestHeight
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRect
);
m_aDevice
->
drawBitmap
(
rSrc
.
getBitmap
(),
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRect
,
aUndo
)
)
m_aDevice
->
drawBitmap
(
rSrc
.
getBitmap
(),
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
@@ -589,8 +595,10 @@ void SvpSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
B2IRange
aDestRect
(
pPosAry
->
mnDestX
,
pPosAry
->
mnDestY
,
pPosAry
->
mnDestX
+
pPosAry
->
mnDestWidth
,
pPosAry
->
mnDestY
+
pPosAry
->
mnDestHeight
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRect
);
m_aDevice
->
drawMaskedBitmap
(
rSrc
.
getBitmap
(),
rSrcTrans
.
getBitmap
(),
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRect
,
aUndo
)
)
m_aDevice
->
drawMaskedBitmap
(
rSrc
.
getBitmap
(),
rSrcTrans
.
getBitmap
(),
aSrcRect
,
aDestRect
,
DrawMode_PAINT
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
@@ -618,8 +626,10 @@ void SvpSalGraphics::drawMask( const SalTwoRect* pPosAry,
basebmp
::
Color
aColor
(
nMaskColor
);
B2IRange
aSrcRect2
(
0
,
0
,
pPosAry
->
mnSrcWidth
,
pPosAry
->
mnSrcHeight
);
const
B2IRange
aClipRect
(
aDestPoint
,
B2ITuple
(
aSrcRect
.
getWidth
(),
aSrcRect
.
getHeight
()
)
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aClipRect
);
m_aDevice
->
drawMaskedColor
(
aColor
,
aCopy
,
aSrcRect
,
aDestPoint
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aClipRect
,
aUndo
)
)
m_aDevice
->
drawMaskedColor
(
aColor
,
aCopy
,
aSrcRect
,
aDestPoint
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
@@ -630,8 +640,10 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
m_aDevice
);
B2IRange
aSrcRect
(
nX
,
nY
,
nX
+
nWidth
,
nY
+
nHeight
);
B2IRange
aDestRect
(
0
,
0
,
nWidth
,
nHeight
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRect
);
aCopy
->
drawBitmap
(
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRect
,
aUndo
)
)
aCopy
->
drawBitmap
(
m_aOrigDevice
,
aSrcRect
,
aDestRect
,
DrawMode_PAINT
);
SvpSalBitmap
*
pBitmap
=
new
SvpSalBitmap
();
pBitmap
->
setBitmap
(
aCopy
);
...
...
@@ -650,8 +662,10 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
B2DPolygon
aRect
=
tools
::
createPolygonFromRect
(
B2DRectangle
(
nX
,
nY
,
nX
+
nWidth
,
nY
+
nHeight
)
);
B2DPolyPolygon
aPolyPoly
(
aRect
);
B2IRange
aDestRange
(
nX
,
nY
,
nX
+
nWidth
,
nY
+
nHeight
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aDestRange
);
// FIXME for ...
m_aDevice
->
fillPolyPolygon
(
aPolyPoly
,
basebmp
::
Color
(
0xffffff
),
DrawMode_XOR
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aDestRange
,
aUndo
)
)
m_aDevice
->
fillPolyPolygon
(
aPolyPoly
,
basebmp
::
Color
(
0xffffff
),
DrawMode_XOR
,
m_aClipMap
);
dbgOut
(
m_aDevice
);
}
...
...
vcl/headless/svptext.cxx
Dosyayı görüntüle @
d9d82ffc
...
...
@@ -534,8 +534,11 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
// blend text color into target using the glyph's mask
const
B2IRange
aSrcRect
(
B2ITuple
(
0
,
0
),
aAlphaMask
->
getSize
()
);
const
B2IRange
aClipRect
(
aDstPoint
,
aAlphaMask
->
getSize
()
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
=
ensureClipFor
(
aClipRect
);
m_aDevice
->
drawMaskedColor
(
m_aTextColor
,
aAlphaMask
,
aSrcRect
,
aDstPoint
,
m_aClipMap
);
SvpSalGraphics
::
ClipUndoHandle
aUndo
(
this
);
if
(
!
isClippedSetup
(
aClipRect
,
aUndo
)
)
m_aDevice
->
drawMaskedColor
(
m_aTextColor
,
aAlphaMask
,
aSrcRect
,
aDstPoint
,
m_aClipMap
);
}
}
...
...
vcl/inc/headless/svpgdi.hxx
Dosyayı görüntüle @
d9d82ffc
...
...
@@ -66,8 +66,8 @@ private:
ClipUndoHandle
(
SvpSalGraphics
*
pGfx
)
:
m_rGfx
(
*
pGfx
)
{}
~
ClipUndoHandle
();
};
ClipUndoHandle
ensureClipFor
(
const
basegfx
::
B2IRange
&
aRange
);
void
ensureClip
();
bool
isClippedSetup
(
const
basegfx
::
B2IRange
&
aRange
,
ClipUndoHandle
&
rUndo
);
void
ensureClip
();
protected
:
virtual
bool
drawAlphaBitmap
(
const
SalTwoRect
&
,
const
SalBitmap
&
rSourceBitmap
,
const
SalBitmap
&
rAlphaBitmap
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment