diff --git a/sky/shell/gpu/rasterizer.cc b/sky/shell/gpu/rasterizer.cc index f679b8f813c73a76a4c538ff8c68566d4cac6e01..182b97954cbec276548b6e43819dfcb65e73ffde 100644 --- a/sky/shell/gpu/rasterizer.cc +++ b/sky/shell/gpu/rasterizer.cc @@ -71,10 +71,15 @@ void Rasterizer::DrawPicture(SkPicture* picture) { } void Rasterizer::OnOutputSurfaceDestroyed() { - CHECK(context_->MakeCurrent(surface_.get())); - ganesh_surface_.reset(); - ganesh_context_.reset(); - context_ = nullptr; + if (context_) { + CHECK(context_->MakeCurrent(surface_.get())); + ganesh_surface_.reset(); + ganesh_context_.reset(); + context_ = nullptr; + } + CHECK(!ganesh_surface_); + CHECK(!ganesh_context_); + CHECK(!context_); surface_ = nullptr; } diff --git a/sky/shell/ui/animator.cc b/sky/shell/ui/animator.cc index 990d9b108339d10ef6bb14dc2b903a4a9e159602..0eb6757c1d5b890b94b4092d3786bb8602555e32 100644 --- a/sky/shell/ui/animator.cc +++ b/sky/shell/ui/animator.cc @@ -48,7 +48,6 @@ void Animator::RequestFrame() { void Animator::Stop() { paused_ = true; - engine_requested_frame_ = false; } void Animator::Start() { @@ -59,11 +58,16 @@ void Animator::Start() { void Animator::BeginFrame(int64_t time_stamp) { TRACE_EVENT_ASYNC_END0("sky", "Frame request pending", this); DCHECK(engine_requested_frame_); - engine_requested_frame_ = false; - DCHECK(outstanding_requests_ > 0); DCHECK(outstanding_requests_ <= kPipelineDepth) << outstanding_requests_; + engine_requested_frame_ = false; + + if (paused_) { + OnFrameComplete(); + return; + } + base::TimeTicks frame_time = time_stamp ? base::TimeTicks::FromInternalValue(time_stamp) : base::TimeTicks::Now();