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

Side by Side Diff: gpu/command_buffer/client/gles2_demo.cc

Issue 7253052: Execute all GL commands up to the put offset reported by a flush. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months 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
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 }; 49 };
50 50
51 GLES2Demo::GLES2Demo() { 51 GLES2Demo::GLES2Demo() {
52 } 52 }
53 53
54 bool GLES2Demo::Setup(void* hwnd, int32 size) { 54 bool GLES2Demo::Setup(void* hwnd, int32 size) {
55 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService); 55 scoped_ptr<CommandBufferService> command_buffer(new CommandBufferService);
56 if (!command_buffer->Initialize(size)) 56 if (!command_buffer->Initialize(size))
57 return NULL; 57 return NULL;
58 58
59 GpuScheduler* gpu_scheduler = new GpuScheduler(command_buffer.get(), 59 GpuScheduler* gpu_scheduler = new GpuScheduler(
60 NULL, 60 command_buffer.get(),
61 NULL); 61 static_cast<gpu::SurfaceManager*>(NULL),
62 NULL);
62 if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd), 63 if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd),
63 gfx::Size(), 64 gfx::Size(),
64 gpu::gles2::DisallowedExtensions(), 65 gpu::gles2::DisallowedExtensions(),
65 NULL, 66 NULL,
66 std::vector<int32>(), 67 std::vector<int32>(),
67 NULL)) { 68 NULL)) {
68 return NULL; 69 return NULL;
69 } 70 }
70 71
71 command_buffer->SetPutOffsetChangeCallback( 72 command_buffer->SetPutOffsetChangeCallback(
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ::fprintf(stdout, "Could not setup window.\n"); 223 ::fprintf(stdout, "Could not setup window.\n");
223 return EXIT_FAILURE; 224 return EXIT_FAILURE;
224 } 225 }
225 226
226 demo->Setup(hwnd, kCommandBufferSize); 227 demo->Setup(hwnd, kCommandBufferSize);
227 228
228 ProcessMessages(hwnd); 229 ProcessMessages(hwnd);
229 230
230 return EXIT_SUCCESS; 231 return EXIT_SUCCESS;
231 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698