mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #384 from eseidelGoogle/resume_crash
Fix two crashes when resuming apps
This commit is contained in:
commit
f6bfb420e5
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user