void GnashImage::update(const GnashImage& from) { assert(size() <= from.size()); assert(width() == from.width()); assert(_type == from._type); assert(_location == from._location); std::copy(from.begin(), from.begin() + size(), begin()); }
void GnashVaapiImage::update(const GnashImage& from) { assert(stride() == from.stride()); assert(size() <= from.size()); assert(type() == from.type()); switch (from.location()) { case GNASH_IMAGE_CPU: this->update(const_cast<boost::uint8_t *>(from.begin())); break; case GNASH_IMAGE_GPU: this->update(static_cast<const GnashVaapiImage &>(from).surface()); break; default: assert(0); break; } }