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

Side by Side Diff: native_client_sdk/src/examples/demo/voronoi/voronoi.cc

Issue 16266004: Change default to not use pthreads at startup (all calculations on main thread) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « native_client_sdk/src/examples/demo/voronoi/threadpool.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 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include <assert.h> 5 #include <assert.h>
6 #include <math.h> 6 #include <math.h>
7 #include <ppapi/cpp/completion_callback.h> 7 #include <ppapi/cpp/completion_callback.h>
8 #include <ppapi/cpp/graphics_2d.h> 8 #include <ppapi/cpp/graphics_2d.h>
9 #include <ppapi/cpp/image_data.h> 9 #include <ppapi/cpp/image_data.h>
10 #include <ppapi/cpp/input_event.h> 10 #include <ppapi/cpp/input_event.h>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 width_ = 0; 194 width_ = 0;
195 height_ = 0; 195 height_ = 0;
196 stride_in_pixels_ = 0; 196 stride_in_pixels_ = 0;
197 pixel_buffer_ = NULL; 197 pixel_buffer_ = NULL;
198 benchmark_frame_counter_ = 0; 198 benchmark_frame_counter_ = 0;
199 benchmarking_ = false; 199 benchmarking_ = false;
200 200
201 point_count_ = kStartPointCount; 201 point_count_ = kStartPointCount;
202 Reset(); 202 Reset();
203 203
204 // By default, do single threaded rendering. 204 // By default, render from the dispatch thread.
205 num_threads_ = 1; 205 num_threads_ = 0;
206 workers_ = new ThreadPool(num_threads_); 206 workers_ = new ThreadPool(num_threads_);
207 207
208 // Request PPAPI input events for mouse & keyboard. 208 // Request PPAPI input events for mouse & keyboard.
209 RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); 209 RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
210 RequestInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); 210 RequestInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
211 } 211 }
212 212
213 Voronoi::~Voronoi() { 213 Voronoi::~Voronoi() {
214 delete workers_; 214 delete workers_;
215 DestroyContext(); 215 DestroyContext();
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 return new Voronoi(instance); 573 return new Voronoi(instance);
574 } 574 }
575 }; 575 };
576 576
577 namespace pp { 577 namespace pp {
578 Module* CreateModule() { 578 Module* CreateModule() {
579 return new VoronoiModule(); 579 return new VoronoiModule();
580 } 580 }
581 } // namespace pp 581 } // namespace pp
582 582
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/demo/voronoi/threadpool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698