summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 15:57:55 +0000
committerkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 15:57:55 +0000
commitac28ebc947528462e50508e1da63e7ca63b5b0b0 (patch)
treea1507a271be7afc55c9e713ee6e0898dc5848d49 /gpu
parent9aac37dcc08d1260006d0194dad54441611b3873 (diff)
downloadchromium_src-ac28ebc947528462e50508e1da63e7ca63b5b0b0.zip
chromium_src-ac28ebc947528462e50508e1da63e7ca63b5b0b0.tar.gz
chromium_src-ac28ebc947528462e50508e1da63e7ca63b5b0b0.tar.bz2
Add an unbindImage method to ResourceProvider and move bindImage and unbindImage calls to draw time by calling them from LockForRead and UnlockForRead respectively.
Fix GLImageEGL::ReleaseTexImage by calling glDeleteTextures under the hood instead of glTexImage. BUG=239856 Review URL: https://chromiumcodereview.appspot.com/18034026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc
index 4647465..7e6372c 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittests.cc
@@ -85,8 +85,8 @@ TEST_F(MockGpuMemoryBufferTest, Lifecycle) {
EXPECT_EQ(kImageId, image_id);
gfx::Size size(kImageWidth, kImageHeight);
- scoped_refptr<gfx::GLImageMock> gl_image(
- new gfx::GLImageMock(gpu_memory_buffer, size));
+ scoped_refptr<StrictMock<gfx::GLImageMock> > gl_image(
+ new StrictMock<gfx::GLImageMock>(gpu_memory_buffer, size));
image_manager_->AddImage(gl_image.get(), image_id);
EXPECT_CALL(*gpu_memory_buffer, IsMapped())
@@ -100,8 +100,7 @@ TEST_F(MockGpuMemoryBufferTest, Lifecycle) {
.Times(1)
.WillOnce(SetArgPointee<1>(buffer_pixels.get()))
.RetiresOnSaturation();
- void* mapped_buffer =
- glMapImageCHROMIUM(image_id, GL_WRITE_ONLY);
+ void* mapped_buffer = glMapImageCHROMIUM(image_id, GL_WRITE_ONLY);
EXPECT_EQ(buffer_pixels.get(), mapped_buffer);
EXPECT_CALL(*gpu_memory_buffer, IsMapped())
@@ -116,12 +115,22 @@ TEST_F(MockGpuMemoryBufferTest, Lifecycle) {
// Bind the texture and the image.
glBindTexture(GL_TEXTURE_2D, texture_id);
- EXPECT_CALL(*gl_image.get(), BindTexImage()).Times(1).WillOnce(Return(true))
+ EXPECT_CALL(*gl_image.get(), BindTexImage())
+ .Times(1)
+ .WillOnce(Return(true))
.RetiresOnSaturation();
- EXPECT_CALL(*gl_image.get(), GetSize()).Times(1).WillOnce(Return(size))
+ EXPECT_CALL(*gl_image.get(), GetSize())
+ .Times(1)
+ .WillOnce(Return(size))
.RetiresOnSaturation();
glBindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id);
+ // Unbind the image.
+ EXPECT_CALL(*gl_image.get(), ReleaseTexImage())
+ .Times(1)
+ .RetiresOnSaturation();
+ glReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id);
+
// Destroy the image.
EXPECT_CALL(*gpu_memory_buffer, Die())
.Times(1)