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
30c6b2f1
Kaydet (Commit)
30c6b2f1
authored
Kas 14, 2014
tarafından
Jan Holesovsky
Kaydeden (comit)
Markus Mohrhard
Kas 15, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
windows opengl: Explain the concept of the text drawing + minor fixes.
Change-Id: I4651e7e9b8163844be548d4ed975a881d4f83fff
üst
6fd71992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
winlayout.cxx
vcl/win/source/gdi/winlayout.cxx
+39
-4
No files found.
vcl/win/source/gdi/winlayout.cxx
Dosyayı görüntüle @
30c6b2f1
...
@@ -163,7 +163,34 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
...
@@ -163,7 +163,34 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
}
}
else
else
{
{
// we have to render the text to a hidden texture, and draw it
// We have to render the text to a hidden texture, and draw it.
//
// Note that Windows GDI does not really support the alpha correctly
// when drawing - ie. it draws nothing to the alpha channel when
// rendering the text, even the antialiasing is done as 'real' pixels,
// not alpha...
//
// Luckily, this does not really limit us:
//
// To blend properly, we draw the texture, but then use it as an alpha
// channel for solid color (that will define the text color). This
// destroys the subpixel antialiasing - turns it into 'classic'
// antialiasing - but that is the best we can do, because the subpixel
// antialiasing needs to know what is in the background: When the
// background is white, or white-ish, it does the subpixel, but when
// there is a color, it just darkens the color (and does this even
// when part of the character is on a colored background, and part on
// white). It has to work this way, the results would look strange
// otherwise.
//
// For the GL rendering to work even with the subpixel antialiasing,
// we would need to get the current texture from the screen, let GDI
// draw the text to it (so that it can decide well where to use the
// subpixel and where not), and draw the result - but in that case we
// don't need alpha anyway.
//
// TODO: check the performance of this 2nd approach at some stage and
// switch to that if it performs well.
// FIXME so that we don't have to use enormous bitmap, move the text
// FIXME so that we don't have to use enormous bitmap, move the text
// to 0,0, size the width / height accordingly, and move it back via
// to 0,0, size the width / height accordingly, and move it back via
...
@@ -176,12 +203,15 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
...
@@ -176,12 +203,15 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
sal_uInt8
*
data
;
sal_uInt8
*
data
;
HBITMAP
hBitmap
=
WinSalVirtualDevice
::
ImplCreateVirDevBitmap
(
compatibleDC
,
width
,
height
,
bpp
,
reinterpret_cast
<
void
**>
(
&
data
));
HBITMAP
hBitmap
=
WinSalVirtualDevice
::
ImplCreateVirDevBitmap
(
compatibleDC
,
width
,
height
,
bpp
,
reinterpret_cast
<
void
**>
(
&
data
));
// FIXME fill transparent instead of 128
// FIXME fill transparent instead of 128
, this is for testing
memset
(
data
,
128
,
width
*
height
*
4
);
memset
(
data
,
128
,
width
*
height
*
4
);
// draw the text to the hidden DC
// draw the text to the hidden DC with black color and white
// background, we will use the result later as a mask only
HGDIOBJ
hBitmapOld
=
SelectObject
(
compatibleDC
,
hBitmap
);
HGDIOBJ
hBitmapOld
=
SelectObject
(
compatibleDC
,
hBitmap
);
SelectFont
(
compatibleDC
,
mhFont
);
SelectFont
(
compatibleDC
,
mhFont
);
SetTextColor
(
compatibleDC
,
RGB
(
0
,
0
,
0
));
SetBkColor
(
compatibleDC
,
RGB
(
255
,
255
,
255
));
DrawTextImpl
(
compatibleDC
);
DrawTextImpl
(
compatibleDC
);
SelectObject
(
compatibleDC
,
hBitmapOld
);
SelectObject
(
compatibleDC
,
hBitmapOld
);
...
@@ -203,7 +233,12 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
...
@@ -203,7 +233,12 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
aRects
.
mnDestHeight
=
height
;
aRects
.
mnDestHeight
=
height
;
pImpl
->
PreDraw
();
pImpl
->
PreDraw
();
pImpl
->
DrawAlphaTexture
(
aTexture
,
aRects
);
COLORREF
color
=
GetTextColor
(
hDC
);
SalColor
salColor
=
MAKE_SALCOLOR
(
GetRValue
(
color
),
GetGValue
(
color
),
GetBValue
(
color
));
// TODO when we have it:
// pImpl->DrawSolidColorWithMask(salColor, aTexture, aRects);
// and kill the following interim thing:
pImpl
->
DrawTexture
(
aTexture
,
aRects
);
pImpl
->
PostDraw
();
pImpl
->
PostDraw
();
}
}
...
...
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