Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Only capture screenshots if the first paint is ready #2304

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ public void setFirstDrawCallback(Runnable aRunnable) {

@Override
public boolean isFirstPaintReady() {
return mWidgetPlacement.composited;
return mWidgetPlacement != null && mWidgetPlacement.composited;
}

@Override
Expand Down Expand Up @@ -1536,7 +1536,9 @@ public void onPageStart(@NonNull GeckoSession geckoSession, @NonNull String s) {
public void onPageStop(@NonNull GeckoSession aSession, boolean b) {
if (mCaptureOnPageStop || !mSession.hasCapturedBitmap()) {
mCaptureOnPageStop = false;
captureImage();
if (isFirstPaintReady()) {
captureImage();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,9 @@ public void onTabsClicked() {

// Capture active session snapshots when showing the tabs menu
for (WindowWidget window: getCurrentWindows()) {
window.captureImage();
if (window.isFirstPaintReady()) {
window.captureImage();
}
}
}

Expand Down