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 file implements a standalone executable demo of using GLES2 over | 5 // This file implements a standalone executable demo of using GLES2 over |
6 // command buffers. This code is temporary as the setup that happens | 6 // command buffers. This code is temporary as the setup that happens |
7 // here is in a state of flux. Eventually there will be several versions of | 7 // here is in a state of flux. Eventually there will be several versions of |
8 // setup, one for trusted code, one for pepper, one for NaCl, and maybe others. | 8 // setup, one for trusted code, one for pepper, one for NaCl, and maybe others. |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 gfx::Size(), | 61 gfx::Size(), |
62 gpu::gles2::DisallowedExtensions(), | 62 gpu::gles2::DisallowedExtensions(), |
63 NULL, | 63 NULL, |
64 std::vector<int32>(), | 64 std::vector<int32>(), |
65 NULL, | 65 NULL, |
66 0)) { | 66 0)) { |
67 return NULL; | 67 return NULL; |
68 } | 68 } |
69 | 69 |
70 command_buffer->SetPutOffsetChangeCallback( | 70 command_buffer->SetPutOffsetChangeCallback( |
71 NewCallback(gpu_scheduler, &GpuScheduler::ProcessCommands)); | 71 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); |
72 | 72 |
73 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); | 73 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); |
74 if (!helper->Initialize(size)) { | 74 if (!helper->Initialize(size)) { |
75 // TODO(gman): cleanup. | 75 // TODO(gman): cleanup. |
76 return false; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 size_t transfer_buffer_size = 512 * 1024; | 79 size_t transfer_buffer_size = 512 * 1024; |
80 int32 transfer_buffer_id = | 80 int32 transfer_buffer_id = |
81 command_buffer->CreateTransferBuffer(transfer_buffer_size, -1); | 81 command_buffer->CreateTransferBuffer(transfer_buffer_size, -1); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ::fprintf(stdout, "Could not setup window.\n"); | 221 ::fprintf(stdout, "Could not setup window.\n"); |
222 return EXIT_FAILURE; | 222 return EXIT_FAILURE; |
223 } | 223 } |
224 | 224 |
225 demo->Setup(hwnd, kCommandBufferSize); | 225 demo->Setup(hwnd, kCommandBufferSize); |
226 | 226 |
227 ProcessMessages(hwnd); | 227 ProcessMessages(hwnd); |
228 | 228 |
229 return EXIT_SUCCESS; | 229 return EXIT_SUCCESS; |
230 } | 230 } |
OLD | NEW |