summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 21:14:48 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 21:14:48 +0000
commit5e91242859811aef980a929253e6c33eb2cfec6e (patch)
tree3f6e46427611c7a7d532df3d894228923ca2a850 /chrome
parent3351370c9cc1e3a3d2a23cf698561c013276d316 (diff)
downloadchromium_src-5e91242859811aef980a929253e6c33eb2cfec6e.zip
chromium_src-5e91242859811aef980a929253e6c33eb2cfec6e.tar.gz
chromium_src-5e91242859811aef980a929253e6c33eb2cfec6e.tar.bz2
Turns back on tree's double buffering when RTL. For some reason a
graphics mode of a ADVANCED doesn't work with a RTL layout for this code. BUG=4175 TEST=bring up the bookmark manager in the hebrew locale, make sure the text isn't mirrored. Review URL: http://codereview.chromium.org/10216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/views/tree_view.cc25
1 files changed, 11 insertions, 14 deletions
diff --git a/chrome/views/tree_view.cc b/chrome/views/tree_view.cc
index cbf577a..c62b6e7 100644
--- a/chrome/views/tree_view.cc
+++ b/chrome/views/tree_view.cc
@@ -631,29 +631,26 @@ LRESULT CALLBACK TreeView::TreeWndProc(HWND window,
// We handle the messages WM_ERASEBKGND and WM_PAINT such that we paint into
// a DIB first and then perform a BitBlt from the DIB into the underlying
// window's DC. This double buffering code prevents the tree view from
- // flickering during resize. This double buffering code doesn't work for RTL
- // locales because the DIB created by ChromeCanvasPaint is not flipped and
- // that's causing the text to be incorrectly mirrored after the BitBlt call.
- // Thus, we disable the double buffering for RTL locales until this problem is
- // fixed.
+ // flickering during resize.
switch (message) {
case WM_ERASEBKGND:
- if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) {
- break;
- }
return 1;
case WM_PAINT: {
- if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) {
- break;
- }
-
ChromeCanvasPaint canvas(window);
if (canvas.isEmpty())
return 0;
- SendMessage(window, WM_PRINTCLIENT,
- reinterpret_cast<WPARAM>(canvas.beginPlatformPaint()), 0);
+ HDC dc = canvas.beginPlatformPaint();
+ if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) {
+ // ChromeCanvas ends up configuring the DC with a mode of GM_ADVANCED.
+ // For some reason a graphics mode of ADVANCED triggers all the text
+ // to be mirrored when RTL. Set the mode back to COMPATIBLE and
+ // explicitly set the layout.
+ SetGraphicsMode(dc, GM_COMPATIBLE);
+ SetLayout(dc, LAYOUT_RTL);
+ }
+ SendMessage(window, WM_PRINTCLIENT, reinterpret_cast<WPARAM>(dc), 0);
canvas.endPlatformPaint();
return 0;
}