Merge pull request #2211 from SpecLad:merge-2.4

This commit is contained in:
Roman Donchenko
2014-01-28 12:44:29 +04:00
committed by OpenCV Buildbot
40 changed files with 247 additions and 141 deletions

View File

@@ -272,9 +272,15 @@ void cv::cuda::GpuMat::copyTo(OutputArray _dst, InputArray _mask, Stream& stream
GpuMat mask = _mask.getGpuMat();
CV_DbgAssert( size() == mask.size() && mask.depth() == CV_8U && (mask.channels() == 1 || mask.channels() == channels()) );
uchar* data0 = _dst.getGpuMat().data;
_dst.create(size(), type());
GpuMat dst = _dst.getGpuMat();
// do not leave dst uninitialized
if (dst.data != data0)
dst.setTo(Scalar::all(0), stream);
typedef void (*func_t)(const GpuMat& src, const GpuMat& dst, const GpuMat& mask, Stream& stream);
static const func_t funcs[9][4] =
{

View File

@@ -999,17 +999,24 @@ public:
}
}
};
static TLSContainerStorage tlsContainerStorage;
// This is a wrapper function that will ensure 'tlsContainerStorage' is constructed on first use.
// For more information: http://www.parashift.com/c++-faq/static-init-order-on-first-use.html
static TLSContainerStorage& getTLSContainerStorage()
{
static TLSContainerStorage *tlsContainerStorage = new TLSContainerStorage();
return *tlsContainerStorage;
}
TLSDataContainer::TLSDataContainer()
: key_(-1)
{
key_ = tlsContainerStorage.allocateKey(this);
key_ = getTLSContainerStorage().allocateKey(this);
}
TLSDataContainer::~TLSDataContainer()
{
tlsContainerStorage.releaseKey(key_, this);
getTLSContainerStorage().releaseKey(key_, this);
key_ = -1;
}
@@ -1034,7 +1041,7 @@ TLSStorage::~TLSStorage()
void*& data = tlsData_[i];
if (data)
{
tlsContainerStorage.destroyData(i, data);
getTLSContainerStorage().destroyData(i, data);
data = NULL;
}
}