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

Side by Side Diff: ui/base/x/x11_util_internal.h

Issue 2471073002: X11: Use CopyFromParent colormap when possible (Reland) (Closed)
Patch Set: Fix segfault in Angle Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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, |visual|, |depth|, and |colormap| are all set
68 // to CopyFromParent.
66 void ChooseVisualForWindow(bool want_argb_visual, 69 void ChooseVisualForWindow(bool want_argb_visual,
67 Visual** visual, 70 Visual** visual,
68 int* depth, 71 int* depth,
69 Colormap* colormap, 72 Colormap* colormap,
70 bool* using_argb_visual); 73 bool* using_argb_visual);
71 74
72 // Called by GpuDataManagerImplPrivate when GPUInfo becomes available. It is 75 // Called by GpuDataManagerImplPrivate when GPUInfo becomes available. It is
73 // necessary for the GPU process to find out which visuals are best for GL 76 // 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 77 // 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. 78 // |default_visual_id| or |transparent_visual_id| are invalid.
(...skipping 18 matching lines...) Expand all
94 private: 97 private:
95 Colormap colormap_; 98 Colormap colormap_;
96 }; 99 };
97 100
98 XVisualManager(); 101 XVisualManager();
99 102
100 std::unordered_map<VisualID, std::unique_ptr<XVisualData>> visuals_; 103 std::unordered_map<VisualID, std::unique_ptr<XVisualData>> visuals_;
101 104
102 XDisplay* display_; 105 XDisplay* display_;
103 106
107 VisualID default_visual_id_;
108
109 // The system visual is usually the same as the default visual, but
110 // may not be in general.
104 VisualID system_visual_id_; 111 VisualID system_visual_id_;
105 VisualID transparent_visual_id_; 112 VisualID transparent_visual_id_;
106 113
107 bool using_compositing_wm_; 114 bool using_compositing_wm_;
108 bool using_software_rendering_; 115 bool using_software_rendering_;
109 bool have_gpu_argb_visual_; 116 bool have_gpu_argb_visual_;
110 117
111 DISALLOW_COPY_AND_ASSIGN(XVisualManager); 118 DISALLOW_COPY_AND_ASSIGN(XVisualManager);
112 }; 119 };
113 #endif 120 #endif
114 121
115 } // namespace ui 122 } // namespace ui
116 123
117 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ 124 #endif // UI_BASE_X_X11_UTIL_INTERNAL_H_
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gl/gl_surface_egl.cc » ('j') | ui/gl/gl_surface_egl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698