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
094faaae
Kaydet (Commit)
094faaae
authored
Nis 08, 2016
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
opengl: fix wrong clipping when drawing text
Change-Id: I41a182c5309586337032328dfe82b1c6715f0dc2
üst
80d0b291
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
openglgdiimpl.hxx
vcl/inc/openglgdiimpl.hxx
+4
-1
gdiimpl.cxx
vcl/opengl/gdiimpl.cxx
+25
-10
No files found.
vcl/inc/openglgdiimpl.hxx
Dosyayı görüntüle @
094faaae
...
@@ -148,7 +148,7 @@ public:
...
@@ -148,7 +148,7 @@ public:
void
DrawAxialGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
);
void
DrawAxialGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
);
void
DrawRadialGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
);
void
DrawRadialGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
);
void
DeferredTextDraw
(
OpenGLTexture
&
rTexture
,
const
SalColor
nMaskColor
,
const
SalTwoRect
&
rPosAry
);
void
DeferredTextDraw
(
OpenGLTexture
&
rTexture
,
const
SalColor
nMaskColor
,
const
SalTwoRect
&
rPosAry
);
void
FlushDeferredDrawing
(
bool
bInDraw
=
false
);
void
FlushDeferredDrawing
();
public
:
public
:
// get the width of the device
// get the width of the device
...
@@ -166,6 +166,9 @@ public:
...
@@ -166,6 +166,9 @@ public:
/// Oddly not all operations obey the XOR option.
/// Oddly not all operations obey the XOR option.
enum
XOROption
{
IGNORE_XOR
,
IMPLEMENT_XOR
};
enum
XOROption
{
IGNORE_XOR
,
IMPLEMENT_XOR
};
// initialize pre-draw state
void
InitializePreDrawState
(
XOROption
eOpt
=
IGNORE_XOR
);
// operations to do before painting
// operations to do before painting
void
PreDraw
(
XOROption
eOpt
=
IGNORE_XOR
);
void
PreDraw
(
XOROption
eOpt
=
IGNORE_XOR
);
...
...
vcl/opengl/gdiimpl.cxx
Dosyayı görüntüle @
094faaae
...
@@ -186,6 +186,13 @@ void OpenGLSalGraphicsImpl::DeInit()
...
@@ -186,6 +186,13 @@ void OpenGLSalGraphicsImpl::DeInit()
}
}
void
OpenGLSalGraphicsImpl
::
PreDraw
(
XOROption
eOpt
)
void
OpenGLSalGraphicsImpl
::
PreDraw
(
XOROption
eOpt
)
{
FlushDeferredDrawing
();
InitializePreDrawState
(
eOpt
);
}
void
OpenGLSalGraphicsImpl
::
InitializePreDrawState
(
XOROption
eOpt
)
{
{
OpenGLZone
::
enter
();
OpenGLZone
::
enter
();
...
@@ -206,8 +213,6 @@ void OpenGLSalGraphicsImpl::PreDraw(XOROption eOpt)
...
@@ -206,8 +213,6 @@ void OpenGLSalGraphicsImpl::PreDraw(XOROption eOpt)
glViewport
(
0
,
0
,
GetWidth
(),
GetHeight
()
);
glViewport
(
0
,
0
,
GetWidth
(),
GetHeight
()
);
CHECK_GL_ERROR
();
CHECK_GL_ERROR
();
FlushDeferredDrawing
(
true
);
ImplInitClipRegion
();
ImplInitClipRegion
();
CHECK_GL_ERROR
();
CHECK_GL_ERROR
();
...
@@ -268,6 +273,7 @@ void OpenGLSalGraphicsImpl::freeResources()
...
@@ -268,6 +273,7 @@ void OpenGLSalGraphicsImpl::freeResources()
{
{
VCL_GL_INFO
(
"freeResources"
);
VCL_GL_INFO
(
"freeResources"
);
mpContext
->
makeCurrent
();
mpContext
->
makeCurrent
();
FlushDeferredDrawing
();
mpContext
->
ReleaseFramebuffer
(
maOffscreenTex
);
mpContext
->
ReleaseFramebuffer
(
maOffscreenTex
);
}
}
ReleaseContext
();
ReleaseContext
();
...
@@ -357,12 +363,16 @@ const vcl::Region& OpenGLSalGraphicsImpl::getClipRegion() const
...
@@ -357,12 +363,16 @@ const vcl::Region& OpenGLSalGraphicsImpl::getClipRegion() const
bool
OpenGLSalGraphicsImpl
::
setClipRegion
(
const
vcl
::
Region
&
rClip
)
bool
OpenGLSalGraphicsImpl
::
setClipRegion
(
const
vcl
::
Region
&
rClip
)
{
{
VCL_GL_INFO
(
"::setClipRegion "
<<
rClip
);
if
(
maClipRegion
==
rClip
)
if
(
maClipRegion
==
rClip
)
return
true
;
{
VCL_GL_INFO
(
"::setClipRegion (no change) "
<<
rClip
);
return
true
;
}
FlushDeferredDrawing
();
FlushDeferredDrawing
();
VCL_GL_INFO
(
"::setClipRegion "
<<
rClip
);
maClipRegion
=
rClip
;
maClipRegion
=
rClip
;
mbUseStencil
=
false
;
mbUseStencil
=
false
;
...
@@ -378,12 +388,16 @@ bool OpenGLSalGraphicsImpl::setClipRegion( const vcl::Region& rClip )
...
@@ -378,12 +388,16 @@ bool OpenGLSalGraphicsImpl::setClipRegion( const vcl::Region& rClip )
// set the clip region to empty
// set the clip region to empty
void
OpenGLSalGraphicsImpl
::
ResetClipRegion
()
void
OpenGLSalGraphicsImpl
::
ResetClipRegion
()
{
{
VCL_GL_INFO
(
"::ResetClipRegion"
);
if
(
maClipRegion
.
IsEmpty
())
if
(
maClipRegion
.
IsEmpty
())
{
VCL_GL_INFO
(
"::ResetClipRegion (no change) "
);
return
;
return
;
}
FlushDeferredDrawing
();
FlushDeferredDrawing
();
VCL_GL_INFO
(
"::ResetClipRegion"
);
maClipRegion
.
SetEmpty
();
maClipRegion
.
SetEmpty
();
mbUseScissor
=
false
;
mbUseScissor
=
false
;
mbUseStencil
=
false
;
mbUseStencil
=
false
;
...
@@ -1674,13 +1688,12 @@ void OpenGLSalGraphicsImpl::DeferredTextDraw(OpenGLTexture& rTexture, SalColor a
...
@@ -1674,13 +1688,12 @@ void OpenGLSalGraphicsImpl::DeferredTextDraw(OpenGLTexture& rTexture, SalColor a
mpAccumulatedTextures
->
insert
(
rTexture
,
aMaskColor
,
rPosAry
);
mpAccumulatedTextures
->
insert
(
rTexture
,
aMaskColor
,
rPosAry
);
}
}
void
OpenGLSalGraphicsImpl
::
FlushDeferredDrawing
(
bool
bIsInDraw
)
void
OpenGLSalGraphicsImpl
::
FlushDeferredDrawing
()
{
{
if
(
mpAccumulatedTextures
->
empty
())
if
(
mpAccumulatedTextures
->
empty
())
return
;
return
;
if
(
!
bIsInDraw
)
InitializePreDrawState
();
PreDraw
();
VCL_GL_INFO
(
"FlushDeferredDrawing"
);
VCL_GL_INFO
(
"FlushDeferredDrawing"
);
...
@@ -1725,7 +1738,9 @@ void OpenGLSalGraphicsImpl::FlushDeferredDrawing(bool bIsInDraw)
...
@@ -1725,7 +1738,9 @@ void OpenGLSalGraphicsImpl::FlushDeferredDrawing(bool bIsInDraw)
if
(
!
UseProgram
(
"textureVertexShader"
,
"maskFragmentShader"
)
)
if
(
!
UseProgram
(
"textureVertexShader"
,
"maskFragmentShader"
)
)
return
;
return
;
mpProgram
->
SetBlendMode
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
mpProgram
->
SetBlendMode
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
for
(
auto
&
rPair
:
mpAccumulatedTextures
->
getAccumulatedTexturesMap
())
for
(
auto
&
rPair
:
mpAccumulatedTextures
->
getAccumulatedTexturesMap
())
{
{
OpenGLTexture
&
rTexture
=
rPair
.
second
->
maTexture
;
OpenGLTexture
&
rTexture
=
rPair
.
second
->
maTexture
;
...
@@ -1742,8 +1757,8 @@ void OpenGLSalGraphicsImpl::FlushDeferredDrawing(bool bIsInDraw)
...
@@ -1742,8 +1757,8 @@ void OpenGLSalGraphicsImpl::FlushDeferredDrawing(bool bIsInDraw)
}
}
mpProgram
->
Clean
();
mpProgram
->
Clean
();
mpAccumulatedTextures
->
clear
();
mpAccumulatedTextures
->
clear
();
if
(
!
bIsInDraw
)
PostDraw
();
PostDraw
();
}
}
void
OpenGLSalGraphicsImpl
::
DrawLinearGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
)
void
OpenGLSalGraphicsImpl
::
DrawLinearGradient
(
const
Gradient
&
rGradient
,
const
Rectangle
&
rRect
)
...
...
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