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

Side by Side Diff: ui/gl/test/gl_image_test_support.cc

Issue 2094513002: Move static GL binding initialization to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for comment. Created 4 years, 5 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
« no previous file with comments | « ui/gl/init/gl_initializer_x11.cc ('k') | ui/gl/test/gl_surface_test_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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"
10 #include "ui/gl/test/gl_surface_test_support.h" 11 #include "ui/gl/test/gl_surface_test_support.h"
11 12
12 #if defined(USE_OZONE) 13 #if defined(USE_OZONE)
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #endif 15 #endif
15 16
16 namespace gl { 17 namespace gl {
17 18
18 // static 19 // static
19 void GLImageTestSupport::InitializeGL() { 20 void GLImageTestSupport::InitializeGL() {
20 std::vector<GLImplementation> allowed_impls; 21 std::vector<GLImplementation> allowed_impls;
21 GetAllowedGLImplementations(&allowed_impls); 22 GetAllowedGLImplementations(&allowed_impls);
22 DCHECK(!allowed_impls.empty()); 23 DCHECK(!allowed_impls.empty());
23 24
24 GLImplementation impl = allowed_impls[0]; 25 GLImplementation impl = allowed_impls[0];
25 GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true); 26 GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true);
26 #if defined(USE_OZONE) 27 #if defined(USE_OZONE)
27 // Make sure all the tasks posted to the current task runner by the 28 // Make sure all the tasks posted to the current task runner by the
28 // initialization functions are run before running the tests. 29 // initialization functions are run before running the tests.
29 base::RunLoop().RunUntilIdle(); 30 base::RunLoop().RunUntilIdle();
30 #endif 31 #endif
31 } 32 }
32 33
33 // static 34 // static
34 void GLImageTestSupport::CleanupGL() { 35 void GLImageTestSupport::CleanupGL() {
35 ClearGLBindings(); 36 init::ClearGLBindings();
36 } 37 }
37 38
38 // static 39 // static
39 void GLImageTestSupport::SetBufferDataToColor(int width, 40 void GLImageTestSupport::SetBufferDataToColor(int width,
40 int height, 41 int height,
41 int stride, 42 int stride,
42 int plane, 43 int plane,
43 gfx::BufferFormat format, 44 gfx::BufferFormat format,
44 const uint8_t color[4], 45 const uint8_t color[4],
45 uint8_t* data) { 46 uint8_t* data) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 case gfx::BufferFormat::ETC1: 165 case gfx::BufferFormat::ETC1:
165 case gfx::BufferFormat::RGBA_4444: 166 case gfx::BufferFormat::RGBA_4444:
166 case gfx::BufferFormat::UYVY_422: 167 case gfx::BufferFormat::UYVY_422:
167 NOTREACHED(); 168 NOTREACHED();
168 return; 169 return;
169 } 170 }
170 NOTREACHED(); 171 NOTREACHED();
171 } 172 }
172 173
173 } // namespace gl 174 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/init/gl_initializer_x11.cc ('k') | ui/gl/test/gl_surface_test_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698