diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 17:01:42 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-21 17:01:42 +0000 |
commit | e7c674264be7bbbffae48e29333f40c0b46cb874 (patch) | |
tree | cf1c9169617dcca5e4e13a000429212d245189ff /o3d | |
parent | 0cce15f698f40ee35ab7ded987360ca6c7f44753 (diff) | |
download | chromium_src-e7c674264be7bbbffae48e29333f40c0b46cb874.zip chromium_src-e7c674264be7bbbffae48e29333f40c0b46cb874.tar.gz chromium_src-e7c674264be7bbbffae48e29333f40c0b46cb874.tar.bz2 |
Fixed crash on Mac OS X introduced in
http://codereview.chromium.org/1627007 /
http://codereview.chromium.org/1527030 . Ensure the renderer is
initialized before attempting to use it. Only enable new code path if
actually uploading textures via IMC.
Tested in Safari 4 on Mac OS X 10.6.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2103014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/client.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/o3d/core/cross/client.cc b/o3d/core/cross/client.cc index 6a9ebbc..f66816c 100644 --- a/o3d/core/cross/client.cc +++ b/o3d/core/cross/client.cc @@ -205,14 +205,15 @@ bool Client::Tick() { last_tick_time_ = timer.GetElapsedTimeAndReset(); texture_on_hold_ |= has_new_texture; - int max_fps = renderer_->max_fps(); - if (max_fps > 0 && - texture_on_hold_ && - render_mode() == RENDERMODE_ON_DEMAND && - render_elapsed_time_timer_.GetElapsedTimeWithoutClearing() + if (texture_on_hold_ && renderer_.IsAvailable()) { + int max_fps = renderer_->max_fps(); + if (max_fps > 0 && + render_mode() == RENDERMODE_ON_DEMAND && + render_elapsed_time_timer_.GetElapsedTimeWithoutClearing() > 1.0/max_fps) { - renderer_->set_need_to_render(true); - texture_on_hold_ = false; + renderer_->set_need_to_render(true); + texture_on_hold_ = false; + } } return message_check_ok; |