Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / tests / angle_tests / ReadPixelsTest.cpp
index 70efe99..3b7325c 100644 (file)
@@ -84,7 +84,7 @@ protected:
     GLuint mPositionVBO;
 };
 
-TEST_F(ReadPixelsTest, out_of_bounds)
+TEST_F(ReadPixelsTest, OutOfBounds)
 {
     glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
@@ -117,7 +117,7 @@ TEST_F(ReadPixelsTest, out_of_bounds)
     }
 }
 
-TEST_F(ReadPixelsTest, pbo_with_other_target)
+TEST_F(ReadPixelsTest, PBOWithOtherTarget)
 {
     glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
@@ -142,7 +142,7 @@ TEST_F(ReadPixelsTest, pbo_with_other_target)
     EXPECT_GL_NO_ERROR();
 }
 
-TEST_F(ReadPixelsTest, pbo_with_existing_data)
+TEST_F(ReadPixelsTest, PBOWithExistingData)
 {
     // Clear backbuffer to red
     glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
@@ -180,7 +180,7 @@ TEST_F(ReadPixelsTest, pbo_with_existing_data)
     EXPECT_GL_NO_ERROR();
 }
 
-TEST_F(ReadPixelsTest, pbo_and_sub_data)
+TEST_F(ReadPixelsTest, PBOAndSubData)
 {
     glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
@@ -208,7 +208,7 @@ TEST_F(ReadPixelsTest, pbo_and_sub_data)
     EXPECT_GL_NO_ERROR();
 }
 
-TEST_F(ReadPixelsTest, pbo_and_sub_data_offset)
+TEST_F(ReadPixelsTest, PBOAndSubDataOffset)
 {
     glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
@@ -241,7 +241,7 @@ TEST_F(ReadPixelsTest, pbo_and_sub_data_offset)
     EXPECT_GL_NO_ERROR();
 }
 
-TEST_F(ReadPixelsTest, draw_with_pbo)
+TEST_F(ReadPixelsTest, DrawWithPBO)
 {
     unsigned char data[4] = { 1, 2, 3, 4 };
 
@@ -293,3 +293,33 @@ TEST_F(ReadPixelsTest, draw_with_pbo)
     EXPECT_EQ(3, data[2]);
     EXPECT_EQ(4, data[3]);
 }
+
+TEST_F(ReadPixelsTest, MultisampledPBO)
+{
+    GLuint fbo;
+    glGenFramebuffers(1, &fbo);
+    glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+
+    GLuint rbo;
+    glGenRenderbuffers(1, &rbo);
+    glBindRenderbuffer(GL_RENDERBUFFER, rbo);
+    glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER, 2, GL_RGBA8, 4, 4);
+
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
+
+    ASSERT_GL_NO_ERROR();
+
+    glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
+    glClear(GL_COLOR_BUFFER_BIT);
+
+    glBindBuffer(GL_PIXEL_PACK_BUFFER, mPBO);
+
+    EXPECT_GL_NO_ERROR();
+
+    glReadPixels(0, 0, 1, 1, GL_RGBA8, GL_UNSIGNED_BYTE, NULL);
+
+    EXPECT_GL_ERROR(GL_INVALID_OPERATION);
+
+    glDeleteRenderbuffers(1, &rbo);
+    glDeleteFramebuffers(1, &fbo);
+}