HitTestResult HitTestingTreeNode::HitTest(const ParentLayerPoint& aPoint) const { // This should only ever get called if the point is inside the clip region // for this node. MOZ_ASSERT(!IsOutsideClip(aPoint)); // When event regions are disabled and we have an APZC on this node, we are // actually storing the touch-sensitive section of the composition bounds in // the clip region, and we don't need to check against the mEventRegions. // If there's no APZC, then we do need to check against the mEventRegions // (which contains the layer's visible region) for obscuration purposes. if (!gfxPrefs::LayoutEventRegionsEnabled() && GetApzc()) { return HitTestResult::HitLayer; } // convert into Layer coordinate space Maybe<LayerPoint> pointInLayerPixels = Untransform(aPoint); if (!pointInLayerPixels) { return HitTestResult::HitNothing; } LayerIntPoint point = RoundedToInt(pointInLayerPixels.ref()); // test against event regions in Layer coordinate space if (!mEventRegions.mHitRegion.Contains(point.x, point.y)) { return HitTestResult::HitNothing; } if (mForceDispatchToContent || mEventRegions.mDispatchToContentHitRegion.Contains(point.x, point.y)) { return HitTestResult::HitDispatchToContentRegion; } return HitTestResult::HitLayer; }
HitTestResult HitTestingTreeNode::HitTest(const ParentLayerPoint& aPoint) const { // This should only ever get called if the point is inside the clip region // for this node. MOZ_ASSERT(!IsOutsideClip(aPoint)); if (mOverride & EventRegionsOverride::ForceEmptyHitRegion) { return HitTestResult::HitNothing; } // convert into Layer coordinate space Maybe<LayerPoint> pointInLayerPixels = Untransform(aPoint); if (!pointInLayerPixels) { return HitTestResult::HitNothing; } LayerIntPoint point = RoundedToInt(pointInLayerPixels.ref()); // test against event regions in Layer coordinate space if (!mEventRegions.mHitRegion.Contains(point.x, point.y)) { return HitTestResult::HitNothing; } if ((mOverride & EventRegionsOverride::ForceDispatchToContent) || mEventRegions.mDispatchToContentHitRegion.Contains(point.x, point.y)) { return HitTestResult::HitDispatchToContentRegion; } return HitTestResult::HitLayer; }
bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, const SkRect* devBounds, bool isHWAntiAlias, bool hasUserStencilSettings, GrAppliedClip* out) const { SkASSERT(!fDeviceBounds.isLargest()); if (fScissorState.enabled()) { SkIRect tightScissor; if (!tightScissor.intersect(fScissorState.rect(), SkIRect::MakeWH(drawContext->width(), drawContext->height()))) { return false; } if (devBounds && IsOutsideClip(tightScissor, *devBounds)) { return false; } if (!devBounds || !IsInsideClip(fScissorState.rect(), *devBounds)) { if (fHasStencilClip) { out->makeScissoredStencil(tightScissor, &fDeviceBounds); } else { out->makeScissored(tightScissor); } return true; } } out->makeStencil(fHasStencilClip, fDeviceBounds); return true; }