| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
| 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
| 7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
| 8 | 8 |
| 9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
| 10 | 10 |
| (...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 return base::Singleton<XVisualManager>::get(); | 1376 return base::Singleton<XVisualManager>::get(); |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 XVisualManager::XVisualManager() | 1379 XVisualManager::XVisualManager() |
| 1380 : display_(gfx::GetXDisplay()), | 1380 : display_(gfx::GetXDisplay()), |
| 1381 default_visual_id_(0), | 1381 default_visual_id_(0), |
| 1382 system_visual_id_(0), | 1382 system_visual_id_(0), |
| 1383 transparent_visual_id_(0), | 1383 transparent_visual_id_(0), |
| 1384 using_software_rendering_(false), | 1384 using_software_rendering_(false), |
| 1385 have_gpu_argb_visual_(false) { | 1385 have_gpu_argb_visual_(false) { |
| 1386 int visuals_len; | 1386 int visuals_len = 0; |
| 1387 XVisualInfo visual_template; | 1387 XVisualInfo visual_template; |
| 1388 visual_template.screen = DefaultScreen(display_); | 1388 visual_template.screen = DefaultScreen(display_); |
| 1389 gfx::XScopedPtr<XVisualInfo[]> visual_list(XGetVisualInfo( | 1389 gfx::XScopedPtr<XVisualInfo[]> visual_list(XGetVisualInfo( |
| 1390 display_, VisualScreenMask, &visual_template, &visuals_len)); | 1390 display_, VisualScreenMask, &visual_template, &visuals_len)); |
| 1391 for (int i = 0; i < visuals_len; ++i) | 1391 for (int i = 0; i < visuals_len; ++i) |
| 1392 visuals_[visual_list[i].visualid].reset(new XVisualData(visual_list[i])); | 1392 visuals_[visual_list[i].visualid].reset(new XVisualData(visual_list[i])); |
| 1393 | 1393 |
| 1394 XAtom NET_WM_CM_S0 = XInternAtom(display_, "_NET_WM_CM_S0", False); | 1394 XAtom NET_WM_CM_S0 = XInternAtom(display_, "_NET_WM_CM_S0", False); |
| 1395 using_compositing_wm_ = XGetSelectionOwner(display_, NET_WM_CM_S0) != None; | 1395 using_compositing_wm_ = XGetSelectionOwner(display_, NET_WM_CM_S0) != None; |
| 1396 | 1396 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 visual_info.visual, AllocNone); | 1481 visual_info.visual, AllocNone); |
| 1482 } | 1482 } |
| 1483 return colormap_; | 1483 return colormap_; |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 // ---------------------------------------------------------------------------- | 1486 // ---------------------------------------------------------------------------- |
| 1487 // End of x11_util_internal.h | 1487 // End of x11_util_internal.h |
| 1488 | 1488 |
| 1489 | 1489 |
| 1490 } // namespace ui | 1490 } // namespace ui |
| OLD | NEW |