mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The GPUSurfaceGL holds references to Skia objects that may own GL objects. If the GL objects are destructed on the GPU thread after the EGL context has been dropped, then the GL delete calls will not take effect.
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "flutter/shell/common/null_rasterizer.h"
|
|
|
|
namespace shell {
|
|
|
|
NullRasterizer::NullRasterizer() : weak_factory_(this) {}
|
|
|
|
void NullRasterizer::Setup(
|
|
std::unique_ptr<Surface> surface_or_null,
|
|
ftl::Closure rasterizer_continuation,
|
|
ftl::AutoResetWaitableEvent* setup_completion_event) {
|
|
surface_ = std::move(surface_or_null);
|
|
rasterizer_continuation();
|
|
setup_completion_event->Signal();
|
|
}
|
|
|
|
void NullRasterizer::Teardown(
|
|
ftl::AutoResetWaitableEvent* teardown_completion_event) {
|
|
if (surface_) {
|
|
surface_.reset();
|
|
}
|
|
teardown_completion_event->Signal();
|
|
}
|
|
|
|
ftl::WeakPtr<Rasterizer> NullRasterizer::GetWeakRasterizerPtr() {
|
|
return weak_factory_.GetWeakPtr();
|
|
}
|
|
|
|
flow::LayerTree* NullRasterizer::GetLastLayerTree() {
|
|
return nullptr;
|
|
}
|
|
|
|
void NullRasterizer::Clear(SkColor color, const SkISize& size) {
|
|
// Null rasterizer. Nothing to do.
|
|
}
|
|
|
|
void NullRasterizer::Draw(
|
|
ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) {
|
|
// Null rasterizer. Nothing to do.
|
|
}
|
|
|
|
} // namespace shell
|