| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 return NULL; | 57 return NULL; |
| 58 | 58 |
| 59 GpuScheduler* gpu_scheduler = new GpuScheduler(command_buffer.get(), | 59 GpuScheduler* gpu_scheduler = new GpuScheduler(command_buffer.get(), |
| 60 NULL, | 60 NULL, |
| 61 NULL); | 61 NULL); |
| 62 if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd), | 62 if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd), |
| 63 gfx::Size(), | 63 gfx::Size(), |
| 64 gpu::gles2::DisallowedExtensions(), | 64 gpu::gles2::DisallowedExtensions(), |
| 65 NULL, | 65 NULL, |
| 66 std::vector<int32>(), | 66 std::vector<int32>(), |
| 67 NULL, | |
| 68 0, | |
| 69 NULL)) { | 67 NULL)) { |
| 70 return NULL; | 68 return NULL; |
| 71 } | 69 } |
| 72 | 70 |
| 73 command_buffer->SetPutOffsetChangeCallback( | 71 command_buffer->SetPutOffsetChangeCallback( |
| 74 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); | 72 NewCallback(gpu_scheduler, &GpuScheduler::PutChanged)); |
| 75 | 73 |
| 76 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); | 74 GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); |
| 77 if (!helper->Initialize(size)) { | 75 if (!helper->Initialize(size)) { |
| 78 // TODO(gman): cleanup. | 76 // TODO(gman): cleanup. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 ::fprintf(stdout, "Could not setup window.\n"); | 222 ::fprintf(stdout, "Could not setup window.\n"); |
| 225 return EXIT_FAILURE; | 223 return EXIT_FAILURE; |
| 226 } | 224 } |
| 227 | 225 |
| 228 demo->Setup(hwnd, kCommandBufferSize); | 226 demo->Setup(hwnd, kCommandBufferSize); |
| 229 | 227 |
| 230 ProcessMessages(hwnd); | 228 ProcessMessages(hwnd); |
| 231 | 229 |
| 232 return EXIT_SUCCESS; | 230 return EXIT_SUCCESS; |
| 233 } | 231 } |
| OLD | NEW |