| 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 "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 size, gl::GLImageMemory::GetInternalFormatForTesting(format))); | 33 size, gl::GLImageMemory::GetInternalFormatForTesting(format))); |
| 34 rv = image->Initialize( | 34 rv = image->Initialize( |
| 35 base::SharedMemory::DuplicateHandle(shared_memory.handle()), | 35 base::SharedMemory::DuplicateHandle(shared_memory.handle()), |
| 36 gfx::GenericSharedMemoryId(0), format, 0, | 36 gfx::GenericSharedMemoryId(0), format, 0, |
| 37 gfx::RowSizeForBufferFormat(size.width(), format, 0)); | 37 gfx::RowSizeForBufferFormat(size.width(), format, 0)); |
| 38 EXPECT_TRUE(rv); | 38 EXPECT_TRUE(rv); |
| 39 return image; | 39 return image; |
| 40 } | 40 } |
| 41 | 41 |
| 42 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } | 42 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } |
| 43 |
| 44 bool IsSupported() { return true; } |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 using GLImageTestTypes = testing::Types< | 47 using GLImageTestTypes = testing::Types< |
| 46 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, | 48 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, |
| 47 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, | 49 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, |
| 48 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, | 50 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, |
| 49 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; | 51 GLImageSharedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; |
| 50 | 52 |
| 51 INSTANTIATE_TYPED_TEST_CASE_P(GLImageSharedMemory, | 53 INSTANTIATE_TYPED_TEST_CASE_P(GLImageSharedMemory, |
| 52 GLImageTest, | 54 GLImageTest, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 83 new gl::GLImageSharedMemory(size, GL_RGBA)); | 85 new gl::GLImageSharedMemory(size, GL_RGBA)); |
| 84 rv = image->Initialize( | 86 rv = image->Initialize( |
| 85 base::SharedMemory::DuplicateHandle(shared_memory.handle()), | 87 base::SharedMemory::DuplicateHandle(shared_memory.handle()), |
| 86 gfx::GenericSharedMemoryId(0), gfx::BufferFormat::RGBA_8888, | 88 gfx::GenericSharedMemoryId(0), gfx::BufferFormat::RGBA_8888, |
| 87 buffer_offset, stride); | 89 buffer_offset, stride); |
| 88 EXPECT_TRUE(rv); | 90 EXPECT_TRUE(rv); |
| 89 return image; | 91 return image; |
| 90 } | 92 } |
| 91 | 93 |
| 92 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } | 94 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } |
| 95 |
| 96 bool IsSupported() { return true; } |
| 93 }; | 97 }; |
| 94 | 98 |
| 95 INSTANTIATE_TYPED_TEST_CASE_P(GLImageSharedMemoryPool, | 99 INSTANTIATE_TYPED_TEST_CASE_P(GLImageSharedMemoryPool, |
| 96 GLImageCopyTest, | 100 GLImageCopyTest, |
| 97 GLImageSharedMemoryPoolTestDelegate); | 101 GLImageSharedMemoryPoolTestDelegate); |
| 98 | 102 |
| 99 } // namespace | 103 } // namespace |
| 100 } // namespace gl | 104 } // namespace gl |
| OLD | NEW |