use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.
the class DeviceSpecUtilsTest method getDeviceSupportedTextureCompressionFormats.
@Test
public void getDeviceSupportedTextureCompressionFormats() {
DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(/* values= */
ImmutableSet.of(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC), /* alternatives= */
ImmutableSet.of())).build();
assertThat(DeviceSpecUtils.getDeviceSupportedTextureCompressionFormats(deviceSpec)).containsExactly(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC);
}
use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.
the class DeviceSpecUtilsTest method deviceSpecFromTargetingBuilder_setDeviceTier.
@Test
public void deviceSpecFromTargetingBuilder_setDeviceTier() {
DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setDeviceTier(deviceTierTargeting(/* value= */
2, /* alternatives= */
ImmutableList.of(1))).build();
assertThat(deviceSpec.getDeviceTier().getValue()).isEqualTo(2);
}
use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.
the class DeviceSpecUtilsTest method getGlEsVersion.
@Test
public void getGlEsVersion() {
DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(TextureCompressionFormatAlias.ETC2)).build();
assertThat(DeviceSpecUtils.getGlEsVersion(deviceSpec)).hasValue(0x30000);
}
use of com.android.tools.build.bundletool.device.DeviceSpecUtils.DeviceSpecFromTargetingBuilder in project bundletool by google.
the class DeviceSpecUtilsTest method deviceSpecFromTargetingBuilder_setSupportedTextureCompressionFormats.
@Test
public void deviceSpecFromTargetingBuilder_setSupportedTextureCompressionFormats() {
DeviceSpec deviceSpec = new DeviceSpecFromTargetingBuilder(DeviceSpec.getDefaultInstance()).setSupportedTextureCompressionFormats(textureCompressionTargeting(/* values= */
ImmutableSet.of(TextureCompressionFormatAlias.ETC2, TextureCompressionFormatAlias.ASTC), /* alternatives= */
ImmutableSet.of())).build();
assertThat(deviceSpec.getGlExtensionsList()).containsExactly("GL_KHR_texture_compression_astc_ldr");
assertThat(deviceSpec.getDeviceFeaturesList()).containsExactly("reqGlEsVersion=0x30000");
}
Aggregations