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
96c4aeed
Kaydet (Commit)
96c4aeed
authored
Haz 11, 2012
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement XToolkit2::createScreenCompatibleDeviceUsingBuffer for Android
Change-Id: I8dd16850a35cd2de7260dcbe9a8aa7afae2294be
üst
56595dab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
16 deletions
+70
-16
vclxtoolkit.hxx
toolkit/inc/toolkit/awt/vclxtoolkit.hxx
+8
-3
vclxtoolkit.cxx
toolkit/source/awt/vclxtoolkit.cxx
+20
-2
svpvd.cxx
vcl/headless/svpvd.cxx
+9
-1
svpvd.hxx
vcl/inc/headless/svpvd.hxx
+2
-1
salvd.hxx
vcl/inc/salvd.hxx
+6
-2
virdev.hxx
vcl/inc/vcl/virdev.hxx
+4
-1
virdev.cxx
vcl/source/gdi/virdev.cxx
+21
-6
No files found.
toolkit/inc/toolkit/awt/vclxtoolkit.hxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -31,7 +31,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/awt/XSystemChildFactory.hpp>
#include <com/sun/star/awt/XToolkit.hpp>
#include <com/sun/star/awt/XToolkit
2
.hpp>
#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/awt/XExtendedToolkit.hpp>
...
...
@@ -80,7 +80,7 @@ protected:
class
VCLXToolkit
:
public
VCLXToolkit_Impl
,
public
cppu
::
WeakComponentImplHelper7
<
::
com
::
sun
::
star
::
awt
::
XToolkit
,
::
com
::
sun
::
star
::
awt
::
XToolkit
2
,
::
com
::
sun
::
star
::
lang
::
XServiceInfo
,
::
com
::
sun
::
star
::
awt
::
XSystemChildFactory
,
::
com
::
sun
::
star
::
awt
::
XMessageBoxFactory
,
...
...
@@ -128,12 +128,17 @@ public:
VCLXToolkit
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
&
);
~
VCLXToolkit
();
// ::com::sun::star::awt::XToolkit2
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XDevice
>
SAL_CALL
createScreenCompatibleDeviceUsingBuffer
(
sal_Int32
Width
,
sal_Int32
Height
,
sal_Int64
addressOfMemoryBufferForSharedArrayWrapper
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// ::com::sun::star::awt::XToolkit
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XWindowPeer
>
SAL_CALL
getDesktopWindow
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
awt
::
Rectangle
SAL_CALL
getWorkArea
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XWindowPeer
>
SAL_CALL
createWindow
(
const
::
com
::
sun
::
star
::
awt
::
WindowDescriptor
&
Descriptor
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XWindowPeer
>
>
SAL_CALL
createWindows
(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
awt
::
WindowDescriptor
>&
Descriptors
)
throw
(
::
com
::
sun
::
star
::
lang
::
IllegalArgumentException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XDevice
>
SAL_CALL
createScreenCompatibleDevice
(
sal_Int32
Width
,
sal_Int32
Height
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XDevice
>
SAL_CALL
createScreenCompatibleDevice
(
sal_Int32
Width
,
sal_Int32
Height
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XRegion
>
SAL_CALL
createRegion
(
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
// ::com::sun::star::awt::XSystemChildFactory
...
...
toolkit/source/awt/vclxtoolkit.cxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -63,6 +63,11 @@
#include "postmac.h"
#endif
#ifdef ANDROID
#include <sal/ByteBufferWrapper.hxx>
using
org
::
libreoffice
::
touch
::
ByteBufferWrapper
;
#endif
#ifdef IOS
#include "premac.h"
#include <UIKit/UIKit.h>
...
...
@@ -468,7 +473,7 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
// contructor, which might initialize VCL
VCLXToolkit
::
VCLXToolkit
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
&
rSMgr
)
:
cppu
::
WeakComponentImplHelper7
<
::
com
::
sun
::
star
::
awt
::
XToolkit
,
::
com
::
sun
::
star
::
awt
::
XToolkit
2
,
::
com
::
sun
::
star
::
lang
::
XServiceInfo
,
::
com
::
sun
::
star
::
awt
::
XSystemChildFactory
,
::
com
::
sun
::
star
::
awt
::
XMessageBoxFactory
,
...
...
@@ -561,6 +566,11 @@ void SAL_CALL VCLXToolkit::disposing()
}
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XDevice
>
VCLXToolkit
::
createScreenCompatibleDevice
(
sal_Int32
Width
,
sal_Int32
Height
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
return
createScreenCompatibleDeviceUsingBuffer
(
Width
,
Height
,
0
);
}
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XDevice
>
VCLXToolkit
::
createScreenCompatibleDeviceUsingBuffer
(
sal_Int32
Width
,
sal_Int32
Height
,
sal_Int64
addressOfMemoryBufferForSharedArrayWrapper
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
)
{
::
osl
::
Guard
<
::
osl
::
Mutex
>
aGuard
(
GetMutex
()
);
...
...
@@ -570,7 +580,15 @@ void SAL_CALL VCLXToolkit::disposing()
SolarMutexGuard
aSolarGuard
;
VirtualDevice
*
pV
=
new
VirtualDevice
;
pV
->
SetOutputSizePixel
(
Size
(
Width
,
Height
)
);
if
(
addressOfMemoryBufferForSharedArrayWrapper
!=
0
)
{
#if defined(ANDROID)
ByteBufferWrapper
*
bbw
=
(
ByteBufferWrapper
*
)
(
intptr_t
)
addressOfMemoryBufferForSharedArrayWrapper
;
pV
->
SetOutputSizePixelAndBuffer
(
Size
(
Width
,
Height
),
basebmp
::
RawMemorySharedArray
(
bbw
->
pointer
(),
*
bbw
));
OSL_FAIL
(
"rendering to a pre-allocated buffer not done yet for this OS"
);
#endif
}
else
{
pV
->
SetOutputSizePixel
(
Size
(
Width
,
Height
)
);
}
pVDev
->
SetVirtualDevice
(
pV
);
xRef
=
pVDev
;
...
...
vcl/headless/svpvd.cxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -56,6 +56,11 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
}
sal_Bool
SvpSalVirtualDevice
::
SetSize
(
long
nNewDX
,
long
nNewDY
)
{
return
SetSizeUsingBuffer
(
nNewDX
,
nNewDY
,
basebmp
::
RawMemorySharedArray
()
);
}
sal_Bool
SvpSalVirtualDevice
::
SetSizeUsingBuffer
(
long
nNewDX
,
long
nNewDY
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
)
{
B2IVector
aDevSize
(
nNewDX
,
nNewDY
);
if
(
aDevSize
.
getX
()
==
0
)
...
...
@@ -89,7 +94,10 @@ sal_Bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
#endif
}
m_aDevice
=
aDevPal
.
empty
()
?
createBitmapDevice
(
aDevSize
,
false
,
nFormat
)
?
(
pBuffer
?
createBitmapDevice
(
aDevSize
,
false
,
nFormat
,
pBuffer
,
PaletteMemorySharedVector
()
)
:
createBitmapDevice
(
aDevSize
,
false
,
nFormat
)
)
:
createBitmapDevice
(
aDevSize
,
false
,
nFormat
,
PaletteMemorySharedVector
(
new
std
::
vector
<
basebmp
::
Color
>
(
aDevPal
)
)
);
// update device in existing graphics
...
...
vcl/inc/headless/svpvd.hxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -53,7 +53,8 @@ public:
virtual
SalGraphics
*
GetGraphics
();
virtual
void
ReleaseGraphics
(
SalGraphics
*
pGraphics
);
virtual
sal_Bool
SetSize
(
long
nNewDX
,
long
nNewDY
);
virtual
sal_Bool
SetSize
(
long
nNewDX
,
long
nNewDY
);
virtual
sal_Bool
SetSizeUsingBuffer
(
long
nNewDX
,
long
nNewDY
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
);
virtual
void
GetSize
(
long
&
rWidth
,
long
&
rHeight
);
};
...
...
vcl/inc/salvd.hxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -31,6 +31,7 @@
#include <tools/solar.h>
#include <vcl/dllapi.h>
#include <basebmp/bitmapdevice.hxx>
class
SalGraphics
;
...
...
@@ -49,8 +50,11 @@ public: // public for Sal Implementation
virtual
SalGraphics
*
GetGraphics
()
=
0
;
virtual
void
ReleaseGraphics
(
SalGraphics
*
pGraphics
)
=
0
;
// Set new size, without saving the old contents
virtual
sal_Bool
SetSize
(
long
nNewDX
,
long
nNewDY
)
=
0
;
// Set new size, without saving the old contents
virtual
sal_Bool
SetSize
(
long
nNewDX
,
long
nNewDY
)
=
0
;
// Set new size using a buffer at the given address
virtual
sal_Bool
SetSizeUsingBuffer
(
long
nNewDX
,
long
nNewDY
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
)
=
0
;
/// Get actual VDev size in pixel
virtual
void
GetSize
(
long
&
rWidth
,
long
&
rHeight
)
=
0
;
...
...
vcl/inc/vcl/virdev.hxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -32,6 +32,7 @@
#include <tools/solar.h>
#include <vcl/dllapi.h>
#include <vcl/outdev.hxx>
#include <basebmp/bitmapdevice.hxx>
// -----------------
// - VirtualDevice -
...
...
@@ -56,7 +57,8 @@ private:
sal_uInt8
meRefDevMode
;
SAL_DLLPRIVATE
void
ImplInitVirDev
(
const
OutputDevice
*
pOutDev
,
long
nDX
,
long
nDY
,
sal_uInt16
nBitCount
,
const
SystemGraphicsData
*
pData
=
NULL
);
SAL_DLLPRIVATE
sal_Bool
ImplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
);
SAL_DLLPRIVATE
sal_Bool
InnerImplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
);
SAL_DLLPRIVATE
sal_Bool
ImplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
);
// Copy assignment is forbidden and not implemented.
VirtualDevice
(
const
VirtualDevice
&
);
...
...
@@ -104,6 +106,7 @@ public:
virtual
~
VirtualDevice
();
sal_Bool
SetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
=
sal_True
);
sal_Bool
SetOutputSizePixelAndBuffer
(
const
Size
&
rNewSize
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
);
sal_Bool
SetOutputSize
(
const
Size
&
rNewSize
,
sal_Bool
bErase
=
sal_True
)
{
return
SetOutputSizePixel
(
LogicToPixel
(
rNewSize
),
bErase
);
}
...
...
vcl/source/gdi/virdev.cxx
Dosyayı görüntüle @
96c4aeed
...
...
@@ -210,10 +210,10 @@ VirtualDevice::~VirtualDevice()
// -----------------------------------------------------------------------
sal_Bool
VirtualDevice
::
I
mplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
)
sal_Bool
VirtualDevice
::
I
nnerImplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
)
{
SAL_INFO
(
"vcl.gdi"
,
"VirtualDevice::ImplSetOutputSizePixel( "
<<
rNewSize
.
Width
()
<<
", "
"VirtualDevice::I
nnerI
mplSetOutputSizePixel( "
<<
rNewSize
.
Width
()
<<
", "
<<
rNewSize
.
Height
()
<<
", "
<<
bErase
<<
" )"
);
if
(
!
mpVirDev
)
...
...
@@ -222,6 +222,8 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
{
if
(
bErase
)
Erase
();
// Yeah, so trying to re-use a VirtualDevice but this time using a
// pre-allocated buffer won't work. Big deal.
return
sal_True
;
}
...
...
@@ -236,7 +238,10 @@ sal_Bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, sal_Bool b
if
(
bErase
)
{
bRet
=
mpVirDev
->
SetSize
(
nNewWidth
,
nNewHeight
);
if
(
pBuffer
)
bRet
=
mpVirDev
->
SetSizeUsingBuffer
(
nNewWidth
,
nNewHeight
,
pBuffer
);
else
bRet
=
mpVirDev
->
SetSize
(
nNewWidth
,
nNewHeight
);
if
(
bRet
)
{
...
...
@@ -323,9 +328,9 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
// -----------------------------------------------------------------------
sal_Bool
VirtualDevice
::
SetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
)
sal_Bool
VirtualDevice
::
ImplSetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
)
{
if
(
I
mplSetOutputSizePixel
(
rNewSize
,
bErase
)
)
if
(
I
nnerImplSetOutputSizePixel
(
rNewSize
,
bErase
,
pBuffer
)
)
{
if
(
mnAlphaDepth
!=
-
1
)
{
...
...
@@ -339,7 +344,7 @@ sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bEras
if
(
!
mpAlphaVDev
)
{
mpAlphaVDev
=
new
VirtualDevice
(
*
this
,
mnAlphaDepth
);
mpAlphaVDev
->
I
mplSetOutputSizePixel
(
rNewSize
,
bErase
);
mpAlphaVDev
->
I
nnerImplSetOutputSizePixel
(
rNewSize
,
bErase
,
basebmp
::
RawMemorySharedArray
()
);
}
// TODO: copy full outdev state to new one, here. Also needed in outdev2.cxx:DrawOutDev
...
...
@@ -358,6 +363,16 @@ sal_Bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, sal_Bool bEras
return
sal_False
;
}
sal_Bool
VirtualDevice
::
SetOutputSizePixel
(
const
Size
&
rNewSize
,
sal_Bool
bErase
)
{
return
ImplSetOutputSizePixel
(
rNewSize
,
bErase
,
basebmp
::
RawMemorySharedArray
()
);
}
sal_Bool
VirtualDevice
::
SetOutputSizePixelAndBuffer
(
const
Size
&
rNewSize
,
const
basebmp
::
RawMemorySharedArray
&
pBuffer
)
{
return
ImplSetOutputSizePixel
(
rNewSize
,
sal_True
,
pBuffer
);
}
// -----------------------------------------------------------------------
void
VirtualDevice
::
SetReferenceDevice
(
RefDevMode
i_eRefDevMode
)
...
...
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