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
dd16d34a
Kaydet (Commit)
dd16d34a
authored
Ock 19, 2016
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
either copy the whole thing exactly, or convert between types
Change-Id: Ied1b4f81e2e851b639cc9a514659160b8571e92f
üst
f73e72fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
80 deletions
+17
-80
bitmapdevice.cxx
basebmp/source/bitmapdevice.cxx
+14
-74
bitmapdevice.hxx
include/basebmp/bitmapdevice.hxx
+2
-5
svpgdi.cxx
vcl/headless/svpgdi.cxx
+1
-1
No files found.
basebmp/source/bitmapdevice.cxx
Dosyayı görüntüle @
dd16d34a
...
...
@@ -146,18 +146,6 @@ namespace
private
:
static
std
::
shared_ptr
<
BitmapRenderer
>
getCompatibleBitmap
(
const
BitmapDeviceSharedPtr
&
bmp
)
{
return
std
::
dynamic_pointer_cast
<
BitmapRenderer
>
(
bmp
);
}
virtual
bool
isCompatibleBitmap
(
const
BitmapDeviceSharedPtr
&
bmp
)
const
override
{
// TODO(P1): dynamic_cast usually called twice for
// compatible formats
return
getCompatibleBitmap
(
bmp
).
get
()
!=
nullptr
;
}
virtual
Color
getPixel_i
(
const
basegfx
::
B2IPoint
&
rPt
)
override
{
const
DestIterator
pixel
(
maBegin
+
...
...
@@ -166,21 +154,6 @@ namespace
return
maAccessor
(
pixel
);
}
template
<
typename
Iterator
,
typename
RawAcc
>
void
implDrawBitmap
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
,
const
Iterator
&
begin
,
const
RawAcc
&
acc
)
{
const
basegfx
::
B2IVector
&
rSrcSize
(
rSrcBitmap
->
getSize
()
);
const
basegfx
::
B2IBox
aRect
(
0
,
0
,
rSrcSize
.
getX
(),
rSrcSize
.
getY
());
std
::
shared_ptr
<
BitmapRenderer
>
pSrcBmp
(
getCompatibleBitmap
(
rSrcBitmap
)
);
OSL_ASSERT
(
pSrcBmp
);
vigra
::
copyImage
(
pSrcBmp
->
maBegin
,
pSrcBmp
->
maBegin
+
bottomRight
(
aRect
),
pSrcBmp
->
maRawAccessor
,
begin
,
acc
);
}
template
<
typename
Iterator
,
typename
Acc
>
static
void
implDrawBitmapGeneric
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
,
const
Iterator
&
begin
,
...
...
@@ -195,49 +168,9 @@ namespace
begin
,
acc
);
}
void
implDrawBitmapDirect
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
{
const
basegfx
::
B2IVector
&
rSrcSize
(
rSrcBitmap
->
getSize
());
sal_Int32
nSrcWidth
=
rSrcSize
.
getX
();
sal_Int32
nSrcHeight
=
rSrcSize
.
getY
();
char
*
dstBuf
=
reinterpret_cast
<
char
*>
(
getBuffer
().
get
());
char
*
srcBuf
=
reinterpret_cast
<
char
*>
(
rSrcBitmap
->
getBuffer
().
get
());
sal_Int32
dstStride
=
getScanlineStride
();
sal_Int32
srcStride
=
rSrcBitmap
->
getScanlineStride
();
sal_Int32
bytesPerPixel
=
(
bitsPerPixel
[
getScanlineFormat
()]
+
7
)
>>
3
;
// round up to bytes
char
*
dstline
=
dstBuf
;
char
*
srcline
=
srcBuf
;
sal_Int32
lineBytes
=
nSrcWidth
*
bytesPerPixel
;
for
(;
0
<
nSrcHeight
;
nSrcHeight
--
)
{
memmove
(
dstline
,
srcline
,
lineBytes
);
dstline
+=
dstStride
;
srcline
+=
srcStride
;
}
}
virtual
void
copyBitmap_i
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
override
virtual
void
convertBitmap_i
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
override
{
if
(
isCompatibleBitmap
(
rSrcBitmap
)
)
{
if
(
bitsPerPixel
[
getScanlineFormat
()]
>=
8
&&
rSrcBitmap
->
getScanlineFormat
()
==
getScanlineFormat
())
implDrawBitmapDirect
(
rSrcBitmap
);
else
implDrawBitmap
(
rSrcBitmap
,
maBegin
,
maRawAccessor
);
}
else
{
implDrawBitmapGeneric
(
rSrcBitmap
,
maBegin
,
maAccessor
);
}
implDrawBitmapGeneric
(
rSrcBitmap
,
maBegin
,
maAccessor
);
}
};
}
// namespace
...
...
@@ -330,12 +263,11 @@ Color BitmapDevice::getPixel( const basegfx::B2IPoint& rPt )
return
Color
();
}
void
BitmapDevice
::
co
py
Bitmap
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
void
BitmapDevice
::
co
nvert
Bitmap
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
{
co
pyBitmap_i
(
rSrcBitmap
);
co
nvertBitmap_i
(
rSrcBitmap
);
}
/// Produces a specialized renderer for the given pixel format
template
<
class
FormatTraits
>
BitmapDeviceSharedPtr
createRenderer
(
...
...
@@ -670,11 +602,19 @@ BitmapDeviceSharedPtr createBitmapDevice( const basegfx::B2IVector& rSize
BitmapDeviceSharedPtr
cloneBitmapDevice
(
const
BitmapDeviceSharedPtr
&
rProto
)
{
BitmapDeviceSharedPtr
aCopy
=
createBitmapDeviceImpl
(
rProto
->
getSize
(),
const
basegfx
::
B2IVector
&
rSrcSize
(
rProto
->
getSize
());
BitmapDeviceSharedPtr
aCopy
=
createBitmapDeviceImpl
(
rSrcSize
,
rProto
->
getScanlineFormat
(),
boost
::
shared_array
<
sal_uInt8
>
(),
rProto
->
getPalette
()
);
aCopy
->
copyBitmap
(
rProto
);
const
sal_Int32
nSrcHeight
=
rSrcSize
.
getY
();
char
*
dstBuf
=
reinterpret_cast
<
char
*>
(
aCopy
->
getBuffer
().
get
());
char
*
srcBuf
=
reinterpret_cast
<
char
*>
(
rProto
->
getBuffer
().
get
());
const
sal_Int32
nStride
=
rProto
->
getScanlineStride
();
memcpy
(
dstBuf
,
srcBuf
,
nStride
*
nSrcHeight
);
return
aCopy
;
}
...
...
include/basebmp/bitmapdevice.hxx
Dosyayı görüntüle @
dd16d34a
...
...
@@ -102,7 +102,7 @@ public:
@param rSrcBitmap
Bitmap to render into this one.
*/
void
co
py
Bitmap
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
);
void
co
nvert
Bitmap
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
);
protected
:
BASEBMP_DLLPRIVATE
BitmapDevice
(
const
basegfx
::
B2IBox
&
rBounds
,
...
...
@@ -116,13 +116,10 @@ protected:
BitmapDevice
&
operator
=
(
const
BitmapDevice
&
)
=
delete
;
private
:
BASEBMP_DLLPRIVATE
virtual
bool
isCompatibleBitmap
(
const
BitmapDeviceSharedPtr
&
bmp
)
const
=
0
;
BASEBMP_DLLPRIVATE
virtual
Color
getPixel_i
(
const
basegfx
::
B2IPoint
&
rPt
)
=
0
;
BASEBMP_DLLPRIVATE
virtual
void
copyBitmap_i
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
=
0
;
BitmapDeviceSharedPtr
getGenericRenderer
()
const
;
BASEBMP_DLLPRIVATE
virtual
void
convertBitmap_i
(
const
BitmapDeviceSharedPtr
&
rSrcBitmap
)
=
0
;
std
::
unique_ptr
<
ImplBitmapDevice
>
mpImpl
;
};
...
...
vcl/headless/svpgdi.cxx
Dosyayı görüntüle @
dd16d34a
...
...
@@ -131,7 +131,7 @@ namespace
aTmpBmp
.
Create
(
aSize
,
0
,
BitmapPalette
());
assert
(
aTmpBmp
.
GetBitCount
()
==
32
);
const
basebmp
::
BitmapDeviceSharedPtr
&
rTmpSrc
=
aTmpBmp
.
getBitmap
();
rTmpSrc
->
co
py
Bitmap
(
rSrcBmp
);
rTmpSrc
->
co
nvert
Bitmap
(
rSrcBmp
);
source
=
SvpSalGraphics
::
createCairoSurface
(
rTmpSrc
);
}
else
...
...
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