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

Side by Side Diff: tests/common/win/testing_common.cc

Issue 339057: Fix for GL unit_tests.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « core/cross/gl/renderer_gl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 using o3d::DisplayWindowWindows; 60 using o3d::DisplayWindowWindows;
61 61
62 #if defined(RENDERER_CB) 62 #if defined(RENDERER_CB)
63 using o3d::DisplayWindowCB; 63 using o3d::DisplayWindowCB;
64 using o3d::gpu_plugin::CommandBuffer; 64 using o3d::gpu_plugin::CommandBuffer;
65 using o3d::gpu_plugin::NPObjectPointer; 65 using o3d::gpu_plugin::NPObjectPointer;
66 using o3d::gpu_plugin::StubNPBrowser; 66 using o3d::gpu_plugin::StubNPBrowser;
67 using o3d::RendererCBLocal; 67 using o3d::RendererCBLocal;
68 #endif 68 #endif
69 69
70 const int kWindowWidth = 512; 70 const int kWindowWidth = 16;
71 const int kWindowHeight = 512; 71 const int kWindowHeight = 16;
72 72
73 o3d::ServiceLocator* g_service_locator = NULL; 73 o3d::ServiceLocator* g_service_locator = NULL;
74 o3d::DisplayWindow* g_display_window = NULL; 74 o3d::DisplayWindow* g_display_window = NULL;
75 75
76 HWND g_window_handle = NULL; 76 HWND g_window_handle = NULL;
77 77
78 o3d::String *g_program_path = NULL; 78 o3d::String *g_program_path = NULL;
79 o3d::String *g_program_name = NULL; 79 o3d::String *g_program_name = NULL;
80 o3d::Renderer* g_renderer = NULL; 80 o3d::Renderer* g_renderer = NULL;
81 81
(...skipping 20 matching lines...) Expand all
102 ::SetUnhandledExceptionFilter(LocalUnhandledExceptionFilter); 102 ::SetUnhandledExceptionFilter(LocalUnhandledExceptionFilter);
103 103
104 std::string error; 104 std::string error;
105 if (!o3d::RendererInstallCheck(&error)) { 105 if (!o3d::RendererInstallCheck(&error)) {
106 return false; 106 return false;
107 } 107 }
108 WNDCLASSEX wc = {0}; 108 WNDCLASSEX wc = {0};
109 109
110 wc.lpszClassName = L"MY_WINDOWS_CLASS"; 110 wc.lpszClassName = L"MY_WINDOWS_CLASS";
111 wc.cbSize = sizeof(WNDCLASSEX); 111 wc.cbSize = sizeof(WNDCLASSEX);
112 wc.style = CS_HREDRAW | CS_VREDRAW; 112 wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
113 wc.lpfnWndProc = ::WindowProc; 113 wc.lpfnWndProc = ::WindowProc;
114 wc.cbClsExtra = 0; 114 wc.cbClsExtra = 0;
115 wc.cbWndExtra = 0; 115 wc.cbWndExtra = 0;
116 wc.hInstance = instance; 116 wc.hInstance = instance;
117 wc.hIcon = ::LoadIcon(instance, IDI_APPLICATION); 117 wc.hIcon = ::LoadIcon(instance, IDI_APPLICATION);
118 wc.hIconSm = NULL; 118 wc.hIconSm = NULL;
119 wc.hCursor = ::LoadCursor(instance, IDC_ARROW); 119 wc.hCursor = ::LoadCursor(instance, IDC_ARROW);
120 wc.hbrBackground = static_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)); 120 wc.hbrBackground = static_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH));
121 wc.lpszMenuName = NULL; 121 wc.lpszMenuName = NULL;
122 122
123 if (!::RegisterClassEx(&wc)) 123 if (!::RegisterClassEx(&wc))
124 return false; 124 return false;
125 125
126 // Leaving this window onscreen leads to a redraw error which makes it 126 // Leaving this window onscreen leads to a redraw error which makes it
127 // a hassle to debug tests in an IDE, so we place the window somewhere that 127 // a hassle to debug tests in an IDE, so we place the window somewhere that
128 // won't happen. 128 // won't happen.
129 g_window_handle = ::CreateWindowExW(NULL, 129 g_window_handle = ::CreateWindowExW(NULL,
130 wc.lpszClassName, 130 wc.lpszClassName,
131 L"", 131 L"",
132 WS_OVERLAPPEDWINDOW, 132 WS_OVERLAPPEDWINDOW,
133 -1000, 133 10,
134 0, 134 10,
135 kWindowWidth, 135 kWindowWidth,
136 kWindowHeight, 136 kWindowHeight,
137 0, 137 0,
138 0, 138 0,
139 instance, 139 instance,
140 0); 140 0);
141 141
142 if (g_window_handle == NULL) 142 if (g_window_handle == NULL)
143 return false; 143 return false;
144 144
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 delete g_renderer; 238 delete g_renderer;
239 g_renderer = NULL; 239 g_renderer = NULL;
240 240
241 delete display_window; 241 delete display_window;
242 g_display_window = NULL; 242 g_display_window = NULL;
243 g_program_path = NULL; 243 g_program_path = NULL;
244 g_program_name = NULL; 244 g_program_name = NULL;
245 245
246 return ret; 246 return ret;
247 } 247 }
OLDNEW
« no previous file with comments | « core/cross/gl/renderer_gl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698