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

Method drawTileTask

src/layers/DisplayList.cpp:777–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777void DisplayList::drawTileTask(const DrawTask& task) const {
778 auto surface = surfaceCaches[task.sourceIndex()].get();
779 DEBUG_ASSERT(surface != nullptr);
780 auto canvas = surface->getCanvas();
781 AutoCanvasRestore autoRestore(canvas);
782 auto currentZoomScale = ToZoomScaleFloat(_zoomScaleInt, _zoomScalePrecision);
783 DEBUG_ASSERT(currentZoomScale != 0.0f);
784 auto viewMatrix = Matrix::MakeScale(currentZoomScale);
785 auto& tileRect = task.tileRect();
786 auto& sourceRect = task.sourceRect();
787 auto offsetX = sourceRect.left - tileRect.left;
788 auto offsetY = sourceRect.top - tileRect.top;
789 viewMatrix.postTranslate(offsetX, offsetY);
790 auto clipRect = tileRect;
791 clipRect.offset(offsetX, offsetY);
792 drawRootLayer(surface, clipRect, viewMatrix, true);
793}
794
795void DisplayList::drawScreenTasks(std::vector<DrawTask> screenTasks, Surface* surface,
796 bool autoClear) const {

Callers

nothing calls this directly

Calls 6

ToZoomScaleFloatFunction · 0.85
sourceIndexMethod · 0.80
postTranslateMethod · 0.80
getMethod · 0.45
getCanvasMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected