OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_ | 5 #ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_ |
6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_ | 6 #define UI_BASE_X_X11_UTIL_INTERNAL_H_ |
7 | 7 |
8 // This file declares utility functions for X11 (Linux only). | 8 // This file declares utility functions for X11 (Linux only). |
9 // | 9 // |
10 // These functions require the inclusion of the Xlib headers. Since the Xlib | 10 // These functions require the inclusion of the Xlib headers. Since the Xlib |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 const XErrorEvent& error_event); | 56 const XErrorEvent& error_event); |
57 | 57 |
58 // -------------------------------------------------------------------------- | 58 // -------------------------------------------------------------------------- |
59 // Selects a visual with a preference for alpha support on compositing window | 59 // Selects a visual with a preference for alpha support on compositing window |
60 // managers. | 60 // managers. |
61 #if !defined(OS_CHROMEOS) | 61 #if !defined(OS_CHROMEOS) |
62 class UI_BASE_X_EXPORT XVisualManager { | 62 class UI_BASE_X_EXPORT XVisualManager { |
63 public: | 63 public: |
64 static XVisualManager* GetInstance(); | 64 static XVisualManager* GetInstance(); |
65 | 65 |
| 66 // Picks the best argb or opaque visual given |want_argb_visual|. If the |
| 67 // default visual is returned, |colormap| is set to CopyFromParent. |
66 void ChooseVisualForWindow(bool want_argb_visual, | 68 void ChooseVisualForWindow(bool want_argb_visual, |
67 Visual** visual, | 69 Visual** visual, |
68 int* depth, | 70 int* depth, |
69 Colormap* colormap, | 71 Colormap* colormap, |
70 bool* using_argb_visual); | 72 bool* using_argb_visual); |
71 | 73 |
72 // Called by GpuDataManagerImplPrivate when GPUInfo becomes available. It is | 74 // Called by GpuDataManagerImplPrivate when GPUInfo becomes available. It is |
73 // necessary for the GPU process to find out which visuals are best for GL | 75 // necessary for the GPU process to find out which visuals are best for GL |
74 // because we don't want to load GL in the browser process. Returns false iff | 76 // because we don't want to load GL in the browser process. Returns false iff |
75 // |default_visual_id| or |transparent_visual_id| are invalid. | 77 // |default_visual_id| or |transparent_visual_id| are invalid. |
(...skipping 18 matching lines...) Expand all Loading... |
94 private: | 96 private: |
95 Colormap colormap_; | 97 Colormap colormap_; |
96 }; | 98 }; |
97 | 99 |
98 XVisualManager(); | 100 XVisualManager(); |
99 | 101 |
100 std::unordered_map<VisualID, std::unique_ptr<XVisualData>> visuals_; | 102 std::unordered_map<VisualID, std::unique_ptr<XVisualData>> visuals_; |
101 | 103 |
102 XDisplay* display_; | 104 XDisplay* display_; |
103 | 105 |
| 106 VisualID default_visual_id_; |
| 107 |
| 108 // The system visual is usually the same as the default visual, but |
| 109 // may not be in general. |
104 VisualID system_visual_id_; | 110 VisualID system_visual_id_; |
105 VisualID transparent_visual_id_; | 111 VisualID transparent_visual_id_; |
106 | 112 |
107 bool using_compositing_wm_; | 113 bool using_compositing_wm_; |
108 bool using_software_rendering_; | 114 bool using_software_rendering_; |
109 bool have_gpu_argb_visual_; | 115 bool have_gpu_argb_visual_; |
110 | 116 |
111 DISALLOW_COPY_AND_ASSIGN(XVisualManager); | 117 DISALLOW_COPY_AND_ASSIGN(XVisualManager); |
112 }; | 118 }; |
113 #endif | 119 #endif |
114 | 120 |
115 } // namespace ui | 121 } // namespace ui |
116 | 122 |
117 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ | 123 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ |
OLD | NEW |