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

Side by Side Diff: src/views/win/SkOSWindow_win.cpp

Issue 1815823002: Move SkGLContext and some GrGLInterface implementations to skgputest module (Closed) Base URL: https://chromium.googlesource.com/skia.git@debugobject
Patch Set: rebase, readd null interface to main lib 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 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 9
10 #if defined(SK_BUILD_FOR_WIN) 10 #if defined(SK_BUILD_FOR_WIN)
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 389 }
390 390
391 void SkOSWindow::presentGL() { 391 void SkOSWindow::presentGL() {
392 HDC dc = GetDC((HWND)fHWND); 392 HDC dc = GetDC((HWND)fHWND);
393 SwapBuffers(dc); 393 SwapBuffers(dc);
394 ReleaseDC((HWND)fHWND, dc); 394 ReleaseDC((HWND)fHWND, dc);
395 } 395 }
396 396
397 #if SK_ANGLE 397 #if SK_ANGLE
398 398
399 void* get_angle_egl_display(void* nativeDisplay) {
jvanverth1 2016/03/29 14:45:09 Where is this used?
bsalomon 2016/03/29 17:07:59 I think something got lost when rebasing. I added
400 PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
401 eglGetPlatformDisplayEXT =
402 (PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress("eglGetPlatformDispla yEXT");
403
404 // We expect ANGLE to support this extension
405 if (!eglGetPlatformDisplayEXT) {
406 return EGL_NO_DISPLAY;
407 }
408
409 EGLDisplay display = EGL_NO_DISPLAY;
410 // Try for an ANGLE D3D11 context, fall back to D3D9, and finally GL.
411 EGLint attribs[3][3] = {
412 {
413 EGL_PLATFORM_ANGLE_TYPE_ANGLE,
414 EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
415 EGL_NONE
416 },
417 {
418 EGL_PLATFORM_ANGLE_TYPE_ANGLE,
419 EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE,
420 EGL_NONE
421 },
422 };
423 for (int i = 0; i < 3 && display == EGL_NO_DISPLAY; ++i) {
424 display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,nativeDispla y, attribs[i]);
425 }
426 return display;
427 }
428
399 bool create_ANGLE(EGLNativeWindowType hWnd, 429 bool create_ANGLE(EGLNativeWindowType hWnd,
400 int msaaSampleCount, 430 int msaaSampleCount,
401 EGLDisplay* eglDisplay, 431 EGLDisplay* eglDisplay,
402 EGLContext* eglContext, 432 EGLContext* eglContext,
403 EGLSurface* eglSurface, 433 EGLSurface* eglSurface,
404 EGLConfig* eglConfig) { 434 EGLConfig* eglConfig) {
405 static const EGLint contextAttribs[] = { 435 static const EGLint contextAttribs[] = {
406 EGL_CONTEXT_CLIENT_VERSION, 2, 436 EGL_CONTEXT_CLIENT_VERSION, 2,
407 EGL_NONE, EGL_NONE 437 EGL_NONE, EGL_NONE
408 }; 438 };
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 } 801 }
772 802
773 void SkOSWindow::closeWindow() { 803 void SkOSWindow::closeWindow() {
774 DestroyWindow((HWND)fHWND); 804 DestroyWindow((HWND)fHWND);
775 if (fFullscreen) { 805 if (fFullscreen) {
776 DestroyWindow((HWND)fSavedWindowState.fHWND); 806 DestroyWindow((HWND)fSavedWindowState.fHWND);
777 } 807 }
778 gHwndToOSWindowMap.remove(fHWND); 808 gHwndToOSWindowMap.remove(fHWND);
779 } 809 }
780 #endif 810 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698