android_manifest/supports_gl_texture.rs
1use serde::{Deserialize, Serialize};
2
3/// Declares a single GL texture compression format that the app supports.
4///
5/// An application "supports" a GL texture compression format if it is capable of
6/// providing texture assets that are compressed in that format, once the application is
7/// installed on a device. The application can provide the compressed assets locally, from
8/// inside the .apk, or it can download them from a server at runtime.
9///
10/// Each `<supports-gl-texture>` element declares exactly one supported texture
11/// compression format, specified as the value of a `android:name` attribute. If your
12/// application supports multiple texture compression formats, you can declare multiple
13/// `<supports-gl-texture>` elements.
14///
15/// ## XML Example
16/// ```xml
17/// <supports-gl-texture
18/// android:name="GL_OES_compressed_ETC1_RGB8_texture" />
19/// <supports-gl-texture
20/// android:name="GL_OES_compressed_paletted_texture" />
21/// ```
22///
23/// Declared <supports-gl-texture> elements are informational, meaning that the Android
24/// system itself does not examine the elements at install time to ensure matching support
25/// on the device. However, other services (such as Google Play) or applications can check
26/// your application's <supports-gl-texture> declarations as part of handling or
27/// interacting with your application. For this reason, it's very important that you
28/// declare all of the texture compression formats (from the list below) that your
29/// application is capable of supporting.
30///
31/// Applications and devices typically declare their supported GL texture compression
32/// formats using the same set of well-known strings, as listed below. The set of format
33/// strings may grow over time, as needed, and since the values are strings, applications
34/// are free to declare other formats as needed.
35///
36/// Assuming that the application is built with SDK Platform Tools r3 or higher, filtering
37/// based on the `<supports-gl-texture>` element is activated for all API levels.
38///
39/// ## Note
40/// Google Play filters applications according to the texture compression formats that
41/// they support, to ensure that they can be installed only on devices that can handle
42/// their textures properly. You can use texture compression filtering as a way of
43/// targeting specific device types, based on GPU platform.
44///
45/// For important information about how Google Play uses `<supports-gl-texture>`
46/// elements as the basis for filtering, read [`Google Play and texture compression
47/// filtering`], below.
48///
49/// ## XML Syntax
50/// ```xml
51/// <supports-gl-texture
52/// android:name="string" />
53/// ```
54///
55/// ## Contained in
56/// * [`<manifest>`]
57///
58/// [`Google Play and texture compression filtering`]: https://developer.android.com/guide/topics/manifest/supports-gl-texture-element#market-texture-filtering
59/// [`<manifest>`]: crate::AndroidManifest
60#[derive(
61 Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Default, Clone,
62)]
63pub struct SupportsGlTexture {
64 /// Specifies a single GL texture compression format supported by the application, as
65 /// a descriptor string. Common descriptor values are listed in the table below.
66 /// `GL_OES_compressed_ETC1_RGB8_texture` Ericsson texture compression. Specified
67 /// in OpenGL ES 2.0 and available in all Android-powered devices that support
68 /// OpenGL ES 2.0. `GL_OES_compressed_paletted_texture` Generic paletted texture
69 /// compression. `GL_AMD_compressed_3DC_texture` ATI 3Dc texture
70 /// compression. `GL_AMD_compressed_ATC_texture` ATI texture
71 /// compression. Available on devices running Adreno GPU, including HTC
72 /// Nexus One, Droid Incredible, EVO, and others. For widest
73 /// compatibility, devices may also declare a <supports-gl-texture> element
74 /// with the descriptor GL_ATI_texture_compression_atitc.
75 /// `GL_EXT_texture_compression_latc` Luminance alpha texture compression.
76 /// `GL_EXT_texture_compression_dxt1` S3 DXT1 texture compression. Supported
77 /// on devices running Nvidia Tegra2 platform, including Motorala Xoom,
78 /// Motorola Atrix, Droid Bionic, and others.
79 /// `GL_EXT_texture_compression_s3tc` S3 texture compression, nonspecific to
80 /// DXT variant. Supported on devices running Nvidia Tegra2 platform,
81 /// including Motorala Xoom, Motorola Atrix, Droid Bionic, and others.
82 /// If your application requires a specific DXT variant, declare that
83 /// descriptor instead of this one. `GL_IMG_texture_compression_pvrtc`
84 /// PowerVR texture compression. Available in devices running PowerVR
85 /// SGX530/540 GPU, such as Motorola DROID series; Samsung Galaxy S, Nexus
86 /// S, and Galaxy Tab; and others.
87 #[yaserde(attribute, prefix = "android")]
88 pub name: Option<SupportsGlTextureName>,
89}
90
91#[derive(Debug, Deserialize, Serialize, YaSerialize, YaDeserialize, PartialEq, Eq, Clone)]
92#[allow(non_camel_case_types)]
93#[derive(Default)]
94pub enum SupportsGlTextureName {
95 /// Ericsson texture compression. Specified in OpenGL ES 2.0 and available in all
96 /// Android-powered devices that support OpenGL ES 2.0.
97 #[default]
98 GL_OES_compressed_ETC1_RGB8_texture,
99 /// Generic paletted texture compression.
100 GL_OES_compressed_paletted_texture,
101 /// ATI 3Dc texture compression
102 GL_AMD_compressed_3DC_texture,
103 /// ATI texture compression. Available on devices running Adreno GPU, including HTC
104 /// Nexus One, Droid Incredible, EVO, and others. For widest compatibility,
105 /// devices may also declare a `<supports-gl-texture>` element with the descriptor
106 /// `GL_ATI_texture_compression_atitc`.
107 GL_AMD_compressed_ATC_texture,
108 /// Luminance alpha texture compression.
109 GL_EXT_texture_compression_latc,
110 /// S3 DXT1 texture compression. Supported on devices running Nvidia Tegra2 platform,
111 /// including Motorala Xoom, Motorola Atrix, Droid Bionic, and others.
112 GL_EXT_texture_compression_dxt1,
113 /// S3 texture compression, nonspecific to DXT variant. Supported on devices running
114 /// Nvidia Tegra2 platform, including Motorala Xoom, Motorola Atrix, Droid Bionic,
115 /// and others If your application requires a specific DXT variant, declare that
116 /// descriptor instead of this one.
117 GL_EXT_texture_compression_s3tc,
118 /// PowerVR texture compression. Available in devices running PowerVR SGX530/540 GPU,
119 /// such as Motorola DROID series; Samsung Galaxy S, Nexus S, and Galaxy Tab; and
120 /// others.
121 GL_IMG_texture_compression_pvrtc,
122}