| OLD | NEW |
| 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 <windows.h> | 8 #include <windows.h> |
| 9 #include <tchar.h> | 9 #include <tchar.h> |
| 10 | 10 |
| 11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
| 12 #include "SkApplication.h" | 12 #include "SkApplication.h" |
| 13 #include "SkOSWindow_Win.h" | 13 #include "SkOSWindow_Win.h" |
| 14 | 14 |
| 15 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); | 15 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); |
| 16 | 16 |
| 17 // Returns the main window Win32 class name. | 17 // Returns the main window Win32 class name. |
| 18 static const TCHAR* register_class(HINSTANCE hInstance) { | 18 static const TCHAR* register_class(HINSTANCE hInstance) { |
| 19 WNDCLASSEX wcex; | 19 WNDCLASSEX wcex; |
| 20 // The main window class name | 20 // The main window class name |
| 21 static const TCHAR gSZWindowClass[] = _T("SkiaApp"); | 21 static const TCHAR gSZWindowClass[] = _T("SkiaApp"); |
| 22 | 22 |
| 23 wcex.cbSize = sizeof(WNDCLASSEX); | 23 wcex.cbSize = sizeof(WNDCLASSEX); |
| 24 | 24 |
| 25 wcex.style = CS_HREDRAW | CS_VREDRAW; | 25 wcex.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; |
| 26 wcex.lpfnWndProc = WndProc; | 26 wcex.lpfnWndProc = WndProc; |
| 27 wcex.cbClsExtra = 0; | 27 wcex.cbClsExtra = 0; |
| 28 wcex.cbWndExtra = 0; | 28 wcex.cbWndExtra = 0; |
| 29 wcex.hInstance = hInstance; | 29 wcex.hInstance = hInstance; |
| 30 wcex.hIcon = NULL; | 30 wcex.hIcon = NULL; |
| 31 wcex.hCursor = NULL; | 31 wcex.hCursor = NULL; |
| 32 wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); | 32 wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); |
| 33 wcex.lpszMenuName = NULL; | 33 wcex.lpszMenuName = NULL; |
| 34 wcex.lpszClassName = gSZWindowClass; | 34 wcex.lpszClassName = gSZWindowClass; |
| 35 wcex.hIconSm = NULL; | 35 wcex.hIconSm = NULL; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (window && window->wndProc(hWnd, message, wParam, lParam)) { | 125 if (window && window->wndProc(hWnd, message, wParam, lParam)) { |
| 126 return 0; | 126 return 0; |
| 127 } else { | 127 } else { |
| 128 return DefWindowProc(hWnd, message, wParam, lParam); | 128 return DefWindowProc(hWnd, message, wParam, lParam); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 return 0; | 132 return 0; |
| 133 } | 133 } |
| 134 | 134 |
| OLD | NEW |