| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 | 9 |
| 10 #include <tchar.h> | 10 #include <tchar.h> |
| 11 | 11 |
| 12 #include "SkApplication.h" | 12 #include "SkApplication.h" |
| 13 #include "SkGraphics.h" |
| 13 #include "SkOSWindow_Win.h" | 14 #include "SkOSWindow_Win.h" |
| 14 | 15 |
| 15 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); | 16 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); |
| 16 | 17 |
| 17 // Returns the main window Win32 class name. | 18 // Returns the main window Win32 class name. |
| 18 static const TCHAR* register_class(HINSTANCE hInstance) { | 19 static const TCHAR* register_class(HINSTANCE hInstance) { |
| 19 WNDCLASSEX wcex; | 20 WNDCLASSEX wcex; |
| 20 // The main window class name | 21 // The main window class name |
| 21 static const TCHAR gSZWindowClass[] = _T("SkiaApp"); | 22 static const TCHAR gSZWindowClass[] = _T("SkiaApp"); |
| 22 | 23 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 arg = _tcstok_s(NULL, _T(" "), &next); | 73 arg = _tcstok_s(NULL, _T(" "), &next); |
| 73 } | 74 } |
| 74 int result = main_common(hInstance, nCmdShow, argc, argv); | 75 int result = main_common(hInstance, nCmdShow, argc, argv); |
| 75 for (int i = 0; i < argc; ++i) { | 76 for (int i = 0; i < argc; ++i) { |
| 76 sk_free(argv[i]); | 77 sk_free(argv[i]); |
| 77 } | 78 } |
| 78 return result; | 79 return result; |
| 79 } | 80 } |
| 80 | 81 |
| 81 int main(int argc, char**argv) { | 82 int main(int argc, char**argv) { |
| 83 SkGraphics::Init(); |
| 82 return main_common(GetModuleHandle(NULL), SW_SHOW, argc, argv); | 84 return main_common(GetModuleHandle(NULL), SW_SHOW, argc, argv); |
| 83 } | 85 } |
| 84 | 86 |
| 85 static int main_common(HINSTANCE hInstance, int show, int argc, char**argv) { | 87 static int main_common(HINSTANCE hInstance, int show, int argc, char**argv) { |
| 86 const TCHAR* windowClass = register_class(hInstance); | 88 const TCHAR* windowClass = register_class(hInstance); |
| 87 | 89 |
| 88 application_init(); | 90 application_init(); |
| 89 | 91 |
| 90 SkOSWindow::WindowInit winInit; | 92 SkOSWindow::WindowInit winInit; |
| 91 winInit.fInstance = hInstance; | 93 winInit.fInstance = hInstance; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 SkOSWindow* window = SkOSWindow::GetOSWindowForHWND(hWnd); | 126 SkOSWindow* window = SkOSWindow::GetOSWindowForHWND(hWnd); |
| 125 if (window && window->wndProc(hWnd, message, wParam, lParam)) { | 127 if (window && window->wndProc(hWnd, message, wParam, lParam)) { |
| 126 return 0; | 128 return 0; |
| 127 } else { | 129 } else { |
| 128 return DefWindowProc(hWnd, message, wParam, lParam); | 130 return DefWindowProc(hWnd, message, wParam, lParam); |
| 129 } | 131 } |
| 130 } | 132 } |
| 131 } | 133 } |
| 132 return 0; | 134 return 0; |
| 133 } | 135 } |
| OLD | NEW |