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

Unified Diff: ui/ozone/generate_ozone_platform_list.py

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/generate_ozone_platform_list.py
diff --git a/ui/ozone/generate_ozone_platform_list.py b/ui/ozone/generate_ozone_platform_list.py
index df85a1eab92c136eb5d714d5968c14f53d5c1284..2473dce202f0bf23e24e01259b531cc85d461f3a 100755
--- a/ui/ozone/generate_ozone_platform_list.py
+++ b/ui/ozone/generate_ozone_platform_list.py
@@ -15,12 +15,18 @@ Example Output: ./generate_ozone_platform_list.py --default wayland dri wayland
namespace ui {
- OzonePlatform* CreateOzonePlatformDri();
- OzonePlatform* CreateOzonePlatformWayland();
+ OzonePlatform* CreateOzonePlatformDriForUI();
+ OzonePlatform* CreateOzonePlatformDriForGPU();
+ OzonePlatform* CreateOzonePlatformWaylandForUI();
+ OzonePlatform* CreateOzonePlatformWaylandForGPU();
const OzonePlatformListEntry kOzonePlatforms[] = {
- { "wayland", &CreateOzonePlatformWayland },
- { "dri", &CreateOzonePlatformDri },
+ { "wayland",
+ &CreateOzonePlatformWaylandForUI,
+ &CreateOzonePlatformWaylandForGPU },
+ { "dri",
+ &CreateOzonePlatformDriForUI,
+ &CreateOzonePlatformDriForGPU },
};
const int kOzonePlatformCount = 2;
@@ -56,13 +62,17 @@ def GeneratePlatformList(out, platforms):
# Prototypes for platform initializers.
for platform in platforms:
- out.write('OzonePlatform* %s();\n' % GetConstructorName(platform))
+ ctor = GetConstructorName(platform)
+ out.write('OzonePlatform* %sForUI();\nOzonePlatform* %sForGPU();\n' % \
+ (ctor, ctor))
out.write('\n')
# List of platform names and initializers.
out.write('const OzonePlatformListEntry kOzonePlatforms[] = {\n')
for platform in platforms:
- out.write(' { "%s", &%s },\n' % (platform, GetConstructorName(platform)))
+ ctor = GetConstructorName(platform)
+ out.write(' { "%s", &%sForUI, &%sForGPU },\n' % \
+ (platform, ctor, ctor))
out.write('};\n')
out.write('\n')

Powered by Google App Engine
This is Rietveld 408576698