Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: ui/surface/transport_dib_sysvipc.cc

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/surface/transport_dib_sysvipc.cc
diff --git a/ui/surface/transport_dib_sysvipc.cc b/ui/surface/transport_dib_sysvipc.cc
index a15ca414bbc9b1b8c8aed89bf6884e62ffe979a7..75a5c45f4b65d7d159fbca0e0920849eff1005c5 100644
--- a/ui/surface/transport_dib_sysvipc.cc
+++ b/ui/surface/transport_dib_sysvipc.cc
@@ -6,7 +6,7 @@
// Desktop GTK Linux builds use the old-style SYSV SHM based DIBs.
// Linux Aura and Chrome OS do too. This will change very soon.
-#if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && defined(USE_AURA))
+#if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && defined(USE_AURA) && defined(USE_X11))
DaveMoore 2013/04/30 17:53:42 This file now has a lot of #ifdefs. We might be be
#include <errno.h>
#include <stdlib.h>
@@ -16,16 +16,21 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "skia/ext/platform_canvas.h"
-#include "ui/base/x/x11_util.h"
#include "ui/gfx/size.h"
+#if defined(USE_X11)
+#include "ui/base/x/x11_util.h"
+#endif
+
// The shmat system call uses this as it's invalid return address
static void *const kInvalidAddress = (void*) -1;
TransportDIB::TransportDIB()
: address_(kInvalidAddress),
+#if defined(USE_X11)
x_shm_(0),
display_(NULL),
+#endif
inflight_counter_(0),
detached_(false),
size_(0) {
@@ -37,10 +42,12 @@ TransportDIB::~TransportDIB() {
address_ = kInvalidAddress;
}
+#if defined(USE_X11)
if (x_shm_) {
DCHECK(display_);
ui::DetachSharedMemory(display_, x_shm_);
}
+#endif
}
// static
@@ -135,6 +142,7 @@ TransportDIB::Handle TransportDIB::handle() const {
return key_.shmkey;
}
+#if defined(USE_X11)
XID TransportDIB::MapToX(Display* display) {
if (!x_shm_) {
x_shm_ = ui::AttachSharedMemory(display, key_.shmkey);
@@ -143,6 +151,7 @@ XID TransportDIB::MapToX(Display* display) {
return x_shm_;
}
+#endif
void TransportDIB::DecreaseInFlightCounter() {
CHECK(inflight_counter_);
« ui/gl/gl_surface_egl.cc ('K') | « ui/gl/gl_surface_nsl.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698