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
5302d5a3
Kaydet (Commit)
5302d5a3
authored
Kas 09, 2014
tarafından
Louis-Francis Ratté-Boulianne
Kaydeden (comit)
Markus Mohrhard
Kas 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: Add support for transparent polygon drawing with OpenGL
Change-Id: Iaa7cdcf4742d8148507c69c222bff417b9f9426c
üst
ab63fe78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
5 deletions
+55
-5
openglgdiimpl.hxx
vcl/inc/openglgdiimpl.hxx
+1
-0
gdiimpl.cxx
vcl/opengl/gdiimpl.cxx
+52
-3
solidFragmentShader.glsl
vcl/opengl/solidFragmentShader.glsl
+1
-1
polygon.cxx
vcl/source/outdev/polygon.cxx
+1
-1
No files found.
vcl/inc/openglgdiimpl.hxx
Dosyayı görüntüle @
5302d5a3
...
...
@@ -61,6 +61,7 @@ protected:
bool
CreateMaskProgram
(
void
);
void
BeginSolid
(
SalColor
nColor
,
sal_uInt8
nTransparency
);
void
BeginSolid
(
SalColor
nColor
,
double
fTransparency
);
void
BeginSolid
(
SalColor
nColor
);
void
EndSolid
(
void
);
void
BeginInvert
(
void
);
...
...
vcl/opengl/gdiimpl.cxx
Dosyayı görüntüle @
5302d5a3
...
...
@@ -40,6 +40,13 @@
((float) SALCOLOR_BLUE( nColor )) / 255, \
(100 - nTransparency) * (1.0 / 100) )
#define glUniformColorf(nUniform, nColor, fTransparency) \
glUniform4f( nUniform, \
((float) SALCOLOR_RED( nColor )) / 255, \
((float) SALCOLOR_GREEN( nColor )) / 255, \
((float) SALCOLOR_BLUE( nColor )) / 255, \
(1.0f - fTransparency) )
OpenGLSalGraphicsImpl
::~
OpenGLSalGraphicsImpl
()
{
}
...
...
@@ -202,18 +209,41 @@ void OpenGLSalGraphicsImpl::BeginSolid( SalColor nColor, sal_uInt8 nTransparency
return
;
}
if
(
nTransparency
>
0
)
{
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
}
glUseProgram
(
mnSolidProgram
);
glUniformColor
(
mnColorUniform
,
nColor
,
nTransparency
);
}
void
OpenGLSalGraphicsImpl
::
BeginSolid
(
SalColor
nColor
,
double
fTransparency
)
{
if
(
mnSolidProgram
==
0
)
{
if
(
!
CreateSolidProgram
()
)
return
;
}
if
(
fTransparency
>
0.0
f
)
{
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
}
glUseProgram
(
mnSolidProgram
);
glUniformColorf
(
mnColorUniform
,
nColor
,
fTransparency
);
}
void
OpenGLSalGraphicsImpl
::
BeginSolid
(
SalColor
nColor
)
{
BeginSolid
(
nColor
,
0
);
BeginSolid
(
nColor
,
0
.0
f
);
}
void
OpenGLSalGraphicsImpl
::
EndSolid
(
void
)
{
glUseProgram
(
0
);
glDisable
(
GL_BLEND
);
}
void
OpenGLSalGraphicsImpl
::
BeginInvert
(
void
)
...
...
@@ -592,9 +622,27 @@ void OpenGLSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32*
}
}
bool
OpenGLSalGraphicsImpl
::
drawPolyPolygon
(
const
::
basegfx
::
B2DPolyPolygon
&
,
double
/*fTransparency*/
)
bool
OpenGLSalGraphicsImpl
::
drawPolyPolygon
(
const
::
basegfx
::
B2DPolyPolygon
&
rPolyPolygon
,
double
fTransparency
)
{
return
false
;
SAL_INFO
(
"vcl.opengl"
,
"::drawPolyPolygon trans "
<<
fTransparency
);
if
(
rPolyPolygon
.
count
()
<=
0
)
return
true
;
maContext
.
makeCurrent
();
glViewport
(
0
,
0
,
GetWidth
(),
GetHeight
()
);
if
(
mnFillColor
!=
SALCOLOR_NONE
)
{
BeginSolid
(
mnFillColor
,
fTransparency
);
for
(
sal_uInt32
i
=
0
;
i
<
rPolyPolygon
.
count
();
i
++
)
{
const
::
basegfx
::
B2DPolyPolygon
aOnePoly
(
rPolyPolygon
.
getB2DPolygon
(
i
)
);
DrawPolyPolygon
(
aOnePoly
);
}
EndSolid
();
}
return
true
;
}
bool
OpenGLSalGraphicsImpl
::
drawPolyLine
(
...
...
@@ -843,6 +891,7 @@ bool OpenGLSalGraphicsImpl::drawAlphaRect(
long
nWidth
,
long
nHeight
,
sal_uInt8
nTransparency
)
{
SAL_INFO
(
"vcl.opengl"
,
"::drawAlphaRect"
);
if
(
mnFillColor
!=
SALCOLOR_NONE
&&
nTransparency
<
100
)
{
BeginSolid
(
mnFillColor
,
nTransparency
);
...
...
vcl/opengl/solidFragmentShader.glsl
Dosyayı görüntüle @
5302d5a3
...
...
@@ -11,7 +11,7 @@
uniform
vec4
color
;
void
main
()
{
gl_FragColor
=
color
;
gl_FragColor
=
color
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/outdev/polygon.cxx
Dosyayı görüntüle @
5302d5a3
...
...
@@ -231,7 +231,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly )
// Caution: This method is nearly the same as
// OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly, double fTransparency),
// so when changes are made here do not forget to make change
s
there, too
// so when changes are made here do not forget to make change
s
there, too
void
OutputDevice
::
DrawPolyPolygon
(
const
basegfx
::
B2DPolyPolygon
&
rB2DPolyPoly
)
{
...
...
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