How igalia/wolvic works
Main components
• Browser Engine Layer – This includes integrations with GeckoView (and, optionally, a locally built GeckoView via dependency substitutions) as well as Chromium (if needed, as referenced by CHROMIUM.md). This layer is responsible for rendering web content and supporting WebXR.
• Native & C++ Rendering Layer – Found in directories like “app/src/main/cpp”, “app/src/openxr/cpp”, “app/src/visionglass/cpp” and others. These modules include VR rendering, shader management, native asset compression, and other low-level graphics / input functionalities.
• Platform-Specific Adapter Modules – Several subdirectories (oculusvr, hvr, picoxr, spaces, lynx, noapi, visionglass, etc.) contain code tailored to individual device SDKs. They provide implementations for activities (often with classes like PlatformActivity.java) that bind the common browser logic to specific hardware and SDK features.
• Shared and Common Code – The “app/src/common” directory holds cross-cutting logic such as shared browser APIs, UI components, crash reporting, telemetry, gesture handling, input adapters, database management, and utility functions.
• UI/Themed Layer – Within “app/src/common/shared” (and also inside “app/src/main/res” and similar resource folders) you find the UI definitions, view models, view adapters, and resource assets (layouts, drawables, and localization files) that define the browser’s look and feel on various form factors.
• Build and Dependency Components – The numerous gradle configuration files, CMakeLists.txt, and third-party directories (such as “third_party”) support dependency substitutions, multi-module building (for different target devices), and integration with external SDKs for VR.
• Asset and Compression Tools – The “tools/compressor” utility (with its npm scripts) is responsible for generating optimized textures (using ETC2 compression) and other assets.
• Testing and Development Interfaces – There are directories dedicated to tests (“app/src/test”), example artifacts (instrumented tests, etc.), and configuration files for continuous integration (inside .github/workflows).
Relationships and interactions
• The UI Layer and shared browser logic communicate with the native rendering modules, which are implemented as C/C++ libraries built with CMake.
• The platform-specific “app/src/[device-specific-name]” modules define how the common UI and browser logic are integrated with specific device SDKs. They typically rely on a common interface (such as PlatformActivity) to initialize the browser runtime.
• Browser engines (GeckoView/Chromium) serve as a subcomponent that receives input from the native layer and returns rendered web content. Dependency substitution (controlled via settings in local.properties) ensures the correct engine version is in use.
• The shared modules in “common” ensure consistency in areas like telemetry, error handling (crash reporting), and data repositories which are used by various device-specific implementations.
Architectural patterns and design principles
• Modularity – The project is split into multiple subprojects and modules (by device type, common code, native code, UI, testing, etc.), which is evident from the folder structure. This loosely coupled design simplifies targeted enhancements (e.g., supporting a new VR device).
• Separation of concerns – There is a clear separation between native code (C++ modules), Java/Kotlin UI and platform layer, and shared business logic (browser APIs, telemetry, etc.). This separation is maintained by the distinct directories.
• Cross-platform Abstraction – Common shared code handles core functionalities across all platforms while each platform-specific directory adapts this shared functionality to the specific requirements/SDKs of that device.
• Gradle-based Dependency Management – The use of Gradle with dependency substitutions (for example, with GeckoView) and multi-module builds reinforces a configuration-driven architecture.
Specific Elements
• Clear labels for each major module:
• “Core Browser Engine” (GeckoView/Chromium),
• “Native Rendering and VR Input” (C++ modules, shaders, etc.),
• “UI & Shared Services” (common code, view models, telemetry, etc.),
• “Platform-Specific Adapters” (oculusvr, hvr, picoxr, etc.),
• “Asset Management & Compression Tools”,
• “Build/Dependency Management” (Gradle, CMake, etc.).
• For example, from the “Platform-Specific Adapter” to the “UI Layer” and “Browser Engine”.
• Annotations or notes indicating build choices (such as dependency substitution for GeckoView) and configuration flags (static version codes and signing options).