Add aditional RenderLocks
This commit is contained in:
@@ -58,7 +58,10 @@ void EpubReaderActivity::onEnter() {
|
||||
|
||||
// Configure screen orientation based on settings
|
||||
// NOTE: This affects layout math and must be applied before any render calls.
|
||||
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
|
||||
{
|
||||
RenderLock lock(*this);
|
||||
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
|
||||
}
|
||||
|
||||
epub->setupCacheDir();
|
||||
|
||||
@@ -107,7 +110,10 @@ void EpubReaderActivity::onExit() {
|
||||
Activity::onExit();
|
||||
|
||||
// Reset orientation back to portrait for the rest of the UI
|
||||
renderer.setOrientation(GfxRenderer::Orientation::Portrait);
|
||||
{
|
||||
RenderLock lock(*this);
|
||||
renderer.setOrientation(GfxRenderer::Orientation::Portrait);
|
||||
}
|
||||
|
||||
APP_STATE.readerActivityLoadCount = 0;
|
||||
APP_STATE.saveToFile();
|
||||
|
||||
@@ -125,9 +125,12 @@ void ReaderActivity::onEnter() {
|
||||
if (isImageFile(initialBookPath)) {
|
||||
onGoToBmpViewer(initialBookPath);
|
||||
} else if (isXtcFile(initialBookPath)) {
|
||||
renderer.clearScreen();
|
||||
renderer.drawCenteredText(UI_12_FONT_ID, 300, tr(STR_LOADING), true, EpdFontFamily::BOLD);
|
||||
renderer.displayBuffer();
|
||||
{
|
||||
RenderLock lock(*this);
|
||||
renderer.clearScreen();
|
||||
renderer.drawCenteredText(UI_12_FONT_ID, 300, tr(STR_LOADING), true, EpdFontFamily::BOLD);
|
||||
renderer.displayBuffer();
|
||||
}
|
||||
|
||||
auto xtc = loadXtc(initialBookPath);
|
||||
if (!xtc) {
|
||||
|
||||
@@ -92,7 +92,10 @@ void TxtReaderActivity::onEnter() {
|
||||
return;
|
||||
}
|
||||
|
||||
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
|
||||
{
|
||||
RenderLock lock(*this);
|
||||
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
|
||||
}
|
||||
|
||||
txt->setupCacheDir();
|
||||
|
||||
@@ -111,7 +114,10 @@ void TxtReaderActivity::onExit() {
|
||||
Activity::onExit();
|
||||
|
||||
// Reset orientation back to portrait for the rest of the UI
|
||||
renderer.setOrientation(GfxRenderer::Orientation::Portrait);
|
||||
{
|
||||
RenderLock lock(*this);
|
||||
renderer.setOrientation(GfxRenderer::Orientation::Portrait);
|
||||
}
|
||||
|
||||
pageOffsets.clear();
|
||||
currentPageLines.clear();
|
||||
|
||||
Reference in New Issue
Block a user