Fix ghosting on pages following images in grayscale (#2226)
This commit is contained in:
@@ -104,6 +104,16 @@ void ImageBlock::render(GfxRenderer& renderer, const int x, const int y) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Tiled grayscale (#2190): skip the whole image when it doesn't touch the
|
||||
// active band. The per-pixel writer already clips off-band pixels, but without
|
||||
// this each of the ~7 bands per plane re-ran the full cache load / pixel walk
|
||||
// and discarded the result — the dominant cost of AA on image pages. The check
|
||||
// is orientation-aware and returns true when no strip is active, so the BW
|
||||
// pass and non-tiled controllers render the image exactly as before.
|
||||
if (!renderer.glyphIntersectsStrip(x, y, x + width - 1, y + height - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to render from cache first
|
||||
std::string cachePath = getCachePath(imagePath);
|
||||
if (renderFromCache(renderer, cachePath, x, y, width, height)) {
|
||||
|
||||
+1
-1
Submodule open-x4-sdk updated: 344c479b08...26648d643a
@@ -940,7 +940,13 @@ void EpubReaderActivity::renderContents(std::unique_ptr<Page> page, const int or
|
||||
} else {
|
||||
renderer.displayBuffer(HalDisplay::HALF_REFRESH);
|
||||
}
|
||||
// Double FAST_REFRESH handles ghosting for image pages; don't count toward full refresh cadence
|
||||
// The image's own page is handled above and doesn't count toward the full
|
||||
// refresh cadence. But the grayscale pass below leaves gray charge in the
|
||||
// image region that a plain fast diff on the *next* page can't clear, so
|
||||
// text there ghosts gray (#2190). Force the next ordinary page onto the
|
||||
// HALF ghost-cleanup path, which drives every pixel to its target
|
||||
// regardless of residue.
|
||||
pagesUntilFullRefresh = 1;
|
||||
} else {
|
||||
ReaderUtils::displayWithRefreshCycle(renderer, pagesUntilFullRefresh);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user