<支持-gl-texture>
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
注意 :Google Play 会根据应用支持的纹理压缩格式对其进行过滤,以便应用仅安装在可正确处理其纹理的设备上。您可以将纹理压缩过滤用作定位特定设备类型(基于 GPU 平台)的一种方法。
有关 Google Play 如何将 <supports-gl-texture>
元素用作过滤基础的重要信息,请阅读 Google Play 和纹理压缩过滤部分。
- 语法:
-
<supports-gl-texture
android:name="string" />
- 包含于:
<manifest>
- 说明:
- 声明应用支持的一种 GL 纹理压缩格式。
应用安装在设备上后,如果能够提供以某种 GL 纹理压缩格式压缩的纹理资源,就说明应用“支持”这种格式。
应用可以在本地提供压缩的资源(从 APK 内),也可以在运行时从服务器下载压缩的资源。
每个 <supports-gl-texture>
元素只声明一种支持的纹理压缩格式,将其指定为 android:name
属性的值。如果您的应用支持多种纹理压缩格式,您可以声明多个 <supports-gl-texture>
元素:
<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<supports-gl-texture android:name="GL_OES_compressed_paletted_texture" />
<supports-gl-texture>
元素是信息性元素,这意味着,Android 系统本身不会在应用安装时检查这些元素以确保与设备上支持的内容匹配。
不过,其他服务(如 Google Play)或应用可以在处理您的应用或与您的应用交互过程中检查其 <supports-gl-texture>
声明。因此,请务必声明您的应用支持以下列表中的所有纹理压缩格式。
应用和设备通常使用下面一组为人熟知的字符串来声明它们支持的 GL 纹理压缩格式。这一组格式字符串可能会随着时间的推移按需增加。由于值是字符串,因此应用可根据需要随意声明其他格式。
假定应用是使用 SDK Platform Tools r3 或更高版本构建的,那么会针对所有 API 级别激活基于 <supports-gl-texture>
元素的过滤。
- 属性:
-
android:name
- 以描述符字符串的形式指定应用支持的一种 GL 纹理压缩格式。下表列出了常见的描述符值。
纹理压缩格式描述符 |
备注 |
GL_OES_compressed_ETC1_RGB8_texture |
Ericsson 纹理压缩。在 OpenGL ES 2.0 中指定,在所有支持 OpenGL ES 2.0 的 Android 设备上可用。 |
GL_OES_compressed_paletted_texture |
通用调色板纹理压缩。 |
GL_AMD_compressed_3DC_texture |
ATI 3Dc 纹理压缩。 |
GL_AMD_compressed_ATC_texture |
ATI 纹理压缩。在运行 Adreno GPU 的设备(包括 HTC Nexus One、Droid Incredible、EVO 及其他)上可用。为了实现最广泛的兼容性,设备还可以声明带有 GL_ATI_texture_compression_atitc 描述符的 <supports-gl-texture> 元素。 |
GL_EXT_texture_compression_latc |
亮度 Alpha 值纹理压缩。 |
GL_EXT_texture_compression_dxt1 |
S3 DXT1 纹理压缩。在运行 Nvidia Tegra2 平台的设备(包括 Motorala Xoom、Motorola Atrix、Droid Bionic 及其他)上受支持。 |
GL_EXT_texture_compression_s3tc |
S3 纹理压缩,不特定于 DXT 变体。在运行 Nvidia Tegra2 平台的设备(包括 Motorala Xoom、Motorola Atrix、Droid Bionic 及其他)上受支持。如果您的应用需要特定的 DXT 变体,请声明相应的描述符,而不是此描述符。 |
GL_IMG_texture_compression_pvrtc |
PowerVR 纹理压缩。在运行 PowerVR SGX530/540 GPU 的设备(如 Motorola DROID 系列、Samsung Galaxy S、Nexus S 和 Galaxy Tab 及其他)上可用。 |
- 另请参阅:
-
Google Play 和纹理压缩过滤
Google Play 会过滤那些对用户可见的应用,以便用户只能看到和下载与其设备兼容的应用。它过滤应用的一种方法是通过纹理压缩兼容性,让您能够根据设备上 GPU 的功能来控制您的应用对各种设备的可用性。
为了确定应用与给定用户设备的纹理压缩兼容性,Google Play 会将以下两者进行比较:
- 应用支持的纹理压缩格式,如其清单中的
<supports-gl-texture>
元素所声明的。
- 设备上的 GPU 支持的纹理压缩格式。设备会将其支持的格式作为只读系统属性进行报告。
每当您将应用上传到 Google Play 管理中心时,Google Play 都会扫描应用的清单文件并查找有无 <supports-gl-texture>
元素。它会从这些元素中提取格式描述符,并在内部将其存储为与应用 APK 和应用版本关联的元数据。
当用户在 Google Play 上搜索或浏览应用时,该服务会将应用支持的纹理压缩格式与用户设备支持的纹理压缩格式进行比较。这种比较基于格式描述符字符串,匹配必须是完全匹配。
如果应用支持的任何纹理压缩格式也受设备支持,则 Google Play 将允许用户看到该应用,用户也有可能下载该应用。如果应用支持的任何格式都不受设备支持,则 Google Play 会过滤掉该应用,以使其无法下载。
如果应用未声明任何 <supports-gl-texture>
元素,则 Google Play 不会应用任何基于 GL 纹理压缩格式的过滤。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# <supports-gl-texture\u003e\n\n**Note:**Google Play filters applications according\nto the texture compression formats that they support so that\nthey install only on devices that can handle their textures\nproperly. You can use texture compression filtering\nas a way of targeting specific device types based on the GPU platform.\n\nFor important information about how\nGoogle Play uses `\u003csupports-gl-texture\u003e` elements as\nthe basis for filtering, read the [Google\nPlay and texture compression filtering](#market-texture-filtering) section.\n\nsyntax:\n:\n\n ```xml\n \u003csupports-gl-texture\n android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\ndescription:\n\n: Declares a single GL texture compression format that the app supports. An application \"supports\" a GL texture compression format if it can\n provide texture assets compressed in that format when the application installs on a device.\n\n The application provides the\n compressed assets locally, from inside the APK, or it can download them\n from a server at runtime.\n\n Each `\u003csupports-gl-texture\u003e` element declares exactly one\n supported texture compression format, specified as the value of a\n `android:name` attribute. If your application supports multiple\n texture compression formats, you can declare multiple\n `\u003csupports-gl-texture\u003e` elements: \n\n ```xml\n \u003csupports-gl-texture android:name=\"GL_OES_compressed_ETC1_RGB8_texture\" /\u003e\n \u003csupports-gl-texture android:name=\"GL_OES_compressed_paletted_texture\" /\u003e\n ```\n\n `\u003csupports-gl-texture\u003e` elements are informational,\n meaning that the Android system itself does not examine the elements at install\n time to ensure matching support on the device.\n\n However, other services,\n such as Google Play, or applications can check your application's\n `\u003csupports-gl-texture\u003e` declarations as part of handling or\n interacting with your application. For this reason, it's very important that\n you declare all the texture compression formats from the following list that\n your application supports.\n\n Applications and devices typically declare their supported GL texture\n compression formats using the following set of well-known strings.\n The set of format strings might grow over time, as needed. Since the values\n are strings, applications are free to declare other formats as needed.\n\n Assuming that the application is built with SDK Platform Tools r3 or higher,\n filtering based on the `\u003csupports-gl-texture\u003e` element is activated\n for all API levels.\n\nattributes:\n:\n\n `android:name`\n : Specifies a single GL texture compression format supported by the application\n as a descriptor string. Common descriptor values are listed in the following table.\n\n | Texture compression format descriptor | Comments |\n |---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `GL_OES_compressed_ETC1_RGB8_texture` | Ericsson texture compression. Specified in OpenGL ES 2.0 and available in all Android-powered devices that support OpenGL ES 2.0. |\n | `GL_OES_compressed_paletted_texture` | Generic paletted texture compression. |\n | `GL_AMD_compressed_3DC_texture` | ATI 3Dc texture compression. |\n | `GL_AMD_compressed_ATC_texture` | ATI texture compression. Available on devices running Adreno GPU, including HTC Nexus One, Droid Incredible, EVO, and others. For widest compatibility, devices may also declare a `\u003csupports-gl-texture\u003e` element with the descriptor `GL_ATI_texture_compression_atitc`. |\n | `GL_EXT_texture_compression_latc` | Luminance alpha texture compression. |\n | `GL_EXT_texture_compression_dxt1` | S3 DXT1 texture compression. Supported on devices running the Nvidia Tegra2 platform, including Motorala Xoom, Motorola Atrix, Droid Bionic, and others. |\n | `GL_EXT_texture_compression_s3tc` | S3 texture compression, nonspecific to DXT variant. Supported on devices running the Nvidia Tegra2 platform, including Motorala Xoom, Motorola Atrix, Droid Bionic, and others. If your application requires a specific DXT variant, declare that descriptor instead of this one. |\n | `GL_IMG_texture_compression_pvrtc` | PowerVR texture compression. Available on devices running the PowerVR SGX530/540 GPU, such as Motorola DROID series; Samsung Galaxy S, Nexus S, and Galaxy Tab; and others. |\n\n\nsee also:\n:\n - [Filters on Google Play](/google/play/filters)"]]