MCPcopy Create free account
hub / github.com/Tencent/tgfx / drawRootLayer

Method drawRootLayer

src/layers/DisplayList.cpp:855–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

853}
854
855void 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

Callers

nothing calls this directly

Calls 13

clipRectMethod · 0.80
invertibleMethod · 0.80
invertMethod · 0.80
roundOutMethod · 0.80
getCanvasMethod · 0.45
getContextMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
clearMethod · 0.45
setMatrixMethod · 0.45
mapRectMethod · 0.45

Tested by

no test coverage detected