+static void createDrawable(unsigned long long orig_config, unsigned long long orig_surface)
+{
+ ProfileMap::iterator it = profile_map.find(orig_config);
+ glws::Profile profile;
+
+ // If the requested config is associated with a profile, use that
+ // profile. Otherwise, assume that the last used profile is what
+ // the user wants.
+ if (it != profile_map.end()) {
+ profile = it->second;
+ } else {
+ profile = last_profile;
+ }
+
+ glws::Visual *visual = glretrace::visual[profile];
+
+ glws::Drawable *drawable = glws::createDrawable(visual);
+ drawable_map[orig_surface] = drawable;
+}
+