Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1846eb4

Browse files
committed
Replace condition with DCHECK, replace asserts with DCHECK
1 parent 18e92b2 commit 1846eb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

display_list/geometry/dl_region.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "flutter/display_list/geometry/dl_region.h"
66

7-
#include <cassert>
7+
#include "flutter/fml/logging.h"
88

99
namespace flutter {
1010

@@ -43,9 +43,9 @@ std::vector<SkIRect> DlRegion::getRects(bool deband) const {
4343
if (iter->bottom() < rect.top()) {
4444
// Went all the way to previous span line.
4545
break;
46-
} else if (iter->bottom() == rect.top() &&
47-
iter->left() == rect.left() &&
46+
} else if (iter->left() == rect.left() &&
4847
iter->right() == rect.right()) {
48+
FML_DCHECK(iter->bottom() == rect.top());
4949
rect.fTop = iter->fTop;
5050
rects.erase(iter);
5151
break;
@@ -89,7 +89,7 @@ void DlRegion::SpanLine::insertSpan(int32_t left, int32_t right) {
8989
bool DlRegion::SpanLine::spansEqual(const SpanLine& l2) const {
9090
SpanVec& spans = *this->spans;
9191
SpanVec& otherSpans = *l2.spans;
92-
assert(this != &l2);
92+
FML_DCHECK(this != &l2);
9393

9494
if (spans.size() != otherSpans.size()) {
9595
return false;
@@ -195,7 +195,7 @@ void DlRegion::addRects(std::vector<SkIRect>&& rects) {
195195
insertLine(i + 1, makeLine(y1, prevLineEnd, *line.spans));
196196
continue;
197197
}
198-
assert(y1 == line.top);
198+
FML_DCHECK(y1 == line.top);
199199
if (y2 < line.bottom) {
200200
// duplicate line
201201
auto newLine = makeLine(y2, line.bottom, *line.spans);
@@ -206,7 +206,7 @@ void DlRegion::addRects(std::vector<SkIRect>&& rects) {
206206
mark_dirty(i);
207207
break;
208208
}
209-
assert(y2 >= line.bottom);
209+
FML_DCHECK(y2 >= line.bottom);
210210
line.insertSpan(rect.fLeft, rect.fRight);
211211
mark_dirty(i);
212212
y1 = line.bottom;

0 commit comments

Comments
 (0)