Fix layer hoisting bug in SkCanvas::drawPicture path
Most of this CL is just reordering to better match the MultiPictureDraw variant. The only functional change is that we now use the device space bounds as the queryRect to the layer hoisting code. This is necessary since the layer hoisting does all its work in device space. Review URL: https://codereview.chromium.org/942853002
This commit is contained in:
parent
a82f562725
commit
e5524cd52d
@ -1861,17 +1861,22 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
|
||||
return false;
|
||||
}
|
||||
|
||||
SkRect clipBounds;
|
||||
if (!mainCanvas->getClipBounds(&clipBounds)) {
|
||||
return true;
|
||||
const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data);
|
||||
if (0 == gpuData->numBlocks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRect());
|
||||
|
||||
const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
|
||||
|
||||
SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
|
||||
|
||||
SkIRect iBounds;
|
||||
if (!mainCanvas->getClipDeviceBounds(&iBounds)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SkRect clipBounds = SkRect::Make(iBounds);
|
||||
|
||||
SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
|
||||
|
||||
GrLayerHoister::FindLayersToAtlas(fContext, mainPicture,
|
||||
initialMatrix,
|
||||
clipBounds,
|
||||
@ -1882,6 +1887,8 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
|
||||
|
||||
SkTDArray<GrHoistedLayer> needRendering, recycled;
|
||||
|
||||
SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRect());
|
||||
|
||||
GrLayerHoister::FindLayersToHoist(fContext, mainPicture,
|
||||
initialMatrix,
|
||||
clipBounds,
|
||||
|
Loading…
Reference in New Issue
Block a user