| 853 | } |
| 854 | |
| 855 | void DisplayList::drawRootLayer(Surface* surface, const Rect& drawRect, const Matrix& viewMatrix, |
| 856 | bool autoClear) const { |
| 857 | DEBUG_ASSERT(surface != nullptr); |
| 858 | auto canvas = surface->getCanvas(); |
| 859 | auto context = surface->getContext(); |
| 860 | AutoCanvasRestore autoRestore(canvas); |
| 861 | auto surfaceRect = Rect::MakeWH(surface->width(), surface->height()); |
| 862 | bool fullScreen = drawRect == surfaceRect; |
| 863 | if (!fullScreen) { |
| 864 | canvas->clipRect(drawRect); |
| 865 | } |
| 866 | if (autoClear) { |
| 867 | canvas->clear(); |
| 868 | } |
| 869 | canvas->setMatrix(viewMatrix); |
| 870 | DrawArgs args(context); |
| 871 | DEBUG_ASSERT(viewMatrix.invertible()); |
| 872 | Matrix inverse = Matrix::I(); |
| 873 | viewMatrix.invert(&inverse); |
| 874 | auto renderRect = inverse.mapRect(drawRect); |
| 875 | renderRect.roundOut(); |
| 876 | args.renderRect = &renderRect; |
| 877 | args.backgroundContext = _root->createBackgroundContext(context, drawRect, viewMatrix); |
| 878 | _root->drawLayer(args, canvas, 1.0f, BlendMode::SrcOver); |
| 879 | } |
| 880 | |
| 881 | } // namespace tgfx |
nothing calls this directly
no test coverage detected