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
28e465d2
Kaydet (Commit)
28e465d2
authored
Agu 04, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#92982 vcl rendercontext: let PaintBufferGuard also manage pixel offset
Change-Id: Ifd6a75c4312f93c815f5d137f515724f3629fa0d
üst
c36a00b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
24 deletions
+33
-24
outdev.hxx
include/vcl/outdev.hxx
+2
-1
outdev.cxx
vcl/source/outdev/outdev.cxx
+10
-0
paint.cxx
vcl/source/window/paint.cxx
+21
-23
No files found.
include/vcl/outdev.hxx
Dosyayı görüntüle @
28e465d2
...
@@ -319,7 +319,6 @@ namespace vcl {
...
@@ -319,7 +319,6 @@ 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
;
...
@@ -500,6 +499,8 @@ public:
...
@@ -500,6 +499,8 @@ public:
long
GetOutputHeightPixel
()
const
{
return
mnOutHeight
;
}
long
GetOutputHeightPixel
()
const
{
return
mnOutHeight
;
}
long
GetOutOffXPixel
()
const
{
return
mnOutOffX
;
}
long
GetOutOffXPixel
()
const
{
return
mnOutOffX
;
}
long
GetOutOffYPixel
()
const
{
return
mnOutOffY
;
}
long
GetOutOffYPixel
()
const
{
return
mnOutOffY
;
}
void
SetOutOffXPixel
(
long
nOutOffX
);
void
SetOutOffYPixel
(
long
nOutOffY
);
Size
GetOutputSize
()
const
Size
GetOutputSize
()
const
{
return
PixelToLogic
(
GetOutputSizePixel
()
);
}
{
return
PixelToLogic
(
GetOutputSizePixel
()
);
}
...
...
vcl/source/outdev/outdev.cxx
Dosyayı görüntüle @
28e465d2
...
@@ -426,6 +426,16 @@ sal_uInt16 OutputDevice::GetBitCount() const
...
@@ -426,6 +426,16 @@ sal_uInt16 OutputDevice::GetBitCount() const
return
(
sal_uInt16
)
mpGraphics
->
GetBitCount
();
return
(
sal_uInt16
)
mpGraphics
->
GetBitCount
();
}
}
void
OutputDevice
::
SetOutOffXPixel
(
long
nOutOffX
)
{
mnOutOffX
=
nOutOffX
;
}
void
OutputDevice
::
SetOutOffYPixel
(
long
nOutOffY
)
{
mnOutOffY
=
nOutOffY
;
}
sal_uLong
OutputDevice
::
GetColorCount
()
const
sal_uLong
OutputDevice
::
GetColorCount
()
const
{
{
...
...
vcl/source/window/paint.cxx
Dosyayı görüntüle @
28e465d2
...
@@ -47,10 +47,14 @@ class PaintBufferGuard
...
@@ -47,10 +47,14 @@ class PaintBufferGuard
bool
mbBackground
;
bool
mbBackground
;
Wallpaper
maBackground
;
Wallpaper
maBackground
;
AllSettings
maSettings
;
AllSettings
maSettings
;
long
mnOutOffX
;
long
mnOutOffY
;
public
:
public
:
PaintBufferGuard
(
ImplFrameData
*
pFrameData
,
vcl
::
Window
*
pWindow
)
PaintBufferGuard
(
ImplFrameData
*
pFrameData
,
vcl
::
Window
*
pWindow
)
:
mpFrameData
(
pFrameData
),
:
mpFrameData
(
pFrameData
),
mbBackground
(
false
)
mbBackground
(
false
),
mnOutOffX
(
0
),
mnOutOffY
(
0
)
{
{
// 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,
...
@@ -97,10 +101,18 @@ public:
...
@@ -97,10 +101,18 @@ public:
pFrameData
->
mpBuffer
->
SetRasterOp
(
pWindow
->
GetRasterOp
());
pFrameData
->
mpBuffer
->
SetRasterOp
(
pWindow
->
GetRasterOp
());
pFrameData
->
mpBuffer
->
SetLayoutMode
(
pWindow
->
GetLayoutMode
());
pFrameData
->
mpBuffer
->
SetLayoutMode
(
pWindow
->
GetLayoutMode
());
pFrameData
->
mpBuffer
->
SetDigitLanguage
(
pWindow
->
GetDigitLanguage
());
pFrameData
->
mpBuffer
->
SetDigitLanguage
(
pWindow
->
GetDigitLanguage
());
mnOutOffX
=
pFrameData
->
mpBuffer
->
GetOutOffXPixel
();
mnOutOffY
=
pFrameData
->
mpBuffer
->
GetOutOffYPixel
();
pFrameData
->
mpBuffer
->
SetOutOffXPixel
(
pWindow
->
GetOutOffXPixel
());
pFrameData
->
mpBuffer
->
SetOutOffYPixel
(
pWindow
->
GetOutOffYPixel
());
}
}
~
PaintBufferGuard
()
~
PaintBufferGuard
()
{
{
// Restore buffer state.
// Restore buffer state.
mpFrameData
->
mpBuffer
->
SetOutOffXPixel
(
mnOutOffX
);
mpFrameData
->
mpBuffer
->
SetOutOffYPixel
(
mnOutOffY
);
mpFrameData
->
mpBuffer
->
Pop
();
mpFrameData
->
mpBuffer
->
Pop
();
mpFrameData
->
mpBuffer
->
SetSettings
(
maSettings
);
mpFrameData
->
mpBuffer
->
SetSettings
(
maSettings
);
if
(
mbBackground
)
if
(
mbBackground
)
...
@@ -183,16 +195,13 @@ void PaintHelper::StartBufferedPaint()
...
@@ -183,16 +195,13 @@ void PaintHelper::StartBufferedPaint()
// painting over, as VirtualDevice::ImplInitVirDev() would do.
// painting over, as VirtualDevice::ImplInitVirDev() would do.
// The painted area is m_aPaintRect, or in case it's empty, then the whole window.
// The painted area is m_aPaintRect, or in case it's empty, then the whole window.
pFrameData
->
mpBuffer
->
SetBackground
(
Wallpaper
(
Color
(
COL_WHITE
)));
pFrameData
->
mpBuffer
->
SetBackground
(
Wallpaper
(
Color
(
COL_WHITE
)));
long
nOutOffX
=
pFrameData
->
mpBuffer
->
GetOutOffXPixel
();
{
long
nOutOffY
=
pFrameData
->
mpBuffer
->
GetOutOffYPixel
();
PaintBufferGuard
g
(
pFrameData
,
m_pWindow
);
pFrameData
->
mpBuffer
->
mnOutOffX
=
m_pWindow
->
GetOutOffXPixel
();
if
(
m_aPaintRect
.
IsEmpty
())
pFrameData
->
mpBuffer
->
mnOutOffY
=
m_pWindow
->
GetOutOffYPixel
();
pFrameData
->
mpBuffer
->
Erase
(
Rectangle
(
Point
(
0
,
0
),
m_pWindow
->
GetOutputSize
()));
if
(
m_aPaintRect
.
IsEmpty
())
else
pFrameData
->
mpBuffer
->
Erase
(
Rectangle
(
Point
(
0
,
0
),
m_pWindow
->
GetOutputSize
()));
pFrameData
->
mpBuffer
->
Erase
(
m_aPaintRect
);
else
}
pFrameData
->
mpBuffer
->
Erase
(
m_aPaintRect
);
pFrameData
->
mpBuffer
->
mnOutOffX
=
nOutOffX
;
pFrameData
->
mpBuffer
->
mnOutOffY
=
nOutOffY
;
pFrameData
->
mbInBufferedPaint
=
true
;
pFrameData
->
mbInBufferedPaint
=
true
;
m_bStartedBufferedPaint
=
true
;
m_bStartedBufferedPaint
=
true
;
...
@@ -232,13 +241,8 @@ void PaintHelper::PaintBuffer()
...
@@ -232,13 +241,8 @@ void PaintHelper::PaintBuffer()
aPaintRectSize
=
m_pWindow
->
PixelToLogic
(
aRectanglePixel
.
GetSize
());
aPaintRectSize
=
m_pWindow
->
PixelToLogic
(
aRectanglePixel
.
GetSize
());
}
}
long
nOutOffX
=
pFrameData
->
mpBuffer
->
GetOutOffXPixel
();
PaintBufferGuard
g
(
pFrameData
,
m_pWindow
);
long
nOutOffY
=
pFrameData
->
mpBuffer
->
GetOutOffYPixel
();
pFrameData
->
mpBuffer
->
mnOutOffX
=
m_pWindow
->
GetOutOffXPixel
();
pFrameData
->
mpBuffer
->
mnOutOffY
=
m_pWindow
->
GetOutOffYPixel
();
m_pWindow
->
DrawOutDev
(
m_aPaintRect
.
TopLeft
(),
aPaintRectSize
,
m_aPaintRect
.
TopLeft
(),
aPaintRectSize
,
*
pFrameData
->
mpBuffer
.
get
());
m_pWindow
->
DrawOutDev
(
m_aPaintRect
.
TopLeft
(),
aPaintRectSize
,
m_aPaintRect
.
TopLeft
(),
aPaintRectSize
,
*
pFrameData
->
mpBuffer
.
get
());
pFrameData
->
mpBuffer
->
mnOutOffX
=
nOutOffX
;
pFrameData
->
mpBuffer
->
mnOutOffY
=
nOutOffY
;
}
}
}
}
...
@@ -289,14 +293,8 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
...
@@ -289,14 +293,8 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
PaintBufferGuard
g
(
pFrameData
,
m_pWindow
);
PaintBufferGuard
g
(
pFrameData
,
m_pWindow
);
m_pWindow
->
ApplySettings
(
*
pFrameData
->
mpBuffer
.
get
());
m_pWindow
->
ApplySettings
(
*
pFrameData
->
mpBuffer
.
get
());
long
nOutOffX
=
pFrameData
->
mpBuffer
->
mnOutOffX
;
long
nOutOffY
=
pFrameData
->
mpBuffer
->
mnOutOffY
;
pFrameData
->
mpBuffer
->
mnOutOffX
=
m_pWindow
->
GetOutOffXPixel
();
pFrameData
->
mpBuffer
->
mnOutOffY
=
m_pWindow
->
GetOutOffYPixel
();
m_pWindow
->
PushPaintHelper
(
this
,
*
pFrameData
->
mpBuffer
.
get
());
m_pWindow
->
PushPaintHelper
(
this
,
*
pFrameData
->
mpBuffer
.
get
());
m_pWindow
->
Paint
(
*
pFrameData
->
mpBuffer
.
get
(),
m_aPaintRect
);
m_pWindow
->
Paint
(
*
pFrameData
->
mpBuffer
.
get
(),
m_aPaintRect
);
pFrameData
->
mpBuffer
->
mnOutOffX
=
nOutOffX
;
pFrameData
->
mpBuffer
->
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