Merging r50522 through r50572 from trunk into soc-2011-tomato
[blender.git] / intern / cycles / render / session.cpp
index 0efbcb8afd33ce6a4918c204544b60f49394f774..05c57ba48ecad8063303a405f91984ecd255170a 100644 (file)
@@ -140,6 +140,12 @@ void Session::reset_gpu(BufferParams& buffer_params, int samples)
        pause_cond.notify_all();
 }
 
+bool Session::resetting_gpu() const
+{
+       /* no need to wait for gpu device */
+       return false;
+}
+
 bool Session::draw_gpu(BufferParams& buffer_params)
 {
        /* block for buffer access */
@@ -290,6 +296,11 @@ void Session::reset_cpu(BufferParams& buffer_params, int samples)
        pause_cond.notify_all();
 }
 
+bool Session::resetting_cpu() const
+{
+       return device->task_cancelled();
+}
+
 bool Session::draw_cpu(BufferParams& buffer_params)
 {
        thread_scoped_lock display_lock(display_mutex);
@@ -584,6 +595,14 @@ void Session::reset(BufferParams& buffer_params, int samples)
                reset_cpu(buffer_params, samples);
 }
 
+bool Session::resetting() const
+{
+       if(device_use_gl)
+               return resetting_gpu();
+       else
+               return resetting_cpu();
+}
+
 void Session::set_samples(int samples)
 {
        if(samples != params.samples) {