Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: ui/gl/gl_image_ref_counted_memory_unittest.cc

Issue 1484473003: gl, ozone: enable GLImageBindTest unittests Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase based on crrev.com/1879243002 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698