diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 17:41:39 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-20 17:41:39 +0000 |
commit | c4eb2947a68a9ceb064f789ded6f06ce8a5b0497 (patch) | |
tree | 6eccf6da9f8557688cd9b6f0c2de860b81824d89 /content | |
parent | f746ee6b3e71c5688a1f774faa0602799c7118d6 (diff) | |
download | chromium_src-c4eb2947a68a9ceb064f789ded6f06ce8a5b0497.zip chromium_src-c4eb2947a68a9ceb064f789ded6f06ce8a5b0497.tar.gz chromium_src-c4eb2947a68a9ceb064f789ded6f06ce8a5b0497.tar.bz2 |
Move XID, XDisplay, GetXDisplay and a few other types to ui/gfx/x/x11_types.h
This is to break a dependency on ui/base from ui/compositor.
R=sky@chromium.org
TBR=sky@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/23460052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/aura/software_output_device_x11.cc | 2 | ||||
-rw-r--r-- | content/browser/aura/software_output_device_x11.h | 4 | ||||
-rw-r--r-- | content/browser/power_save_blocker_x11.cc | 3 | ||||
-rw-r--r-- | content/browser/renderer_host/backing_store_gtk.cc | 22 | ||||
-rw-r--r-- | content/browser/renderer_host/backing_store_gtk.h | 6 | ||||
-rw-r--r-- | content/browser/renderer_host/gtk_window_utils.cc | 5 | ||||
-rw-r--r-- | content/browser/renderer_host/web_input_event_aura_unittest.cc | 6 | ||||
-rw-r--r-- | content/plugin/webplugin_proxy.cc | 8 |
8 files changed, 29 insertions, 27 deletions
diff --git a/content/browser/aura/software_output_device_x11.cc b/content/browser/aura/software_output_device_x11.cc index 229755b..abdb116 100644 --- a/content/browser/aura/software_output_device_x11.cc +++ b/content/browser/aura/software_output_device_x11.cc @@ -16,7 +16,7 @@ namespace content { SoftwareOutputDeviceX11::SoftwareOutputDeviceX11(ui::Compositor* compositor) : compositor_(compositor), - display_(ui::GetXDisplay()), + display_(gfx::GetXDisplay()), gc_(NULL), image_(NULL) { // TODO(skaslev) Remove this when crbug.com/180702 is fixed. diff --git a/content/browser/aura/software_output_device_x11.h b/content/browser/aura/software_output_device_x11.h index 986a486..782afee 100644 --- a/content/browser/aura/software_output_device_x11.h +++ b/content/browser/aura/software_output_device_x11.h @@ -6,7 +6,7 @@ #define CONTENT_BROWSER_AURA_SOFTWARE_OUTPUT_DEVICE_X11_H_ #include "cc/output/software_output_device.h" -#include "ui/base/x/x11_util.h" +#include "ui/gfx/x/x11_types.h" namespace ui { class Compositor; @@ -28,7 +28,7 @@ class SoftwareOutputDeviceX11 : public cc::SoftwareOutputDevice { void ClearImage(); ui::Compositor* compositor_; - Display* display_; + XDisplay* display_; GC gc_; XImage* image_; }; diff --git a/content/browser/power_save_blocker_x11.cc b/content/browser/power_save_blocker_x11.cc index 624e222..f55fac9 100644 --- a/content/browser/power_save_blocker_x11.cc +++ b/content/browser/power_save_blocker_x11.cc @@ -29,6 +29,7 @@ #include "dbus/message.h" #include "dbus/object_path.h" #include "dbus/object_proxy.h" +#include "ui/gfx/x/x11_types.h" #if defined(TOOLKIT_GTK) #include "base/message_loop/message_pump_gtk.h" @@ -298,7 +299,7 @@ void PowerSaveBlockerImpl::Delegate::RemoveBlock(DBusAPI api) { // static bool PowerSaveBlockerImpl::Delegate::DPMSEnabled() { - Display* display = base::MessagePumpForUI::GetDefaultXDisplay(); + XDisplay* display = base::MessagePumpForUI::GetDefaultXDisplay(); BOOL enabled = false; int dummy; if (DPMSQueryExtension(display, &dummy, &dummy) && DPMSCapable(display)) { diff --git a/content/browser/renderer_host/backing_store_gtk.cc b/content/browser/renderer_host/backing_store_gtk.cc index 62365be..2eed33a 100644 --- a/content/browser/renderer_host/backing_store_gtk.cc +++ b/content/browser/renderer_host/backing_store_gtk.cc @@ -29,10 +29,10 @@ #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/gtk/gtk_signal.h" -#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util_internal.h" #include "ui/gfx/rect.h" #include "ui/gfx/rect_conversions.h" +#include "ui/gfx/x/x11_types.h" #include "ui/surface/transport_dib.h" namespace content { @@ -59,7 +59,7 @@ static const int kMaxVideoLayerSize = 23170; // Destroys the image and the associated shared memory structures. This is a // helper function for code using shared memory. -void DestroySharedImage(Display* display, +void DestroySharedImage(XDisplay* display, XImage* image, XShmSegmentInfo* shminfo) { XShmDetach(display, shminfo); @@ -72,7 +72,7 @@ void DestroySharedImage(Display* display, // XSyncExtension to push a callback into the X11 event queue and get a // callback instead of blocking until the event queue is cleared. // -// TODO(erg): If ui::GetXDisplay() ever gets fixed to handle multiple Displays, +// TODO(erg): If gfx::GetXDisplay() ever gets fixed to handle multiple Displays, // this must be modified to be per Display instead of a Singleton. class XSyncHandler { public: @@ -85,7 +85,7 @@ class XSyncHandler { } void PushPaintCounter(TransportDIB* dib, - Display* display, + XDisplay* display, Picture picture, Pixmap pixmap, const base::Closure& completion_callback); @@ -96,7 +96,7 @@ class XSyncHandler { // A struct that has cleanup and callback tasks that were queued into the // future and are run on |g_backing_store_sync_alarm| firing. struct BackingStoreEvents { - BackingStoreEvents(TransportDIB* dib, Display* d, Picture pic, Pixmap pix, + BackingStoreEvents(TransportDIB* dib, XDisplay* d, Picture pic, Pixmap pix, const base::Closure& c) : dib(dib), display(d), @@ -109,7 +109,7 @@ class XSyncHandler { TransportDIB* dib; // The display we're running on. - Display* display; + XDisplay* display; // Data to delete. Picture picture; @@ -142,7 +142,7 @@ class XSyncHandler { }; void XSyncHandler::PushPaintCounter(TransportDIB* dib, - Display* display, + XDisplay* display, Picture picture, Pixmap pixmap, const base::Closure& completion_callback) { @@ -153,7 +153,7 @@ void XSyncHandler::PushPaintCounter(TransportDIB* dib, // alarm when it is processed. XSyncValue value; XSyncIntToValue(&value, 1); - XSyncChangeCounter(ui::GetXDisplay(), + XSyncChangeCounter(gfx::GetXDisplay(), backing_store_sync_counter_, value); } @@ -164,7 +164,7 @@ XSyncHandler::XSyncHandler() xsync_error_base_(0), backing_store_sync_counter_(0), backing_store_sync_alarm_(0) { - Display* display = ui::GetXDisplay(); + XDisplay* display = gfx::GetXDisplay(); if (XSyncQueryExtension(display, &xsync_event_base_, &xsync_error_base_)) { @@ -191,7 +191,7 @@ XSyncHandler::~XSyncHandler() { if (loaded_extension_) gdk_window_remove_filter(NULL, &OnEventThunk, this); - XSync(ui::GetXDisplay(), False); + XSync(gfx::GetXDisplay(), False); while (!backing_store_events_.empty()) { // We delete the X11 resources we're holding onto. We don't run the // callbacks because we are shutting down. @@ -248,7 +248,7 @@ BackingStoreGtk::BackingStoreGtk(RenderWidgetHost* widget, void* visual, int depth) : BackingStore(widget, size), - display_(ui::GetXDisplay()), + display_(gfx::GetXDisplay()), shared_memory_support_(ui::QuerySharedMemorySupport(display_)), use_render_(ui::QueryRenderSupport(display_)), visual_(visual), diff --git a/content/browser/renderer_host/backing_store_gtk.h b/content/browser/renderer_host/backing_store_gtk.h index 0e81597..29776fc 100644 --- a/content/browser/renderer_host/backing_store_gtk.h +++ b/content/browser/renderer_host/backing_store_gtk.h @@ -12,7 +12,7 @@ #include "build/build_config.h" #include "content/browser/renderer_host/backing_store.h" #include "content/common/content_export.h" -#include "ui/base/x/x11_util.h" +#include "ui/gfx/x/x11_types.h" namespace gfx { class Point; @@ -39,7 +39,7 @@ class CONTENT_EXPORT BackingStoreGtk : public BackingStore { virtual ~BackingStoreGtk(); - Display* display() const { return display_; } + XDisplay* display() const { return display_; } XID root_window() const { return root_window_; } // Copy from the server-side backing store to the target window @@ -79,7 +79,7 @@ class CONTENT_EXPORT BackingStoreGtk : public BackingStore { // This is the connection to the X server where this backing store will be // displayed. - Display* const display_; + XDisplay* const display_; // What flavor, if any, MIT-SHM (X shared memory) support we have. const ui::SharedMemorySupport shared_memory_support_; // If this is true, then we can use Xrender to composite our pixmaps. diff --git a/content/browser/renderer_host/gtk_window_utils.cc b/content/browser/renderer_host/gtk_window_utils.cc index 28f8460..f05cdca 100644 --- a/content/browser/renderer_host/gtk_window_utils.cc +++ b/content/browser/renderer_host/gtk_window_utils.cc @@ -10,10 +10,11 @@ #include <vector> +#include "third_party/WebKit/public/web/WebScreenInfo.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/gtk_compat.h" #include "ui/gfx/rect.h" -#include "third_party/WebKit/public/web/WebScreenInfo.h" +#include "ui/gfx/x/x11_types.h" namespace content { @@ -44,7 +45,7 @@ gfx::Rect GetWorkArea(Window window) { property[start_index + 2], property[start_index + 3]); } -WebKit::WebScreenInfo GetScreenInfo(Display* display, int screenNumber) { +WebKit::WebScreenInfo GetScreenInfo(XDisplay* display, int screenNumber) { // XDisplayWidth() and XDisplayHeight() return cached values. To ensure that // we return the correct dimensions after the screen is resized, query the // root window's geometry each time. diff --git a/content/browser/renderer_host/web_input_event_aura_unittest.cc b/content/browser/renderer_host/web_input_event_aura_unittest.cc index 47a62be..b9ccaa7 100644 --- a/content/browser/renderer_host/web_input_event_aura_unittest.cc +++ b/content/browser/renderer_host/web_input_event_aura_unittest.cc @@ -11,7 +11,7 @@ #if defined(USE_X11) #include <X11/keysym.h> #include <X11/Xlib.h> -#include "ui/base/x/x11_util.h" +#include "ui/gfx/x/x11_types.h" #endif namespace content { @@ -56,7 +56,7 @@ TEST(WebInputEventAuraTest, TestMakeWebKeyboardEventWindowsKeyCode) { ui::VKEY_CONTROL, 0, // X does not set ControlMask for KeyPress. &xev); - xev.xkey.keycode = XKeysymToKeycode(ui::GetXDisplay(), XK_Control_L); + xev.xkey.keycode = XKeysymToKeycode(gfx::GetXDisplay(), XK_Control_L); ui::KeyEvent event(&xev, false /* is_char */); WebKit::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(&event); // ui::VKEY_LCONTROL, instead of ui::VKEY_CONTROL, should be filled. @@ -68,7 +68,7 @@ TEST(WebInputEventAuraTest, TestMakeWebKeyboardEventWindowsKeyCode) { ui::VKEY_CONTROL, 0, // X does not set ControlMask for KeyPress. &xev); - xev.xkey.keycode = XKeysymToKeycode(ui::GetXDisplay(), XK_Control_R); + xev.xkey.keycode = XKeysymToKeycode(gfx::GetXDisplay(), XK_Control_R); ui::KeyEvent event(&xev, false /* is_char */); WebKit::WebKeyboardEvent webkit_event = MakeWebKeyboardEvent(&event); // ui::VKEY_RCONTROL, instead of ui::VKEY_CONTROL, should be filled. diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 92edf70..ecdab98 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -75,7 +75,7 @@ WebPluginProxy::WebPluginProxy( // If the X server supports SHM pixmaps // and the color depth and masks match, // then consider using SHM pixmaps for windowless plugin painting. - Display* display = ui::GetXDisplay(); + XDisplay* display = gfx::GetXDisplay(); if (ui::QuerySharedMemorySupport(display) == ui::SHARED_MEMORY_PIXMAP && ui::BitsPerPixelForPixmapDepth( display, DefaultDepth(display, DefaultScreen(display))) == 32) { @@ -92,9 +92,9 @@ WebPluginProxy::WebPluginProxy( WebPluginProxy::~WebPluginProxy() { #if defined(USE_X11) if (windowless_shm_pixmaps_[0] != None) - XFreePixmap(ui::GetXDisplay(), windowless_shm_pixmaps_[0]); + XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[0]); if (windowless_shm_pixmaps_[1] != None) - XFreePixmap(ui::GetXDisplay(), windowless_shm_pixmaps_[1]); + XFreePixmap(gfx::GetXDisplay(), windowless_shm_pixmaps_[1]); #endif #if defined(OS_MACOSX) @@ -557,7 +557,7 @@ void WebPluginProxy::CreateShmPixmapFromDIB( const gfx::Rect& window_rect, XID* pixmap_out) { if (dib) { - Display* display = ui::GetXDisplay(); + XDisplay* display = gfx::GetXDisplay(); XID root_window = ui::GetX11RootWindow(); XShmSegmentInfo shminfo = {0}; |