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

Commit aba9968

Browse files
committed
Use DlRegion from R-Tree in raster cache
1 parent 7be21d0 commit aba9968

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

flow/raster_cache.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ void RasterCacheResult::draw(DlCanvas& canvas,
5353
// On some platforms RTree from overlay layers is used for unobstructed
5454
// platform views and hit testing. To preserve the RTree raster cache must
5555
// paint individual rects instead of the whole image.
56-
auto rects = rtree_->searchAndConsolidateRects(kGiantRect);
56+
auto rects = rtree_->region().getRects(true);
5757

5858
canvas.Translate(bounds.fLeft, bounds.fTop);
5959

6060
SkRect rtree_bounds =
6161
RasterCacheUtil::GetRoundedOutDeviceBounds(rtree_->bounds(), matrix);
6262
for (auto rect : rects) {
63-
rect = RasterCacheUtil::GetRoundedOutDeviceBounds(rect, matrix);
64-
rect.offset(-rtree_bounds.fLeft, -rtree_bounds.fTop);
65-
canvas.DrawImageRect(image_, rect, rect,
63+
SkRect device_rect = RasterCacheUtil::GetRoundedOutDeviceBounds(
64+
SkRect::Make(rect), matrix);
65+
device_rect.offset(-rtree_bounds.fLeft, -rtree_bounds.fTop);
66+
canvas.DrawImageRect(image_, device_rect, device_rect,
6667
DlImageSampling::kNearestNeighbor, paint);
6768
}
6869
}

0 commit comments

Comments
 (0)