| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/gfx/buffer_format_util.h" | 9 #include "ui/gfx/buffer_format_util.h" |
| 10 #include "ui/gfx/mac/io_surface.h" | 10 #include "ui/gfx/mac/io_surface.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 IOSurfaceUnlock(surface_ref, 0, nullptr); | 45 IOSurfaceUnlock(surface_ref, 0, nullptr); |
| 46 | 46 |
| 47 bool rv = | 47 bool rv = |
| 48 image->Initialize(surface_ref, gfx::GenericSharedMemoryId(1), format); | 48 image->Initialize(surface_ref, gfx::GenericSharedMemoryId(1), format); |
| 49 EXPECT_TRUE(rv); | 49 EXPECT_TRUE(rv); |
| 50 | 50 |
| 51 return image; | 51 return image; |
| 52 } | 52 } |
| 53 | 53 |
| 54 unsigned GetTextureTarget() const { return GL_TEXTURE_RECTANGLE_ARB; } | 54 unsigned GetTextureTarget() const { return GL_TEXTURE_RECTANGLE_ARB; } |
| 55 |
| 56 bool IsSupported() { return true; } |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 using GLImageTestTypes = testing::Types< | 59 using GLImageTestTypes = testing::Types< |
| 58 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, | 60 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
| 59 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, | 61 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, |
| 60 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; | 62 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; |
| 61 | 63 |
| 62 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); | 64 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); |
| 63 | 65 |
| 64 using GLImageIOSurfaceTestTypes = | 66 using GLImageIOSurfaceTestTypes = |
| 65 testing::Types<GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, | 67 testing::Types<GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
| 66 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>>; | 68 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>>; |
| 67 | 69 |
| 68 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, | 70 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
| 69 GLImageZeroInitializeTest, | 71 GLImageZeroInitializeTest, |
| 70 GLImageIOSurfaceTestTypes); | 72 GLImageIOSurfaceTestTypes); |
| 71 | 73 |
| 72 INSTANTIATE_TYPED_TEST_CASE_P( | 74 INSTANTIATE_TYPED_TEST_CASE_P( |
| 73 GLImageIOSurface, | 75 GLImageIOSurface, |
| 74 GLImageCopyTest, | 76 GLImageCopyTest, |
| 75 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); | 77 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); |
| 76 | 78 |
| 77 } // namespace | 79 } // namespace |
| 78 } // namespace gl | 80 } // namespace gl |
| OLD | NEW |