OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |