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

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

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/gl_surface_wgl.cc ('k') | ui/gl/gl_surface_x11.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "ui/gl/gl_surface_stub.h" 21 #include "ui/gl/gl_surface_stub.h"
22 #include "ui/gl/gl_surface_wgl.h" 22 #include "ui/gl/gl_surface_wgl.h"
23 #include "ui/gl/vsync_provider_win.h" 23 #include "ui/gl/vsync_provider_win.h"
24 24
25 // From ANGLE's egl/eglext.h. 25 // From ANGLE's egl/eglext.h.
26 #if !defined(EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE) 26 #if !defined(EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE)
27 #define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE \ 27 #define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE \
28 reinterpret_cast<EGLNativeDisplayType>(-2) 28 reinterpret_cast<EGLNativeDisplayType>(-2)
29 #endif 29 #endif
30 30
31 namespace gfx { 31 namespace gl {
32 32
33 // This OSMesa GL surface can use GDI to swap the contents of the buffer to a 33 // This OSMesa GL surface can use GDI to swap the contents of the buffer to a
34 // view. 34 // view.
35 class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa { 35 class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
36 public: 36 public:
37 explicit NativeViewGLSurfaceOSMesa(gfx::AcceleratedWidget window); 37 explicit NativeViewGLSurfaceOSMesa(gfx::AcceleratedWidget window);
38 38
39 // Implement subset of GLSurface. 39 // Implement subset of GLSurface.
40 bool Initialize(GLSurface::Format format) override; 40 bool Initialize(GLSurface::Format format) override;
41 void Destroy() override; 41 void Destroy() override;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 new NativeViewGLSurfaceOSMesa(window)); 203 new NativeViewGLSurfaceOSMesa(window));
204 if (!surface->Initialize()) 204 if (!surface->Initialize())
205 return NULL; 205 return NULL;
206 206
207 return surface; 207 return surface;
208 } 208 }
209 case kGLImplementationEGLGLES2: { 209 case kGLImplementationEGLGLES2: {
210 DCHECK(window != gfx::kNullAcceleratedWidget); 210 DCHECK(window != gfx::kNullAcceleratedWidget);
211 scoped_refptr<NativeViewGLSurfaceEGL> surface( 211 scoped_refptr<NativeViewGLSurfaceEGL> surface(
212 new NativeViewGLSurfaceEGL(window)); 212 new NativeViewGLSurfaceEGL(window));
213 std::unique_ptr<VSyncProvider> sync_provider; 213 std::unique_ptr<gfx::VSyncProvider> sync_provider;
214 sync_provider.reset(new VSyncProviderWin(window)); 214 sync_provider.reset(new VSyncProviderWin(window));
215 if (!surface->Initialize(std::move(sync_provider))) 215 if (!surface->Initialize(std::move(sync_provider)))
216 return NULL; 216 return NULL;
217 217
218 return surface; 218 return surface;
219 } 219 }
220 case kGLImplementationDesktopGL: { 220 case kGLImplementationDesktopGL: {
221 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceWGL( 221 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceWGL(
222 window)); 222 window));
223 if (!surface->Initialize()) 223 if (!surface->Initialize())
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 default: 264 default:
265 NOTREACHED(); 265 NOTREACHED();
266 return NULL; 266 return NULL;
267 } 267 }
268 } 268 }
269 269
270 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 270 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
271 return GetDC(NULL); 271 return GetDC(NULL);
272 } 272 }
273 273
274 } // namespace gfx 274 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_wgl.cc ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698