fix: getScreenshot white screen under hybrid composition (#175) - #356
Conversation
Hybrid composition and hardware layers made View.draw / drawing-cache screenshots blank white. Android now prefers PixelCopy of the platform view with a software-layer draw fallback; iOS implements getScreenshot by rasterizing the PDFKit layer and falling back to PDFPage.draw.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review results (worker review-release-prs-353-357)Quality gates
Review notes
Merge + releaseMerged into |
Summary
Fixes #175:
getScreenshotreturned a blank white image.Hybrid composition (
initExpensiveAndroidView) and hardware layers break drawing-cache / plainView.drawcaptures. This PR captures real PDF content instead:PixelCopyof the attached platform view; fall back to a temporaryLAYER_TYPE_SOFTWARE+View.draw(no drawing cache).getScreenshotby rasterizing the PDFKit layer; if that is blank, draw the currentPDFPageinto the viewport.No package version bump (coordinator releases
1.5.0-beta.N).Test plan
flutter pub get && dart format . && flutter analyze && flutter test— all passed./gradlew testDebugUnitTest— all passed, including newFlutterPDFViewScreenshotTestcontroller.getScreenshot(path), open PNG and confirm page content (not white) on Android and iOS