diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 00:23:34 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 00:23:34 +0000 |
commit | bb5310b61786423453cf8580c4287b8f1bf7194f (patch) | |
tree | 262c2c841c54d4ca8d0748d20899c950326cd875 /remoting/host/capturer_linux.cc | |
parent | abc204eb5376f29fd557ec43901a5d9354cb5a69 (diff) | |
download | chromium_src-bb5310b61786423453cf8580c4287b8f1bf7194f.zip chromium_src-bb5310b61786423453cf8580c4287b8f1bf7194f.tar.gz chromium_src-bb5310b61786423453cf8580c4287b8f1bf7194f.tar.bz2 |
Disable DAMAGE and do full-screen polling in Linux capturer.
BUG=None
TEST=Enable Desktop Effects, verify capturer now works.
Review URL: http://codereview.chromium.org/7045011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/capturer_linux.cc')
-rw-r--r-- | remoting/host/capturer_linux.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/remoting/host/capturer_linux.cc b/remoting/host/capturer_linux.cc index 72e4712..712c1a7 100644 --- a/remoting/host/capturer_linux.cc +++ b/remoting/host/capturer_linux.cc @@ -24,6 +24,12 @@ namespace { static const int kBytesPerPixel = 4; +static bool ShouldUseXDamage() { + // For now, always use full-screen polling instead of the DAMAGE extension, + // as this extension is broken on many current systems OOTB. + return false; +} + // A class representing a full-frame pixel buffer class VideoFrameBuffer { public: @@ -79,6 +85,8 @@ class CapturerLinux : public Capturer { private: bool Init(); // TODO(ajwong): Do we really want this to be synchronous? + void InitXDamage(); + // Read and handle all currently-pending XEvents. // In the DAMAGE case, process the XDamage events and store the resulting // damage rectangles in the CapturerHelper. @@ -195,6 +203,17 @@ bool CapturerLinux::Init() { return false; } + if (ShouldUseXDamage()) { + InitXDamage(); + } + + // Register for changes to the dimensions of the root window. + XSelectInput(display_, root_window_, StructureNotifyMask); + + return true; +} + +void CapturerLinux::InitXDamage() { // Setup XDamage to report changes in the damage window. Mark the whole // window as invalid. if (XDamageQueryExtension(display_, &damage_event_base_, @@ -214,11 +233,6 @@ bool CapturerLinux::Init() { } else { LOG(INFO) << "Server does not support XDamage."; } - - // Register for changes to the dimensions of the root window. - XSelectInput(display_, root_window_, StructureNotifyMask); - - return true; } void CapturerLinux::ScreenConfigurationChanged() { |