-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.2, more optimised rendering
- Loading branch information
1 parent
c758059
commit 2bcb332
Showing
6 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,33 @@ | ||
#include "hdcbuffer.hpp" | ||
|
||
void pdfv::hdc::Renderer::clear() noexcept | ||
{ | ||
this->bmBuffer.clear(); | ||
} | ||
|
||
[[nodiscard]] bool pdfv::hdc::Renderer::hasPage(std::size_t pageIdx) const noexcept | ||
{ | ||
return this->bmBuffer.find(pageIdx) != this->bmBuffer.end(); | ||
} | ||
void pdfv::hdc::Renderer::putPage(std::size_t pageIdx, xy<int> pos, xy<int> size, std::function<Renderer::RenderT (void *)> render, void * renderArg) | ||
{ | ||
bool reRender{ true }; | ||
if (auto it = this->bmBuffer.find(pageIdx); it != this->bmBuffer.end()) | ||
{ | ||
if (it->second.pos == pos && it->second.size == size) | ||
{ | ||
reRender = false; | ||
} | ||
} | ||
|
||
if (reRender) | ||
{ | ||
this->bmBuffer[pageIdx] = RenderStats(render(renderArg), pos, size); | ||
} | ||
} | ||
|
||
pdfv::hdc::Renderer::RenderT & pdfv::hdc::Renderer::getPage(std::size_t pageIdx) | ||
{ | ||
return this->bmBuffer.at(pageIdx).hrender; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters