aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2012-02-29 21:22:42 +0100
committerMarko Njezic <devnull@localhost>2012-02-29 21:22:42 +0100
commite798128a9eb6c658b2847bdaaa6fd8c1bdc058b8 (patch)
tree8a7e345f6ae12de351825ea3acebce64d9c3eb56
parent561f9dd9812431fe069de171a65779ae7c30fc88 (diff)
downloadscintilla-mirror-e798128a9eb6c658b2847bdaaa6fd8c1bdc058b8.tar.gz
Bug #3495791. Create auxiliary surfaces on Direct2D without alpha channel, as
no underlying code expects them to be transparent. This will make text drawing use the same anti-aliasing mode no matter if using buffered mode or not.
-rw-r--r--doc/ScintillaDoc.html6
-rw-r--r--win32/PlatWin.cxx5
2 files changed, 7 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 2e8406ba6..b87650526 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3064,9 +3064,9 @@ struct Sci_TextToFind {
The technology property allows choosing between different drawing APIs and options.
On most platforms, the only choice is <code>SC_TECHNOLOGY_DEFAULT</code> (0).
On Windows Vista or later, <code>SC_TECHNOLOGY_DIRECTWRITE</code> (1)
- can be chosen to use the Direct2D and DirectWrite APIs for higher quality antialiased drawing.</p>
- <p>Since Direct2D buffers drawing, Scintilla's buffering should be turned off with
- <code>SCI_SETBUFFEREDDRAW(0);</code>. This causes DirectWrite to use better quality antialiasing.</p>
+ can be chosen to use the Direct2D and DirectWrite APIs for higher quality antialiased drawing.
+ Since Direct2D buffers drawing, Scintilla's buffering can be turned off with
+ <code>SCI_SETBUFFEREDDRAW(0)</code>.</p>
<p><b id="SCI_SETFONTQUALITY">SCI_SETFONTQUALITY(int fontQuality)</b><br />
<b id="SCI_GETFONTQUALITY">SCI_GETFONTQUALITY</b><br />
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 15b3655bf..5884cd4f2 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -1279,8 +1279,11 @@ void SurfaceD2D::InitPixMap(int width, int height, Surface *surface_, WindowID)
SetScale();
SurfaceD2D *psurfOther = static_cast<SurfaceD2D *>(surface_);
ID2D1BitmapRenderTarget *pCompatibleRenderTarget = NULL;
+ D2D1_SIZE_F desiredSize = D2D1::SizeF(width, height);
+ D2D1_PIXEL_FORMAT desiredFormat = psurfOther->pRenderTarget->GetPixelFormat();
+ desiredFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
HRESULT hr = psurfOther->pRenderTarget->CreateCompatibleRenderTarget(
- D2D1::SizeF(width, height), &pCompatibleRenderTarget);
+ &desiredSize, NULL, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &pCompatibleRenderTarget);
if (SUCCEEDED(hr)) {
pRenderTarget = pCompatibleRenderTarget;
pRenderTarget->BeginDraw();