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
a0a6cd51
Kaydet (Commit)
a0a6cd51
authored
May 21, 2015
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rendercontext: Position the double-buffered subwidgets correctly.
Change-Id: I707ff09ac2b7b610f0f13440a215abf083f9815d
üst
f57b4e5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
outdev.hxx
include/vcl/outdev.hxx
+1
-0
paint.cxx
vcl/source/window/paint.cxx
+40
-6
No files found.
include/vcl/outdev.hxx
Dosyayı görüntüle @
a0a6cd51
...
@@ -314,6 +314,7 @@ namespace vcl {
...
@@ -314,6 +314,7 @@ namespace vcl {
class
VCL_DLLPUBLIC
OutputDevice
class
VCL_DLLPUBLIC
OutputDevice
{
{
friend
class
PaintHelper
;
friend
class
Printer
;
friend
class
Printer
;
friend
class
VirtualDevice
;
friend
class
VirtualDevice
;
friend
class
vcl
::
Window
;
friend
class
vcl
::
Window
;
...
...
vcl/source/window/paint.cxx
Dosyayı görüntüle @
a0a6cd51
...
@@ -85,6 +85,9 @@ public:
...
@@ -85,6 +85,9 @@ public:
void
DoPaint
(
const
vcl
::
Region
*
pRegion
);
void
DoPaint
(
const
vcl
::
Region
*
pRegion
);
/// Create m_pBuffer, and set it up to have the same settings as m_pWindow.
/// Create m_pBuffer, and set it up to have the same settings as m_pWindow.
void
CreateBuffer
();
/// Setup m_pBuffer according to the settings of the current m_pWindow.
void
SetupBuffer
();
void
SetupBuffer
();
/// Paint the content of the buffer to the current m_pWindow.
/// Paint the content of the buffer to the current m_pWindow.
...
@@ -104,13 +107,29 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, const VclPtr<VirtualDevice>& rBuf
...
@@ -104,13 +107,29 @@ PaintHelper::PaintHelper(vcl::Window *pWindow, const VclPtr<VirtualDevice>& rBuf
{
{
}
}
void
PaintHelper
::
Setup
Buffer
()
void
PaintHelper
::
Create
Buffer
()
{
{
assert
(
!
m_pBuffer
);
assert
(
!
m_pBuffer
);
m_pBuffer
=
VclPtrInstance
<
VirtualDevice
>
();
m_pBuffer
=
VclPtrInstance
<
VirtualDevice
>
();
m_bCreatedBuffer
=
true
;
m_bCreatedBuffer
=
true
;
SetupBuffer
();
// update the output size now, after all the settings were copied
m_pBuffer
->
SetOutputSize
(
m_pWindow
->
GetOutputSize
());
// we need to remember the mnOutOffX / mnOutOffY, but actually really
// set it just temporarily for the subwidgets - so we are setting it here
// only to remember the value & to be able to pass it to the descendants
// FIXME: once everything's double-buffered, this is (hopefully) not
// necessary as the m_pBuffer is always created for the main window.
m_pBuffer
->
mnOutOffX
=
m_pWindow
->
GetOutOffXPixel
();
m_pBuffer
->
mnOutOffY
=
m_pWindow
->
GetOutOffYPixel
();
}
void
PaintHelper
::
SetupBuffer
()
{
// transfer various settings
// transfer various settings
// FIXME: this must disappear as we move to RenderContext only,
// FIXME: this must disappear as we move to RenderContext only,
// the painting must become state-less, so that no actual
// the painting must become state-less, so that no actual
...
@@ -133,17 +152,17 @@ void PaintHelper::SetupBuffer()
...
@@ -133,17 +152,17 @@ void PaintHelper::SetupBuffer()
m_pBuffer
->
SetTextFillColor
(
m_pWindow
->
GetTextFillColor
());
m_pBuffer
->
SetTextFillColor
(
m_pWindow
->
GetTextFillColor
());
m_pBuffer
->
SetTextAlign
(
m_pWindow
->
GetTextAlign
());
m_pBuffer
->
SetTextAlign
(
m_pWindow
->
GetTextAlign
());
m_pBuffer
->
SetRasterOp
(
m_pWindow
->
GetRasterOp
());
m_pBuffer
->
SetRasterOp
(
m_pWindow
->
GetRasterOp
());
m_pBuffer
->
SetRefPoint
(
m_pWindow
->
GetRefPoint
());
m_pBuffer
->
SetLayoutMode
(
m_pWindow
->
GetLayoutMode
());
m_pBuffer
->
SetLayoutMode
(
m_pWindow
->
GetLayoutMode
());
m_pBuffer
->
SetDigitLanguage
(
m_pWindow
->
GetDigitLanguage
());
m_pBuffer
->
SetDigitLanguage
(
m_pWindow
->
GetDigitLanguage
());
// update the output size now, after all the settings were copied
m_pBuffer
->
SetOutputSize
(
m_pWindow
->
GetOutputSize
());
}
}
void
PaintHelper
::
PaintBuffer
()
void
PaintHelper
::
PaintBuffer
()
{
{
assert
(
m_pBuffer
);
assert
(
m_pBuffer
);
assert
(
m_bCreatedBuffer
);
m_pBuffer
->
mnOutOffX
=
0
;
m_pBuffer
->
mnOutOffY
=
0
;
// copy the buffer content to the actual window
// copy the buffer content to the actual window
// export VCL_DOUBLEBUFFERING_AVOID_PAINT=1 to see where we are
// export VCL_DOUBLEBUFFERING_AVOID_PAINT=1 to see where we are
...
@@ -186,7 +205,7 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
...
@@ -186,7 +205,7 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
// double-buffering: setup the buffer if it does not exist
// double-buffering: setup the buffer if it does not exist
if
(
!
m_pBuffer
&&
m_pWindow
->
SupportsDoubleBuffering
())
if
(
!
m_pBuffer
&&
m_pWindow
->
SupportsDoubleBuffering
())
Setup
Buffer
();
Create
Buffer
();
// double-buffering: if this window does not support double-buffering,
// double-buffering: if this window does not support double-buffering,
// but we are in the middle of double-buffered paint, we might be
// but we are in the middle of double-buffered paint, we might be
...
@@ -197,9 +216,24 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
...
@@ -197,9 +216,24 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
if
(
m_pBuffer
&&
m_pWindow
->
SupportsDoubleBuffering
())
if
(
m_pBuffer
&&
m_pWindow
->
SupportsDoubleBuffering
())
{
{
// double-buffering
// double-buffering
SetupBuffer
();
// temporarily decrease the mnOutOffX/Y of the buffer for the
// subwidgets (because the m_pBuffer is our base here)
// FIXME: once everything's double-buffered, this is (hopefully) not
// necessary as the m_pBuffer is always created for the main window.
long
nOutOffX
=
m_pBuffer
->
mnOutOffX
;
long
nOutOffY
=
m_pBuffer
->
mnOutOffY
;
m_pBuffer
->
mnOutOffX
=
m_pWindow
->
GetOutOffXPixel
()
-
m_pBuffer
->
mnOutOffX
;
m_pBuffer
->
mnOutOffY
=
m_pWindow
->
GetOutOffYPixel
()
-
m_pBuffer
->
mnOutOffY
;
m_pWindow
->
PushPaintHelper
(
this
,
*
m_pWindow
);
m_pWindow
->
PushPaintHelper
(
this
,
*
m_pWindow
);
m_pWindow
->
ApplySettings
(
*
m_pBuffer
.
get
());
m_pWindow
->
ApplySettings
(
*
m_pBuffer
.
get
());
m_pWindow
->
Paint
(
*
m_pBuffer
.
get
(),
m_aPaintRect
);
m_pWindow
->
Paint
(
*
m_pBuffer
.
get
(),
m_aPaintRect
);
// restore the mnOutOffX/Y value
m_pBuffer
->
mnOutOffX
=
nOutOffX
;
m_pBuffer
->
mnOutOffY
=
nOutOffY
;
}
}
else
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