diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 19:30:54 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-05 19:30:54 +0000 |
commit | acf3ecc7f70567a26f1435b5d3de45b316338b3e (patch) | |
tree | 4c09f47a900ab6f86062f89eceaeb1f75e2970dc /src | |
parent | b7f20f20ac4d87819789211aec5935ec1b83ffcd (diff) |
Restore window creation code in SkNativeGLContext_win.cpp accidentally deleted in r7990.
git-svn-id: http://skia.googlecode.com/svn/trunk@7991 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/win/SkNativeGLContext_win.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gpu/gl/win/SkNativeGLContext_win.cpp b/src/gpu/gl/win/SkNativeGLContext_win.cpp index eabc78a9ba..b5a6053b92 100644 --- a/src/gpu/gl/win/SkNativeGLContext_win.cpp +++ b/src/gpu/gl/win/SkNativeGLContext_win.cpp @@ -50,6 +50,35 @@ void SkNativeGLContext::destroyGLContext() { const GrGLInterface* SkNativeGLContext::createGLContext() { HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); + if (!gWC) { + WNDCLASS wc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hbrBackground = NULL; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hInstance = hInstance; + wc.lpfnWndProc = (WNDPROC) DefWindowProc; + wc.lpszClassName = TEXT("Griffin"); + wc.lpszMenuName = NULL; + wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + + gWC = RegisterClass(&wc); + if (!gWC) { + SkDebugf("Could not register window class.\n"); + return NULL; + } + } + + if (!(fWindow = CreateWindow(TEXT("Griffin"), + TEXT("The Invisible Man"), + WS_OVERLAPPEDWINDOW, + 0, 0, 1, 1, + NULL, NULL, + hInstance, NULL))) { + SkDebugf("Could not create window.\n"); + return NULL; + } if (!(fDeviceContext = GetDC(fWindow))) { SkDebugf("Could not get device context.\n"); |