Remove use of SkRect::MakeLargest (flutter/engine#4918)

This API is being hidden for safety reasons. Instead, use a locally
defined rect that's slightly smaller (so operations don't overflow).
This commit is contained in:
Brian Osman
2018-04-02 14:36:15 -04:00
committed by GitHub
parent 2e34fd3575
commit 959fc0357a

View File

@@ -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>();