OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This tool is used to benchmark the technique of using tiles to render a | 5 // This tool is used to benchmark the technique of using tiles to render a |
6 // large tecture. This tool runs with different tile sizes so that developer | 6 // large tecture. This tool runs with different tile sizes so that developer |
7 // can determine the right dimensions for the tiles. | 7 // can determine the right dimensions for the tiles. |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 | 10 |
11 #include <X11/keysym.h> | 11 #include <X11/keysym.h> |
12 #include <X11/Xlib.h> | 12 #include <X11/Xlib.h> |
13 #include <X11/Xutil.h> | 13 #include <X11/Xutil.h> |
14 | 14 |
15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
20 #include "base/task.h" | |
21 #include "ui/gfx/gl/gl_bindings.h" | 20 #include "ui/gfx/gl/gl_bindings.h" |
22 #include "ui/gfx/gl/gl_implementation.h" | 21 #include "ui/gfx/gl/gl_implementation.h" |
23 | 22 |
24 // Initial size of the window and the texture. | 23 // Initial size of the window and the texture. |
25 static const int kStartSize = 1024; | 24 static const int kStartSize = 1024; |
26 | 25 |
27 // The smallest texture size we're trying. | 26 // The smallest texture size we're trying. |
28 static const int kEndSize = 16; | 27 static const int kEndSize = 16; |
29 | 28 |
30 // Factor for dividing the size from one step to another. | 29 // Factor for dividing the size from one step to another. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 236 |
238 // Cleanup GL. | 237 // Cleanup GL. |
239 glXMakeCurrent(g_display, 0, NULL); | 238 glXMakeCurrent(g_display, 0, NULL); |
240 glXDestroyContext(g_display, g_gl_context); | 239 glXDestroyContext(g_display, g_gl_context); |
241 | 240 |
242 // Destroy window and display. | 241 // Destroy window and display. |
243 XDestroyWindow(g_display, g_window); | 242 XDestroyWindow(g_display, g_window); |
244 XCloseDisplay(g_display); | 243 XCloseDisplay(g_display); |
245 return 0; | 244 return 0; |
246 } | 245 } |
OLD | NEW |