Loading libs/hwui/effects/GainmapRenderer.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,7 @@ void DrawGainmapBitmap(SkCanvas* c, const sk_sp<const SkImage>& image, const SkR gainmapSrc.fRight *= sX; gainmapSrc.fTop *= sY; gainmapSrc.fBottom *= sY; // TODO: Temporary workaround for SkGainmapShader::Make not having a const variant sk_sp<SkImage> mutImage = sk_ref_sp(const_cast<SkImage*>(image.get())); sk_sp<SkImage> mutGainmap = sk_ref_sp(const_cast<SkImage*>(gainmapImage.get())); auto shader = SkGainmapShader::Make(mutImage, src, sampling, mutGainmap, gainmapSrc, auto shader = SkGainmapShader::Make(image, src, sampling, gainmapImage, gainmapSrc, sampling, gainmapInfo, dst, targetSdrHdrRatio, c->imageInfo().refColorSpace()); gainmapPaint.setShader(shader); Loading tests/SilkFX/Android.bp +6 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,10 @@ package { android_test { name: "SilkFX", srcs: ["**/*.java", "**/*.kt"], srcs: [ "**/*.java", "**/*.kt", ], platform_apis: true, certificate: "platform", static_libs: [ Loading @@ -33,5 +36,6 @@ android_test { "androidx.appcompat_appcompat", "com.google.android.material_material", "androidx-constraintlayout_constraintlayout", "subsampling-scale-image-view", ], } tests/SilkFX/AndroidManifest.xml +10 −0 Original line number Diff line number Diff line Loading @@ -55,5 +55,15 @@ android:exported="true"> </activity> <activity android:name=".app.HdrImageViewer" android:label="HDR Gainmap Image Viewer" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> </intent-filter> </activity> </application> </manifest> tests/SilkFX/assets/gainmaps/cave.jpg 0 → 100644 +6.26 MiB Loading image diff... tests/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#000000" android:endColor="#0000FF" android:angle="0"/> </shape> No newline at end of file Loading
libs/hwui/effects/GainmapRenderer.cpp +1 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,7 @@ void DrawGainmapBitmap(SkCanvas* c, const sk_sp<const SkImage>& image, const SkR gainmapSrc.fRight *= sX; gainmapSrc.fTop *= sY; gainmapSrc.fBottom *= sY; // TODO: Temporary workaround for SkGainmapShader::Make not having a const variant sk_sp<SkImage> mutImage = sk_ref_sp(const_cast<SkImage*>(image.get())); sk_sp<SkImage> mutGainmap = sk_ref_sp(const_cast<SkImage*>(gainmapImage.get())); auto shader = SkGainmapShader::Make(mutImage, src, sampling, mutGainmap, gainmapSrc, auto shader = SkGainmapShader::Make(image, src, sampling, gainmapImage, gainmapSrc, sampling, gainmapInfo, dst, targetSdrHdrRatio, c->imageInfo().refColorSpace()); gainmapPaint.setShader(shader); Loading
tests/SilkFX/Android.bp +6 −2 Original line number Diff line number Diff line Loading @@ -25,7 +25,10 @@ package { android_test { name: "SilkFX", srcs: ["**/*.java", "**/*.kt"], srcs: [ "**/*.java", "**/*.kt", ], platform_apis: true, certificate: "platform", static_libs: [ Loading @@ -33,5 +36,6 @@ android_test { "androidx.appcompat_appcompat", "com.google.android.material_material", "androidx-constraintlayout_constraintlayout", "subsampling-scale-image-view", ], }
tests/SilkFX/AndroidManifest.xml +10 −0 Original line number Diff line number Diff line Loading @@ -55,5 +55,15 @@ android:exported="true"> </activity> <activity android:name=".app.HdrImageViewer" android:label="HDR Gainmap Image Viewer" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> </intent-filter> </activity> </application> </manifest>
tests/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2023 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#000000" android:endColor="#0000FF" android:angle="0"/> </shape> No newline at end of file