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
779b57b8
Kaydet (Commit)
779b57b8
authored
Kas 13, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: add OutputDevice / copyBits test case.
Change-Id: Ie585daba1d1a1f1dc9f2957c19462a501131d10a
üst
4ef9e07c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
10 deletions
+58
-10
vcldemo.cxx
vcl/workben/vcldemo.cxx
+58
-10
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
779b57b8
...
@@ -495,20 +495,67 @@ public:
...
@@ -495,20 +495,67 @@ public:
struct
DrawToVirtualDevice
:
public
RegionRenderer
struct
DrawToVirtualDevice
:
public
RegionRenderer
{
{
enum
RenderType
{
RENDER_AS_BITMAP
,
RENDER_AS_OUTDEV
,
RENDER_AS_BITMAPEX
,
RENDER_AS_ALPHA_OUTDEV
};
void
SizeAndRender
(
OutputDevice
&
rDev
,
Rectangle
r
,
RenderType
eType
,
const
RenderContext
&
rCtx
)
{
VirtualDevice
*
pNested
;
if
((
int
)
eType
<
RENDER_AS_BITMAPEX
)
pNested
=
new
VirtualDevice
(
rDev
);
else
pNested
=
new
VirtualDevice
(
rDev
,
0
,
0
);
pNested
->
SetOutputSizePixel
(
r
.
GetSize
());
Rectangle
aWhole
(
Point
(
0
,
0
),
r
.
GetSize
());
// mini me
rCtx
.
mpDemoWin
->
drawToDevice
(
*
pNested
,
true
);
if
(
eType
==
RENDER_AS_BITMAP
)
{
Bitmap
aBitmap
(
pNested
->
GetBitmap
(
Point
(
0
,
0
),
aWhole
.
GetSize
()));
rDev
.
DrawBitmap
(
r
.
TopLeft
(),
aBitmap
);
}
else
if
(
eType
==
RENDER_AS_BITMAPEX
)
{
BitmapEx
aBitmapEx
(
pNested
->
GetBitmapEx
(
Point
(
0
,
0
),
aWhole
.
GetSize
()));
rDev
.
DrawBitmapEx
(
r
.
TopLeft
(),
aBitmapEx
);
}
else
if
(
eType
==
RENDER_AS_OUTDEV
||
eType
==
RENDER_AS_ALPHA_OUTDEV
)
{
rDev
.
DrawOutDev
(
r
.
TopLeft
(),
r
.
GetSize
(),
aWhole
.
TopLeft
(),
aWhole
.
GetSize
(),
*
pNested
);
}
delete
pNested
;
}
virtual
void
RenderRegion
(
OutputDevice
&
rDev
,
Rectangle
r
,
virtual
void
RenderRegion
(
OutputDevice
&
rDev
,
Rectangle
r
,
const
RenderContext
&
rCtx
)
SAL_OVERRIDE
const
RenderContext
&
rCtx
)
SAL_OVERRIDE
{
{
// avoid infinite recursion
// avoid infinite recursion
if
(
rCtx
.
mbVDev
)
if
(
rCtx
.
mbVDev
)
return
;
return
;
VirtualDevice
aNested
(
rDev
);
aNested
.
SetOutputSizePixel
(
r
.
GetSize
());
Rectangle
aWhole
(
Point
(
0
,
0
),
r
.
GetSize
());
// mini me
rCtx
.
mpDemoWin
->
drawToDevice
(
aNested
,
true
);
Bitmap
aBitmap
(
aNested
.
GetBitmap
(
Point
(
0
,
0
),
aWhole
.
GetSize
()));
if
(
rCtx
.
meStyle
==
RENDER_EXPANDED
)
rDev
.
DrawBitmap
(
r
.
TopLeft
(),
aBitmap
);
{
std
::
vector
<
Rectangle
>
aRegions
(
DemoWin
::
partition
(
rDev
,
2
,
2
));
DemoWin
::
clearRects
(
rDev
,
aRegions
);
RenderType
eRenderTypes
[]
=
{
RENDER_AS_BITMAP
,
RENDER_AS_OUTDEV
,
RENDER_AS_BITMAPEX
,
RENDER_AS_ALPHA_OUTDEV
};
for
(
size_t
i
=
0
;
i
<
aRegions
.
size
();
i
++
)
SizeAndRender
(
rDev
,
aRegions
[
i
],
eRenderTypes
[
i
],
rCtx
);
}
else
SizeAndRender
(
rDev
,
r
,
RENDER_AS_BITMAP
,
rCtx
);
}
}
};
};
...
@@ -563,17 +610,18 @@ public:
...
@@ -563,17 +610,18 @@ public:
}
}
};
};
void
drawToDevice
(
OutputDevice
&
rDev
,
bool
bV
d
ev
)
void
drawToDevice
(
OutputDevice
&
rDev
,
bool
bV
D
ev
)
{
{
RenderContext
aCtx
;
RenderContext
aCtx
;
aCtx
.
mbVDev
=
bV
d
ev
;
aCtx
.
mbVDev
=
bV
D
ev
;
aCtx
.
mpDemoWin
=
this
;
aCtx
.
mpDemoWin
=
this
;
Rectangle
aWholeWin
(
Point
(
0
,
0
),
rDev
.
GetOutputSizePixel
());
Rectangle
aWholeWin
(
Point
(
0
,
0
),
rDev
.
GetOutputSizePixel
());
drawBackground
(
rDev
,
aWholeWin
);
drawBackground
(
rDev
,
aWholeWin
);
if
(
mnSelectedRenderer
>=
0
)
if
(
!
bVDev
/* want everything in the vdev */
&&
mnSelectedRenderer
>=
0
)
{
{
aCtx
.
meStyle
=
RENDER_EXPANDED
;
aCtx
.
meStyle
=
RENDER_EXPANDED
;
maRenderers
[
mnSelectedRenderer
]
->
RenderRegion
(
rDev
,
aWholeWin
,
aCtx
);
maRenderers
[
mnSelectedRenderer
]
->
RenderRegion
(
rDev
,
aWholeWin
,
aCtx
);
...
...
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