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
f18ad613
Kaydet (Commit)
f18ad613
authored
Eyl 05, 2013
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i122985 Various speedups for graphic object swapping to enhance user experience
üst
74626079
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
15 deletions
+110
-15
jpeg.cxx
svtools/source/filter/jpeg/jpeg.cxx
+30
-6
svdundo.hxx
svx/inc/svx/svdundo.hxx
+5
-3
svdograf.cxx
svx/source/svdraw/svdograf.cxx
+36
-4
svdundo.cxx
svx/source/svdraw/svdundo.cxx
+39
-2
pngread.cxx
vcl/source/gdi/pngread.cxx
+0
-0
No files found.
svtools/source/filter/jpeg/jpeg.cxx
Dosyayı görüntüle @
f18ad613
...
...
@@ -474,14 +474,38 @@ void JPEGReader::FillBitmap()
for
(
long
nY
=
0L
;
nY
<
nHeight
;
nY
++
)
{
pTmp
=
(
sal_uInt8
*
)
pBuffer
+
nY
*
nAlignedWidth
;
// #122985# Added fast-lane implementations using CopyScanline with direct supported mem formats
static
bool
bCheckOwnReader
(
true
);
for
(
long
nX
=
0L
;
nX
<
nWidth
;
nX
++
)
if
(
bCheckOwnReader
)
{
// #122985# Trying to copy the RGB data from jpeg import to make things faster. Unfortunately
// it has no GBR format, so RGB three-byte groups need to be 'flipped' to GBR first,
// then CopyScanline can use a memcpy to do the data transport. CopyScanline can also
// do the needed conversion from BMP_FORMAT_24BIT_TC_RGB (and it works well), but this
// is not faster that the old loop below using SetPixel.
sal_uInt8
*
aSource
((
sal_uInt8
*
)
pBuffer
+
nY
*
nAlignedWidth
);
sal_uInt8
*
aEnd
(
aSource
+
(
nWidth
*
3
));
for
(
sal_uInt8
*
aTmp
(
aSource
);
aTmp
<
aEnd
;
aTmp
+=
3
)
{
::
std
::
swap
(
*
aTmp
,
*
(
aTmp
+
2
));
}
pAcc
->
CopyScanline
(
nY
,
aSource
,
BMP_FORMAT_24BIT_TC_BGR
,
nWidth
*
3
);
}
else
{
aColor
.
SetRed
(
*
pTmp
++
);
aColor
.
SetGreen
(
*
pTmp
++
);
aColor
.
SetBlue
(
*
pTmp
++
);
pAcc
->
SetPixel
(
nY
,
nX
,
aColor
);
// old version: WritePixel
pTmp
=
(
sal_uInt8
*
)
pBuffer
+
nY
*
nAlignedWidth
;
for
(
long
nX
=
0L
;
nX
<
nWidth
;
nX
++
)
{
aColor
.
SetRed
(
*
pTmp
++
);
aColor
.
SetGreen
(
*
pTmp
++
);
aColor
.
SetBlue
(
*
pTmp
++
);
pAcc
->
SetPixel
(
nY
,
nX
,
aColor
);
}
}
}
}
...
...
svx/inc/svx/svdundo.hxx
Dosyayı görüntüle @
f18ad613
...
...
@@ -335,10 +335,12 @@ public:
class
SVX_DLLPUBLIC
SdrUndoDelObj
:
public
SdrUndoRemoveObj
{
private
:
void
TryToFlushGraphicContent
();
public
:
SdrUndoDelObj
(
SdrObject
&
rNewObj
,
FASTBOOL
bOrdNumDirect
=
sal_False
)
:
SdrUndoRemoveObj
(
rNewObj
,
bOrdNumDirect
)
{
SetOwner
(
sal_True
);
}
virtual
~
SdrUndoDelObj
()
{}
SdrUndoDelObj
(
SdrObject
&
rNewObj
,
FASTBOOL
bOrdNumDirect
=
sal_False
);
virtual
~
SdrUndoDelObj
();
virtual
void
Undo
();
virtual
void
Redo
();
...
...
svx/source/svdraw/svdograf.cxx
Dosyayı görüntüle @
f18ad613
...
...
@@ -69,6 +69,7 @@
#include <vos/mutex.hxx>
#include <drawinglayer/processor2d/objectinfoextractor2d.hxx>
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
#include <unotools/cacheoptions.hxx>
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
io
;
...
...
@@ -80,6 +81,37 @@ using namespace ::com::sun::star::io;
#define GRAFSTREAMPOS_INVALID 0xffffffff
#define SWAPGRAPHIC_TIMEOUT 5000
// #122985# it is not correct to se the swap-timeout to a hard-coded 5000ms as it was before.
// Added code and experimented what to do as a good compromize, see description
sal_uInt32
getCacheTimeInMs
()
{
static
bool
bSetAtAll
(
true
);
if
(
bSetAtAll
)
{
static
bool
bSetToPreferenceTime
(
true
);
if
(
bSetToPreferenceTime
)
{
const
SvtCacheOptions
aCacheOptions
;
const
sal_Int32
nSeconds
(
aCacheOptions
.
GetGraphicManagerObjectReleaseTime
());
// the default is 10 minutes. The minimum is one minute, thus 60 seconds. When the minimum
// should match to the former hard-coded 5 seconds, we have a divisor of 12 to use. For the
// default of 10 minutes this would mean 50 seconds. Compared to before this is ten times
// more (would allow better navigation by switching through pages) and is controllable
// by the user by setting the tools/options/memory/Remove_from_memory_after setting. Seems
// to be a good compromize to me.
return
nSeconds
*
1000
/
12
;
}
else
{
return
SWAPGRAPHIC_TIMEOUT
;
}
}
return
0
;
}
// ------------------
// - SdrGraphicLink -
...
...
@@ -375,7 +407,7 @@ SdrGrafObj::SdrGrafObj()
{
pGraphic
=
new
GraphicObject
;
mpReplacementGraphic
=
0
;
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
SWAPGRAPHIC_TIMEOUT
);
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
getCacheTimeInMs
()
);
onGraphicChanged
();
// #i118485# Shear allowed and possible now
...
...
@@ -402,7 +434,7 @@ SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect)
{
pGraphic
=
new
GraphicObject
(
rGrf
);
mpReplacementGraphic
=
0
;
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
SWAPGRAPHIC_TIMEOUT
);
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
getCacheTimeInMs
()
);
onGraphicChanged
();
// #i118485# Shear allowed and possible now
...
...
@@ -429,7 +461,7 @@ SdrGrafObj::SdrGrafObj( const Graphic& rGrf )
{
pGraphic
=
new
GraphicObject
(
rGrf
);
mpReplacementGraphic
=
0
;
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
SWAPGRAPHIC_TIMEOUT
);
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
getCacheTimeInMs
()
);
onGraphicChanged
();
// #i118485# Shear allowed and possible now
...
...
@@ -463,7 +495,7 @@ void SdrGrafObj::SetGraphicObject( const GraphicObject& rGrfObj )
*
pGraphic
=
rGrfObj
;
delete
mpReplacementGraphic
;
mpReplacementGraphic
=
0
;
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
SWAPGRAPHIC_TIMEOUT
);
pGraphic
->
SetSwapStreamHdl
(
LINK
(
this
,
SdrGrafObj
,
ImpSwapHdl
),
getCacheTimeInMs
()
);
pGraphic
->
SetUserData
();
mbIsPreview
=
sal_False
;
SetChanged
();
...
...
svx/source/svdraw/svdundo.cxx
Dosyayı görüntüle @
f18ad613
...
...
@@ -42,8 +42,9 @@
#include <svx/svdocapt.hxx>
#include <svl/whiter.hxx>
#include <svx/e3dsceneupdater.hxx>
#include "svx/svdviter.hxx"
#include <svx/svdviter.hxx>
#include <svx/svdograf.hxx>
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -882,6 +883,38 @@ void SdrUndoInsertObj::Redo()
////////////////////////////////////////////////////////////////////////////////////////////////////
void
SdrUndoDelObj
::
TryToFlushGraphicContent
()
{
SdrGrafObj
*
pSdrGrafObj
=
dynamic_cast
<
SdrGrafObj
*
>
(
pObj
);
if
(
pSdrGrafObj
)
{
sdr
::
contact
::
ViewContactOfGraphic
*
pVC
=
dynamic_cast
<
sdr
::
contact
::
ViewContactOfGraphic
*
>
(
&
pSdrGrafObj
->
GetViewContact
());
if
(
pVC
)
{
pVC
->
flushViewObjectContacts
();
pVC
->
flushGraphicObjects
();
}
pSdrGrafObj
->
ForceSwapOut
();
}
}
SdrUndoDelObj
::
SdrUndoDelObj
(
SdrObject
&
rNewObj
,
FASTBOOL
bOrdNumDirect
)
:
SdrUndoRemoveObj
(
rNewObj
,
bOrdNumDirect
)
{
SetOwner
(
sal_True
);
// #122985# if graphic object is deleted (but goes to undo) flush it's graphic content
// since it is potentially no longer needed
TryToFlushGraphicContent
();
}
SdrUndoDelObj
::~
SdrUndoDelObj
()
{
}
void
SdrUndoDelObj
::
Undo
()
{
SdrUndoRemoveObj
::
Undo
();
...
...
@@ -894,6 +927,10 @@ void SdrUndoDelObj::Redo()
SdrUndoRemoveObj
::
Redo
();
DBG_ASSERT
(
!
IsOwner
(),
"RedoDeleteObj: pObj gehoert bereits der UndoAction"
);
SetOwner
(
sal_True
);
// #122985# if graphic object is deleted (but goes to undo) flush it's graphic content
// since it is potentially no longer needed
TryToFlushGraphicContent
();
}
XubString
SdrUndoDelObj
::
GetComment
()
const
...
...
vcl/source/gdi/pngread.cxx
Dosyayı görüntüle @
f18ad613
This diff is collapsed.
Click to expand it.
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