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 "ui/gl/test/gl_image_test_support.h" | 5 #include "ui/gl/test/gl_image_test_support.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ui/gl/gl_implementation.h" | 9 #include "ui/gl/gl_implementation.h" |
10 #include "ui/gl/init/gl_factory.h" | |
11 #include "ui/gl/test/gl_surface_test_support.h" | 10 #include "ui/gl/test/gl_surface_test_support.h" |
12 | 11 |
13 #if defined(USE_OZONE) | 12 #if defined(USE_OZONE) |
14 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
15 #endif | 14 #endif |
16 | 15 |
17 namespace gl { | 16 namespace gl { |
18 | 17 |
19 // static | 18 // static |
20 void GLImageTestSupport::InitializeGL() { | 19 void GLImageTestSupport::InitializeGL() { |
21 std::vector<GLImplementation> allowed_impls; | 20 std::vector<GLImplementation> allowed_impls; |
22 GetAllowedGLImplementations(&allowed_impls); | 21 GetAllowedGLImplementations(&allowed_impls); |
23 DCHECK(!allowed_impls.empty()); | 22 DCHECK(!allowed_impls.empty()); |
24 | 23 |
25 GLImplementation impl = allowed_impls[0]; | 24 GLImplementation impl = allowed_impls[0]; |
26 GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true); | 25 GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true); |
27 #if defined(USE_OZONE) | 26 #if defined(USE_OZONE) |
28 // Make sure all the tasks posted to the current task runner by the | 27 // Make sure all the tasks posted to the current task runner by the |
29 // initialization functions are run before running the tests. | 28 // initialization functions are run before running the tests. |
30 base::RunLoop().RunUntilIdle(); | 29 base::RunLoop().RunUntilIdle(); |
31 #endif | 30 #endif |
32 } | 31 } |
33 | 32 |
34 // static | 33 // static |
35 void GLImageTestSupport::CleanupGL() { | 34 void GLImageTestSupport::CleanupGL() { |
36 init::ClearGLBindings(); | 35 ClearGLBindings(); |
37 } | 36 } |
38 | 37 |
39 // static | 38 // static |
40 void GLImageTestSupport::SetBufferDataToColor(int width, | 39 void GLImageTestSupport::SetBufferDataToColor(int width, |
41 int height, | 40 int height, |
42 int stride, | 41 int stride, |
43 int plane, | 42 int plane, |
44 gfx::BufferFormat format, | 43 gfx::BufferFormat format, |
45 const uint8_t color[4], | 44 const uint8_t color[4], |
46 uint8_t* data) { | 45 uint8_t* data) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 case gfx::BufferFormat::ETC1: | 164 case gfx::BufferFormat::ETC1: |
166 case gfx::BufferFormat::RGBA_4444: | 165 case gfx::BufferFormat::RGBA_4444: |
167 case gfx::BufferFormat::UYVY_422: | 166 case gfx::BufferFormat::UYVY_422: |
168 NOTREACHED(); | 167 NOTREACHED(); |
169 return; | 168 return; |
170 } | 169 } |
171 NOTREACHED(); | 170 NOTREACHED(); |
172 } | 171 } |
173 | 172 |
174 } // namespace gl | 173 } // namespace gl |
OLD | NEW |