未验证 提交 c092e147 编写于 作者: B Brian Osman 提交者: GitHub

Remove use of SkRect::MakeLargest (#4918)

This API is being hidden for safety reasons. Instead, use a locally
defined rect that's slightly smaller (so operations don't overflow).
上级 76f97fec
......@@ -26,8 +26,10 @@
namespace flow {
static const SkRect kGiantRect = SkRect::MakeLTRB( -1E9F, -1E9F, 1E9F, 1E9F );
DefaultLayerBuilder::DefaultLayerBuilder() {
cull_rects_.push(SkRect::MakeLargest());
cull_rects_.push(kGiantRect);
}
DefaultLayerBuilder::~DefaultLayerBuilder() = default;
......@@ -38,7 +40,7 @@ void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) {
if (sk_matrix.invert(&inverse_sk_matrix)) {
inverse_sk_matrix.mapRect(&cullRect, cull_rects_.top());
} else {
cullRect = SkRect::MakeLargest();
cullRect = kGiantRect;
}
auto layer = std::make_unique<flow::TransformLayer>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册