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

Side by Side Diff: ui/gl/init/gl_factory.cc

Issue 2047283003: Move GLSurface creation from //ui/gl to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gl_context
Patch Set: Fix Ozone CreateViewGLSurface logic. Created 4 years, 6 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/BUILD.gn ('k') | ui/gl/init/gl_factory_android.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/init/gl_factory.h" 5 #include "ui/gl/init/gl_factory.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "ui/gl/gl_context.h"
14 #include "ui/gl/gl_share_group.h" 13 #include "ui/gl/gl_share_group.h"
15 #include "ui/gl/gl_surface.h" 14 #include "ui/gl/gl_surface.h"
16 #include "ui/gl/init/gl_initializer.h" 15 #include "ui/gl/init/gl_initializer.h"
17 16
18 namespace gl { 17 namespace gl {
19 namespace init { 18 namespace init {
20 19
21 bool InitializeGLOneOff() { 20 bool InitializeGLOneOff() {
22 TRACE_EVENT0("gpu,startup", "gl::init::InitializeOneOff"); 21 TRACE_EVENT0("gpu,startup", "gl::init::InitializeOneOff");
23 22
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DVLOG(1) << "Using " << GetGLImplementationName(GetGLImplementation()) 76 DVLOG(1) << "Using " << GetGLImplementationName(GetGLImplementation())
78 << " GL implementation."; 77 << " GL implementation.";
79 if (gpu_service_logging) 78 if (gpu_service_logging)
80 InitializeDebugGLBindings(); 79 InitializeDebugGLBindings();
81 if (disable_gl_drawing) 80 if (disable_gl_drawing)
82 InitializeNullDrawGLBindings(); 81 InitializeNullDrawGLBindings();
83 } 82 }
84 return initialized; 83 return initialized;
85 } 84 }
86 85
87 // TODO(kylechar): The functions below should be replaced with a platform
88 // specific version for X11, Ozone, Windows, Mac and Android. The implementation
89 // of each function should be moved into a platform specific file and the
90 // original static functions should be removed from GLSurface and GLContext.
91
92 scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget window) {
93 return GLSurface::CreateViewGLSurface(window);
94 }
95
96 #if defined(USE_OZONE)
97 scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface(
98 gfx::AcceleratedWidget window) {
99 return GLSurface::CreateSurfacelessViewGLSurface(window);
100 }
101 #endif // defined(USE_OZONE)
102
103 scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) {
104 return GLSurface::CreateOffscreenGLSurface(size);
105 }
106
107 } // namespace init 86 } // namespace init
108 } // namespace gl 87 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/init/BUILD.gn ('k') | ui/gl/init/gl_factory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698