Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Nov 8, 2023
1 parent feeac62 commit 52f3f98
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
12 changes: 6 additions & 6 deletions android_native_surface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ fn render_to_native_window(window: NativeWindow) {
let gl_display = support::create_display(raw_display_handle);

let template = support::config_template(raw_window_handle);
dbg!(unsafe {
gl_display
.find_configs(ConfigTemplate::default())
.unwrap()
.collect::<Vec<_>>()
});
// dbg!(unsafe {
// gl_display
// .find_configs(ConfigTemplate::default())
// .unwrap()
// .collect::<Vec<_>>()
// });
let config = unsafe {
gl_display
.find_configs(template)
Expand Down
2 changes: 1 addition & 1 deletion android_native_surface/src/support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn surface_attributes(window: &NativeWindow) -> SurfaceAttributes<WindowSurf
let raw_window_handle = window.raw_window_handle();
SurfaceAttributesBuilder::<WindowSurface>::new()
// .with_srgb(Some(true))
.with_color_space(Some(ColorSpace::ScrgbLinear))
.with_color_space(Some(ColorSpace::DisplayP3Linear))
.build(
raw_window_handle,
NonZeroU32::new(window.width().try_into().unwrap()).unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:colorMode="wideColorGamut"
android:colorMode="hdr"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
22 changes: 12 additions & 10 deletions app/src/main/java/rust/androidnativesurface/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ class MainActivity : Activity() {
setContentView(R.layout.activity_main)

val display = display!!
println("Display ${display}")
println("Display ${display.displayId}")
println("Display ${display.isHdr}")
// println("Display ${display.hdrSdrRatio}")
// println("Display ${display.isHdrSdrRatioAvailable}")
println("Display ${display.hdrCapabilities}")
println("Display ${display.hdrCapabilities.desiredMaxAverageLuminance}")
println("Display ${display.hdrCapabilities.desiredMinLuminance}")
println("Display ${display.hdrCapabilities.desiredMaxLuminance}")
println("Display $display")
println("Display ID ${display.displayId}")
println("isHdr ${display.isHdr}")
println("isWideColorGamut ${display.isWideColorGamut}")
println("preferredWideGamutColorSpace ${display.preferredWideGamutColorSpace}")
// println("hdrSdrRatio ${display.hdrSdrRatio}")
// println("isHdrSdrRatioAvailable ${display.isHdrSdrRatioAvailable}")
println("hdrCapabilities ${display.hdrCapabilities}")
println("desiredMaxAverageLuminance ${display.hdrCapabilities.desiredMaxAverageLuminance}")
println("desiredMinLuminance ${display.hdrCapabilities.desiredMinLuminance}")
println("desiredMaxLuminance ${display.hdrCapabilities.desiredMaxLuminance}")
display.hdrCapabilities.supportedHdrTypes.forEach {
val name = if (it == HdrCapabilities.HDR_TYPE_DOLBY_VISION) {
"HDR_TYPE_DOLBY_VISION"
Expand All @@ -56,7 +58,7 @@ class MainActivity : Activity() {
println(name)
}

// println("${display.mode.supportedHdrTypes}")
// println("supportedHdrTypes ${display.mode.supportedHdrTypes}")
var dm = getSystemService(DisplayManager::class.java)
// println(dm.hdrConversionMode)

Expand Down

0 comments on commit 52f3f98

Please sign in to comment.