Chromium Code Reviews| Index: cc/surfaces/surface.cc |
| diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc |
| index 065aa3822895dec4fdd64bb8d520c1aa80d45b58..488f3491dd5ace0690a5adf500848652041fe791 100644 |
| --- a/cc/surfaces/surface.cc |
| +++ b/cc/surfaces/surface.cc |
| @@ -41,11 +41,19 @@ void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame, |
| const DrawCallback& callback) { |
| DCHECK(factory_); |
| ClearCopyRequests(); |
| - TakeLatencyInfo(&frame->metadata.latency_info); |
| + |
| + if (current_frame_) { |
|
jbauman
2015/04/10 21:34:58
This should be frame, not current_frame_.
|
| + TakeLatencyInfo(¤t_frame_->metadata.latency_info); |
| + } |
| + |
| scoped_ptr<CompositorFrame> previous_frame = current_frame_.Pass(); |
| current_frame_ = frame.Pass(); |
| - factory_->ReceiveFromChild( |
| - current_frame_->delegated_frame_data->resource_list); |
| + |
| + if (current_frame_) { |
| + factory_->ReceiveFromChild( |
| + current_frame_->delegated_frame_data->resource_list); |
| + } |
| + |
| // Empty frames shouldn't be drawn and shouldn't contribute damage, so don't |
| // increment frame index for them. |
| if (!current_frame_ || |
| @@ -62,9 +70,12 @@ void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame, |
| if (!draw_callback_.is_null()) |
| draw_callback_.Run(SurfaceDrawStatus::DRAW_SKIPPED); |
| draw_callback_ = callback; |
| - factory_->manager()->DidSatisfySequences( |
| - SurfaceIdAllocator::NamespaceForId(surface_id_), |
| - ¤t_frame_->metadata.satisfies_sequences); |
| + |
| + if (current_frame_) { |
| + factory_->manager()->DidSatisfySequences( |
| + SurfaceIdAllocator::NamespaceForId(surface_id_), |
| + ¤t_frame_->metadata.satisfies_sequences); |
| + } |
| } |
| void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) { |