diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 18:23:39 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 18:23:39 +0000 |
commit | 1ba27c494f174bac77f310de94bd7f1d92e62239 (patch) | |
tree | 4b93ad628e1f5b1e09925e3acaf58446a81ee973 /chrome | |
parent | 83d5aff027c4d9fdd14dcedffe3b8db7cb08868d (diff) | |
download | chromium_src-1ba27c494f174bac77f310de94bd7f1d92e62239.zip chromium_src-1ba27c494f174bac77f310de94bd7f1d92e62239.tar.gz chromium_src-1ba27c494f174bac77f310de94bd7f1d92e62239.tar.bz2 |
Linux: fix XRENDER support for NX
The NX X server doesn't support xRGB32 XRENDER picture formats. So, if
we don't find one of those formats, fall back on ARGB32, which is
fine, except that the X server will spend time dealing with an alpha
channel which is all 254 or 255. ARGB32 support is required by the
XRENDER spec.
(This doesn't fix VNC, a patch for that is forthcoming.)
Review URL: http://codereview.chromium.org/28192
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/common/x11_util.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/common/x11_util.cc b/chrome/common/x11_util.cc index ec54f7b..264ab9c 100644 --- a/chrome/common/x11_util.cc +++ b/chrome/common/x11_util.cc @@ -134,8 +134,13 @@ XRenderPictFormat* GetRenderARGB32Format(Display* dpy) { PictFormatAlphaMask; pictformat = XRenderFindFormat(dpy, kMask, &templ, 0 /* first result */); - CHECK(pictformat) << "XRENDER doesn't not support a Skia compatable format"; - // TODO(agl): fallback to a picture format with an alpha channel + + if (!pictformat) { + // Not all X servers support xRGB32 formats. However, the XRENDER spec says + // that they must support an ARGB32 format, so we can always return that. + pictformat = XRenderFindStandardFormat(dpy, PictStandardARGB32); + CHECK(pictformat) << "XRENDER ARGB32 not supported."; + } return pictformat; } |