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
e391db09
Kaydet (Commit)
e391db09
authored
Eki 30, 2017
tarafından
Jan-Marek Glogowski
Kaydeden (comit)
Thorsten Behrens
Kas 06, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
QT5 implement alpha based drawing
Change-Id: Ide2ef42110798ed061f7e32e49e38b6428c22c01
üst
5f84bf9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
13 deletions
+96
-13
Qt5Graphics.cxx
vcl/qt5/Qt5Graphics.cxx
+1
-0
Qt5Graphics_GDI.cxx
vcl/qt5/Qt5Graphics_GDI.cxx
+95
-13
No files found.
vcl/qt5/Qt5Graphics.cxx
Dosyayı görüntüle @
e391db09
...
@@ -91,6 +91,7 @@ bool Qt5Graphics::supportsOperation( OutDevSupportType eType ) const
...
@@ -91,6 +91,7 @@ bool Qt5Graphics::supportsOperation( OutDevSupportType eType ) const
switch
(
eType
)
switch
(
eType
)
{
{
case
OutDevSupportType
:
:
B2DDraw
:
case
OutDevSupportType
:
:
B2DDraw
:
case
OutDevSupportType
:
:
TransparentRect
:
return
true
;
return
true
;
default
:
default
:
return
false
;
return
false
;
...
...
vcl/qt5/Qt5Graphics_GDI.cxx
Dosyayı görüntüle @
e391db09
...
@@ -436,27 +436,109 @@ bool Qt5Graphics::blendAlphaBitmap( const SalTwoRect&,
...
@@ -436,27 +436,109 @@ bool Qt5Graphics::blendAlphaBitmap( const SalTwoRect&,
return
false
;
return
false
;
}
}
bool
Qt5Graphics
::
drawAlphaBitmap
(
const
SalTwoRect
&
,
static
bool
getAlphaImage
(
const
SalBitmap
&
rSourceBitmap
,
const
SalBitmap
&
rSource
Bitmap
,
const
SalBitmap
&
rAlpha
Bitmap
,
const
SalBitmap
&
rAlphaBitmap
)
QImage
&
rAlphaImage
)
{
{
return
false
;
if
(
rAlphaBitmap
.
GetBitCount
()
!=
8
&&
rAlphaBitmap
.
GetBitCount
()
!=
1
)
{
SAL_WARN
(
"vcl.gdi"
,
"unsupported alpha depth case: "
<<
rAlphaBitmap
.
GetBitCount
()
);
return
false
;
}
const
QImage
*
pBitmap
=
static_cast
<
const
Qt5Bitmap
*
>
(
&
rSourceBitmap
)
->
GetQImage
();
const
QImage
*
pAlpha
=
static_cast
<
const
Qt5Bitmap
*
>
(
&
rAlphaBitmap
)
->
GetQImage
();
rAlphaImage
=
pBitmap
->
convertToFormat
(
Qt5_DefaultFormat32
);
if
(
rAlphaBitmap
.
GetBitCount
()
==
8
)
{
for
(
int
y
=
0
;
y
<
rAlphaImage
.
height
();
++
y
)
{
uchar
*
image_line
=
rAlphaImage
.
scanLine
(
y
);
const
uchar
*
alpha_line
=
pAlpha
->
scanLine
(
y
);
for
(
int
x
=
0
;
x
<
rAlphaImage
.
width
();
++
x
,
image_line
+=
4
)
image_line
[
3
]
=
255
-
alpha_line
[
x
];
}
}
else
{
for
(
int
y
=
0
;
y
<
rAlphaImage
.
height
();
++
y
)
{
uchar
*
image_line
=
rAlphaImage
.
scanLine
(
y
);
const
uchar
*
alpha_line
=
pAlpha
->
scanLine
(
y
);
for
(
int
x
=
0
;
x
<
rAlphaImage
.
width
();
++
x
,
image_line
+=
4
)
{
if
(
x
&&
!
(
x
%
8
)
)
++
alpha_line
;
if
(
0
==
(
*
alpha_line
&
(
1
<<
(
x
%
8
)))
)
image_line
[
0
]
=
0
;
}
}
}
return
true
;
}
}
bool
Qt5Graphics
::
drawTransformedBitmap
(
bool
Qt5Graphics
::
drawAlphaBitmap
(
const
SalTwoRect
&
rPosAry
,
const
basegfx
::
B2DPoint
&
rNull
,
const
SalBitmap
&
rSourceBitmap
,
const
basegfx
::
B2DPoint
&
rX
,
const
SalBitmap
&
rAlphaBitmap
)
const
basegfx
::
B2DPoint
&
rY
,
const
SalBitmap
&
rSourceBitmap
,
const
SalBitmap
*
pAlphaBitmap
)
{
{
return
false
;
QImage
aImage
;
if
(
!
getAlphaImage
(
rSourceBitmap
,
rAlphaBitmap
,
aImage
)
)
return
false
;
PREPARE_PAINTER
;
aPainter
.
drawImage
(
QPoint
(
rPosAry
.
mnDestX
,
rPosAry
.
mnDestY
),
aImage
,
QRect
(
rPosAry
.
mnSrcX
,
rPosAry
.
mnSrcY
,
rPosAry
.
mnSrcWidth
,
rPosAry
.
mnSrcHeight
)
);
return
true
;
}
bool
Qt5Graphics
::
drawTransformedBitmap
(
const
basegfx
::
B2DPoint
&
rNull
,
const
basegfx
::
B2DPoint
&
rX
,
const
basegfx
::
B2DPoint
&
rY
,
const
SalBitmap
&
rSourceBitmap
,
const
SalBitmap
*
pAlphaBitmap
)
{
QImage
aImage
;
if
(
pAlphaBitmap
&&
!
getAlphaImage
(
rSourceBitmap
,
*
pAlphaBitmap
,
aImage
)
)
return
false
;
else
{
const
QImage
*
pBitmap
=
static_cast
<
const
Qt5Bitmap
*
>
(
&
rSourceBitmap
)
->
GetQImage
();
aImage
=
pBitmap
->
convertToFormat
(
Qt5_DefaultFormat32
);
}
PREPARE_PAINTER
;
const
basegfx
::
B2DVector
aXRel
=
rX
-
rNull
;
const
basegfx
::
B2DVector
aYRel
=
rY
-
rNull
;
aPainter
.
setTransform
(
QTransform
(
aXRel
.
getX
()
/
aImage
.
width
(),
aXRel
.
getY
()
/
aImage
.
width
(),
aYRel
.
getX
()
/
aImage
.
height
(),
aYRel
.
getY
()
/
aImage
.
height
(),
rNull
.
getX
(),
rNull
.
getY
()
));
aPainter
.
drawImage
(
QPoint
(
0
,
0
),
aImage
);
return
true
;
}
}
bool
Qt5Graphics
::
drawAlphaRect
(
long
nX
,
long
nY
,
long
nWidth
,
bool
Qt5Graphics
::
drawAlphaRect
(
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
,
sal_uInt8
nTransparency
)
long
nHeight
,
sal_uInt8
nTransparency
)
{
{
return
false
;
if
(
SALCOLOR_NONE
==
m_aFillColor
&&
SALCOLOR_NONE
==
m_aLineColor
)
return
true
;
QPainter
aPainter
;
PreparePainter
(
aPainter
,
255
-
nTransparency
);
if
(
SALCOLOR_NONE
!=
m_aFillColor
)
{
QColor
aFillColor
=
QColor
::
fromRgb
(
QRgb
(
m_aFillColor
)
);
aFillColor
.
setAlpha
(
nTransparency
);
aPainter
.
fillRect
(
nX
,
nY
,
nWidth
,
nHeight
,
aFillColor
);
}
else
aPainter
.
drawRect
(
nX
,
nY
,
nWidth
,
nHeight
);
return
true
;
}
}
void
Qt5Graphics
::
GetResolution
(
sal_Int32
&
rDPIX
,
sal_Int32
&
rDPIY
)
void
Qt5Graphics
::
GetResolution
(
sal_Int32
&
rDPIX
,
sal_Int32
&
rDPIY
)
...
...
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