| 185 | } |
| 186 | |
| 187 | void 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 | |
| 211 | void HitTestContext::drawPicture(std::shared_ptr<Picture> picture, const MCState& state) { |
| 212 | DEBUG_ASSERT(picture != nullptr); |
nothing calls this directly
no test coverage detected