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

Method drawLayer

src/core/HitTestContext.cpp:187–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void HitTestContext::drawLayer(std::shared_ptr<Picture> picture,
188 std::shared_ptr<ImageFilter> imageFilter, const MCState& state,
189 const Fill& fill) {
190 DEBUG_ASSERT(picture != nullptr);
191 Point local = {};
192 if (!GetLocalPoint(state.matrix, deviceX, deviceY, &local)) {
193 return;
194 }
195 if (imageFilter) {
196 auto localBounds = shapeHitTest ? picture->getTightBounds(nullptr) : picture->getBounds();
197 localBounds = imageFilter->filterBounds(localBounds);
198 if (!localBounds.contains(local.x, local.y)) {
199 return;
200 }
201 } else {
202 if (!picture->hitTestPoint(local.x, local.y, shapeHitTest)) {
203 return;
204 }
205 }
206 if (checkClipAndFill(state.clip, fill, local)) {
207 hit = true;
208 }
209}
210
211void HitTestContext::drawPicture(std::shared_ptr<Picture> picture, const MCState& state) {
212 DEBUG_ASSERT(picture != nullptr);

Callers

nothing calls this directly

Calls 6

GetLocalPointFunction · 0.85
getTightBoundsMethod · 0.45
getBoundsMethod · 0.45
filterBoundsMethod · 0.45
containsMethod · 0.45
hitTestPointMethod · 0.45

Tested by

no test coverage detected