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:
Vladislav Vinogradov
2012-12-03 13:11:06 +04:00
parent 08fbf667f9
commit 05d842bcd8
6 changed files with 3945 additions and 4000 deletions

View File

@@ -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);