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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)), 0, | 28 static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)), 0, |
29 format, color, &bytes->data().front()); | 29 format, color, &bytes->data().front()); |
30 scoped_refptr<GLImageRefCountedMemory> image(new GLImageRefCountedMemory( | 30 scoped_refptr<GLImageRefCountedMemory> image(new GLImageRefCountedMemory( |
31 size, gl::GLImageMemory::GetInternalFormatForTesting(format))); | 31 size, gl::GLImageMemory::GetInternalFormatForTesting(format))); |
32 bool rv = image->Initialize(bytes.get(), format); | 32 bool rv = image->Initialize(bytes.get(), format); |
33 EXPECT_TRUE(rv); | 33 EXPECT_TRUE(rv); |
34 return image; | 34 return image; |
35 } | 35 } |
36 | 36 |
37 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } | 37 unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } |
| 38 |
| 39 gfx::BufferFormat GetBufferFormat() const { return format; } |
| 40 |
| 41 bool IsSupported() { return true; } |
38 }; | 42 }; |
39 | 43 |
40 using GLImageTestTypes = testing::Types< | 44 using GLImageTestTypes = testing::Types< |
41 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, | 45 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, |
42 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, | 46 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, |
43 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, | 47 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, |
44 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; | 48 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; |
45 | 49 |
46 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, | 50 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, |
47 GLImageTest, | 51 GLImageTest, |
48 GLImageTestTypes); | 52 GLImageTestTypes); |
49 | 53 |
50 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, | 54 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, |
51 GLImageCopyTest, | 55 GLImageCopyTest, |
52 GLImageTestTypes); | 56 GLImageTestTypes); |
53 | 57 |
54 } // namespace | 58 } // namespace |
55 } // namespace gl | 59 } // namespace gl |
OLD | NEW |