| Index: content/browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc
|
| diff --git a/content/browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc b/content/browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc
|
| index baaa64a37c5ad90e0cda01831010db91d9ca061f..4552d501e63c1c6e7b238e49acbf6cc880c83af1 100644
|
| --- a/content/browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc
|
| +++ b/content/browser/renderer_host/compositing_iosurface_transformer_mac_unittest.cc
|
| @@ -280,6 +280,7 @@ class CompositingIOSurfaceTransformerTest : public testing::Test {
|
| }
|
|
|
| virtual ~CompositingIOSurfaceTransformerTest() {
|
| + transformer_->ReleaseCachedGLObjects();
|
| shader_program_cache_->Reset();
|
| CGLSetCurrentContext(NULL);
|
| CGLDestroyContext(context_);
|
| @@ -289,25 +290,21 @@ class CompositingIOSurfaceTransformerTest : public testing::Test {
|
| void RunResizeTest(const SkBitmap& src_bitmap, const gfx::Rect& src_rect,
|
| const gfx::Size& dst_size) {
|
| SCOPED_TRACE(::testing::Message()
|
| - << "src_rect=" << src_rect.x() << ',' << src_rect.y()
|
| + << "src_rect=(" << src_rect.x() << ',' << src_rect.y()
|
| << ")x[" << src_rect.width() << 'x' << src_rect.height()
|
| << "]; dst_size=[" << dst_size.width() << 'x'
|
| << dst_size.height() << ']');
|
|
|
| - const GLuint original_texture = CreateTextureWithImage(src_bitmap);
|
| - EXPECT_NE(0u, original_texture);
|
| -
|
| // Do the scale operation on the GPU.
|
| + const GLuint original_texture = CreateTextureWithImage(src_bitmap);
|
| + ASSERT_NE(0u, original_texture);
|
| GLuint scaled_texture = 0u;
|
| - EXPECT_TRUE(transformer_->ResizeBilinear(
|
| + ASSERT_TRUE(transformer_->ResizeBilinear(
|
| original_texture, src_rect, dst_size, &scaled_texture));
|
| EXPECT_NE(0u, scaled_texture);
|
| CGLFlushDrawable(context_); // Account for some buggy driver impls.
|
| const SkBitmap result_bitmap = ReadBackTexture(scaled_texture, dst_size);
|
| -
|
| - // Delete the textures.
|
| EXPECT_NO_GL_ERROR(glDeleteTextures(1, &original_texture));
|
| - EXPECT_NO_GL_ERROR(glDeleteTextures(1, &scaled_texture));
|
|
|
| // Compare the image read back to the version produced by a known-working
|
| // software implementation. Allow up to 2 lines of mismatch due to how
|
| @@ -322,21 +319,20 @@ class CompositingIOSurfaceTransformerTest : public testing::Test {
|
| const SkBitmap& src_bitmap, const gfx::Rect& src_rect,
|
| const gfx::Size& dst_size) {
|
| SCOPED_TRACE(::testing::Message()
|
| - << "src_rect=" << src_rect.x() << ',' << src_rect.y()
|
| + << "src_rect=(" << src_rect.x() << ',' << src_rect.y()
|
| << ")x[" << src_rect.width() << 'x' << src_rect.height()
|
| << "]; dst_size=[" << dst_size.width() << 'x'
|
| << dst_size.height() << ']');
|
|
|
| - const GLuint original_texture = CreateTextureWithImage(src_bitmap);
|
| - EXPECT_NE(0u, original_texture);
|
| -
|
| // Perform the RGB to YV12 conversion.
|
| + const GLuint original_texture = CreateTextureWithImage(src_bitmap);
|
| + ASSERT_NE(0u, original_texture);
|
| GLuint texture_y = 0u;
|
| GLuint texture_u = 0u;
|
| GLuint texture_v = 0u;
|
| gfx::Size packed_y_size;
|
| gfx::Size packed_uv_size;
|
| - EXPECT_TRUE(transformer_->TransformRGBToYV12(
|
| + ASSERT_TRUE(transformer_->TransformRGBToYV12(
|
| original_texture, src_rect, dst_size,
|
| &texture_y, &texture_u, &texture_v, &packed_y_size, &packed_uv_size));
|
| EXPECT_NE(0u, texture_y);
|
| @@ -344,6 +340,7 @@ class CompositingIOSurfaceTransformerTest : public testing::Test {
|
| EXPECT_NE(0u, texture_v);
|
| EXPECT_FALSE(packed_y_size.IsEmpty());
|
| EXPECT_FALSE(packed_uv_size.IsEmpty());
|
| + EXPECT_NO_GL_ERROR(glDeleteTextures(1, &original_texture));
|
|
|
| // Read-back the texture for each plane.
|
| CGLFlushDrawable(context_); // Account for some buggy driver impls.
|
| @@ -351,12 +348,6 @@ class CompositingIOSurfaceTransformerTest : public testing::Test {
|
| const SkBitmap result_u_bitmap = ReadBackTexture(texture_u, packed_uv_size);
|
| const SkBitmap result_v_bitmap = ReadBackTexture(texture_v, packed_uv_size);
|
|
|
| - // Delete the textures.
|
| - EXPECT_NO_GL_ERROR(glDeleteTextures(1, &original_texture));
|
| - EXPECT_NO_GL_ERROR(glDeleteTextures(1, &texture_y));
|
| - EXPECT_NO_GL_ERROR(glDeleteTextures(1, &texture_u));
|
| - EXPECT_NO_GL_ERROR(glDeleteTextures(1, &texture_v));
|
| -
|
| // Compare the Y, U, and V planes read-back to the version produced by a
|
| // known-working software implementation. Allow up to 2 lines of mismatch
|
| // due to how implementations disagree on resolving the processing of edges.
|
|
|