//Clear render target before drawing
if (!renderer || !renderer->clear()) return Result::InsufficientCondition;
- //free paints
+ //Free paints
for (auto paint = paints.data; paint < (paints.data + paints.count); ++paint) {
(*paint)->pImpl->dispose(*renderer);
if (free) delete(*paint);
//Update single paint node
if (paint) {
- paint->pImpl->update(*renderer, nullptr, 255, clips, flag);
+ //Optimize Me: Can we skip the searching?
+ for (auto paint2 = paints.data; paint2 < (paints.data + paints.count); ++paint2) {
+ if ((*paint2) == paint) {
+ paint->pImpl->update(*renderer, nullptr, 255, clips, flag);
+ return Result::Success;
+ }
+ }
+ return Result::InsufficientCondition;
//Update all retained paint nodes
} else {
for (auto paint = paints.data; paint < (paints.data + paints.count); ++paint) {
Result sync()
{
if (!drawing) return Result::InsufficientCondition;
+
if (renderer->sync()) {
drawing = false;
return Result::Success;
uint32_t flag = RenderUpdateFlag::None;
Paint* cmpTarget = nullptr;
CompositeMethod cmpMethod = CompositeMethod::None;
- uint8_t opacity = 255;
PaintType type;
+ uint8_t opacity = 255;
~Impl() {
if (cmpTarget) delete(cmpTarget);