OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 if (have_offscreen_surfaces) { | 379 if (have_offscreen_surfaces) { |
380 renderer_->SetRenderSurfaces(NULL, NULL, false); | 380 renderer_->SetRenderSurfaces(NULL, NULL, false); |
381 renderer_->FinishRendering(); | 381 renderer_->FinishRendering(); |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 bool Client::IsRendering() { | 385 bool Client::IsRendering() { |
386 return (renderer_.IsAvailable() && renderer_->rendering()); | 386 return (renderer_.IsAvailable() && renderer_->rendering()); |
387 } | 387 } |
388 | 388 |
| 389 bool Client::NeedsRender() { |
| 390 return NeedsContinuousRender() || renderer_->need_to_render(); |
| 391 } |
| 392 |
389 bool Client::NeedsContinuousRender() { | 393 bool Client::NeedsContinuousRender() { |
390 bool needRender = false; | 394 bool needRender = false; |
391 // Only may happen in RENDERMODE_CONTINUOUS mode. | 395 // Only may happen in RENDERMODE_CONTINUOUS mode. |
392 if (render_mode() == RENDERMODE_CONTINUOUS) { | 396 if (render_mode() == RENDERMODE_CONTINUOUS) { |
393 // Always need a draw in normal RENDERMODE_CONTINUOUS mode. | 397 // Always need a draw in normal RENDERMODE_CONTINUOUS mode. |
394 needRender = true; | 398 needRender = true; |
395 | 399 |
396 if (renderer_.IsAvailable()) { | 400 if (renderer_.IsAvailable()) { |
397 // If max_fps has been set, only need a draw when "long time no draw". | 401 // If max_fps has been set, only need a draw when "long time no draw". |
398 int max_fps = renderer_->max_fps(); | 402 int max_fps = renderer_->max_fps(); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 } | 653 } |
650 | 654 |
651 String Client::ProfileToString() { | 655 String Client::ProfileToString() { |
652 StringWriter string_writer(StringWriter::LF); | 656 StringWriter string_writer(StringWriter::LF); |
653 JsonWriter json_writer(&string_writer, 2); | 657 JsonWriter json_writer(&string_writer, 2); |
654 profiler_->Write(&json_writer); | 658 profiler_->Write(&json_writer); |
655 json_writer.Close(); | 659 json_writer.Close(); |
656 return string_writer.ToString(); | 660 return string_writer.ToString(); |
657 } | 661 } |
658 } // namespace o3d | 662 } // namespace o3d |
OLD | NEW |