kobalicek on master
[Bug] Fixed invalid move constr… (compare)
Yes, I understand that worker-thread stuff. Again, it’s that as a user of B2D I don’t have any chance to find out that B2D behave like this. It’s not wirtten anywhere:
If you do img.Create and have a ctx attached, the ctx keeps an internal copy of the image before img.Create, the new img is not attached to any ctx.
@kobalicek Maybe add a function:
BLResult blGlyphBufferMove(BLGlyphBufferCore* self, BLGlyphBufferCore* other) noexcept {
BLInternalGlyphBufferImpl* impl = blInternalCast(self->impl);
self->impl = blInternalCast(other->impl);
other->impl = nullptr;
if (impl != &blGlyphBufferInternalImplNone)
impl->destroy();
return BL_SUCCESS;
}
and move operator to class blGlyphBuffer:
BL_INLINE BLGlyphBuffer& operator=(BLGlyphBuffer&& other) noexcept { blGlyphBufferMove(this, &other); return *this; }
To be able to create an array of BLGlyphBuffer, for example:
Array<BLGlyphBuffer> arrGlyphs;
arrGlyphs.append(BLGlyphBuffer());
@kobalicek In glyphbuffer.cpp in function:
BLResult blGlyphBufferInitMove(BLGlyphBufferCore* self, BLGlyphBufferCore* other) noexcept {
BLInternalGlyphBufferImpl* impl = blInternalCast(self->impl);
other->impl = const_cast<BLInternalGlyphBufferImpl*>(&blGlyphBufferInternalImplNone);
self->impl = impl;
return BL_SUCCESS;
}
in first string ERROR, must be:
BLInternalGlyphBufferImpl* impl = blInternalCast(other->impl);
other->impl not self->impl
Right?
blGlyphBufferInitMove