a bit more opengl refactoring:
* added Access parameter to GlBuffer::mapHost * added autoRelease parameter to all create methods * fixed indentation in gl_core_3_1 * minor improvments for opengl sample
This commit is contained in:
@@ -351,14 +351,14 @@ TEST_P(GlBuffer, Clone)
|
||||
cv::destroyAllWindows();
|
||||
}
|
||||
|
||||
TEST_P(GlBuffer, MapHost)
|
||||
TEST_P(GlBuffer, MapHostRead)
|
||||
{
|
||||
cv::namedWindow("test", cv::WINDOW_OPENGL);
|
||||
|
||||
cv::Mat gold = randomMat(size, type);
|
||||
cv::GlBuffer buf(gold);
|
||||
|
||||
cv::Mat dst = buf.mapHost();
|
||||
cv::Mat dst = buf.mapHost(cv::GlBuffer::READ_ONLY);
|
||||
|
||||
EXPECT_MAT_NEAR(gold, dst, 0);
|
||||
|
||||
@@ -368,6 +368,27 @@ TEST_P(GlBuffer, MapHost)
|
||||
cv::destroyAllWindows();
|
||||
}
|
||||
|
||||
TEST_P(GlBuffer, MapHostWrite)
|
||||
{
|
||||
cv::namedWindow("test", cv::WINDOW_OPENGL);
|
||||
|
||||
cv::Mat gold = randomMat(size, type);
|
||||
cv::GlBuffer buf(size, type);
|
||||
|
||||
cv::Mat dst = buf.mapHost(cv::GlBuffer::WRITE_ONLY);
|
||||
gold.copyTo(dst);
|
||||
buf.unmapHost();
|
||||
dst.release();
|
||||
|
||||
cv::Mat bufData;
|
||||
buf.copyTo(bufData);
|
||||
|
||||
EXPECT_MAT_NEAR(gold, bufData, 0);
|
||||
|
||||
buf.release();
|
||||
cv::destroyAllWindows();
|
||||
}
|
||||
|
||||
TEST_P(GlBuffer, MapDevice)
|
||||
{
|
||||
cv::namedWindow("test", cv::WINDOW_OPENGL);
|
||||
|
Reference in New Issue
Block a user