Request quickReject results from correct drawing canvas (flutter/engine#22674)
Also Fix MockCanvas clipping so tests will work with new culling
This commit is contained in:
@@ -195,7 +195,7 @@ class Layer {
|
||||
if (paint_bounds_.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return !context.internal_nodes_canvas->quickReject(paint_bounds_);
|
||||
return !context.leaf_nodes_canvas->quickReject(paint_bounds_);
|
||||
}
|
||||
|
||||
uint64_t unique_id() const { return unique_id_; }
|
||||
|
||||
@@ -158,6 +158,7 @@ std::unique_ptr<RasterCacheResult> RasterCache::RasterizeLayer(
|
||||
SkISize canvas_size = canvas->getBaseLayerSize();
|
||||
SkNWayCanvas internal_nodes_canvas(canvas_size.width(),
|
||||
canvas_size.height());
|
||||
internal_nodes_canvas.setMatrix(canvas->getTotalMatrix());
|
||||
internal_nodes_canvas.addCanvas(canvas);
|
||||
Layer::PaintContext paintContext = {
|
||||
/* internal_nodes_canvas= */ static_cast<SkCanvas*>(
|
||||
|
||||
@@ -148,6 +148,8 @@ void MockCanvas::onClipRect(const SkRect& rect,
|
||||
ClipEdgeStyle style) {
|
||||
draw_calls_.emplace_back(
|
||||
DrawCall{current_layer_, ClipRectData{rect, op, style}});
|
||||
// quickReject() is handled by base class and needs accurate clip information
|
||||
SkCanvas::onClipRect(rect, op, style);
|
||||
}
|
||||
|
||||
void MockCanvas::onClipRRect(const SkRRect& rrect,
|
||||
@@ -155,6 +157,8 @@ void MockCanvas::onClipRRect(const SkRRect& rrect,
|
||||
ClipEdgeStyle style) {
|
||||
draw_calls_.emplace_back(
|
||||
DrawCall{current_layer_, ClipRRectData{rrect, op, style}});
|
||||
// quickReject() is handled by base class and needs accurate clip information
|
||||
SkCanvas::onClipRRect(rrect, op, style);
|
||||
}
|
||||
|
||||
void MockCanvas::onClipPath(const SkPath& path,
|
||||
@@ -162,6 +166,8 @@ void MockCanvas::onClipPath(const SkPath& path,
|
||||
ClipEdgeStyle style) {
|
||||
draw_calls_.emplace_back(
|
||||
DrawCall{current_layer_, ClipPathData{path, op, style}});
|
||||
// quickReject() is handled by base class and needs accurate clip information
|
||||
SkCanvas::onClipPath(path, op, style);
|
||||
}
|
||||
|
||||
bool MockCanvas::onDoSaveBehind(const SkRect*) {
|
||||
|
||||
Reference in New Issue
Block a user