| 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 bool IsSupported() { return true; } |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 using GLImageTestTypes = testing::Types< | 42 using GLImageTestTypes = testing::Types< |
| 41 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, | 43 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBX_8888>, |
| 42 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, | 44 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::RGBA_8888>, |
| 43 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, | 45 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRX_8888>, |
| 44 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; | 46 GLImageRefCountedMemoryTestDelegate<gfx::BufferFormat::BGRA_8888>>; |
| 45 | 47 |
| 46 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, | 48 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, |
| 47 GLImageTest, | 49 GLImageTest, |
| 48 GLImageTestTypes); | 50 GLImageTestTypes); |
| 49 | 51 |
| 50 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, | 52 INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory, |
| 51 GLImageCopyTest, | 53 GLImageCopyTest, |
| 52 GLImageTestTypes); | 54 GLImageTestTypes); |
| 53 | 55 |
| 54 } // namespace | 56 } // namespace |
| 55 } // namespace gl | 57 } // namespace gl |
| OLD | NEW |