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 gfx::BufferFormat GetBufferFormat() const { return format; } |
| 57 |
| 58 bool IsSupported() { return true; } |
55 }; | 59 }; |
56 | 60 |
57 using GLImageTestTypes = testing::Types< | 61 using GLImageTestTypes = testing::Types< |
58 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, | 62 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
59 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, | 63 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>, |
60 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; | 64 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>>; |
61 | 65 |
62 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); | 66 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, GLImageTest, GLImageTestTypes); |
63 | 67 |
64 using GLImageRGBTestTypes = | 68 using GLImageRGBTestTypes = |
65 testing::Types<GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, | 69 testing::Types<GLImageIOSurfaceTestDelegate<gfx::BufferFormat::RGBA_8888>, |
66 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>>; | 70 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>>; |
67 | 71 |
68 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, | 72 INSTANTIATE_TYPED_TEST_CASE_P(GLImageIOSurface, |
69 GLImageZeroInitializeTest, | 73 GLImageZeroInitializeTest, |
70 GLImageRGBTestTypes); | 74 GLImageRGBTestTypes); |
71 | 75 |
72 INSTANTIATE_TYPED_TEST_CASE_P( | 76 INSTANTIATE_TYPED_TEST_CASE_P( |
73 GLImageIOSurface, | 77 GLImageIOSurface, |
74 GLImageBindTest, | 78 GLImageBindTest, |
75 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>); | 79 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::BGRA_8888>); |
76 | 80 |
77 INSTANTIATE_TYPED_TEST_CASE_P( | 81 INSTANTIATE_TYPED_TEST_CASE_P( |
78 GLImageIOSurface, | 82 GLImageIOSurface, |
79 GLImageCopyTest, | 83 GLImageCopyTest, |
80 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); | 84 GLImageIOSurfaceTestDelegate<gfx::BufferFormat::YUV_420_BIPLANAR>); |
81 | 85 |
82 } // namespace | 86 } // namespace |
83 } // namespace gl | 87 } // namespace gl |
OLD | NEW |