Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hparty committed Oct 31, 2024
1 parent eb09113 commit c74e06b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/tgfx/layers/DisplayList.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DisplayList {
void render(Surface* surface, bool replaceAll = true);

private:
bool needRender(const Surface* surface) const;
bool needRender(const Surface* surface, bool replaceAll) const;
std::shared_ptr<Layer> _root = nullptr;
uint32_t surfaceContentVersion = 0u;
uint32_t surfaceID = 0u;
Expand Down
8 changes: 4 additions & 4 deletions src/layers/DisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Layer* DisplayList::root() const {
}

void DisplayList::render(Surface* surface, bool replaceAll) {
if (!surface || !needRender(surface)) {
if (!surface || !needRender(surface, replaceAll)) {
return;
}
auto canvas = surface->getCanvas();
Expand All @@ -43,9 +43,9 @@ void DisplayList::render(Surface* surface, bool replaceAll) {
surfaceID = surface->_uniqueID;
}

bool DisplayList::needRender(const Surface* surface) const {
return surface->_uniqueID != surfaceID || surface->contentVersion() != surfaceContentVersion ||
_root->bitFields.dirty;
bool DisplayList::needRender(const Surface* surface, bool replaceAll) const {
return !replaceAll || surface->_uniqueID != surfaceID ||
surface->contentVersion() != surfaceContentVersion || _root->bitFields.dirty;
}

} // namespace tgfx

0 comments on commit c74e06b

Please sign in to comment.