-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.4.0 #638
Release 2.4.0 #638
Conversation
Scheduler pause/resume
WalkthroughThe recent updates to the Open Mobile Maps project introduce significant enhancements, particularly in rendering and scheduling functionalities. Notable improvements include support for pass masking in OpenGL, refined gesture handling for macOS applications, and upgraded dependencies for better performance. The integration of zoom handling in coordinate transformations enriches user interactions with maps. Overall, these changes enhance both the operational reliability and user experience of the software. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MCMapView
participant GestureHandler
participant MapCamera
User->>MCMapView: Interact with map
MCMapView->>GestureHandler: Recognize gesture (pinch/pan)
GestureHandler->>MapCamera: Adjust zoom or position
MapCamera-->>MCMapView: Update view based on gesture
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (4)
CHANGELOG.md (1)
8-8
: Correct capitalization for "Mac".The term "mac" should be capitalized as "Mac" to refer to Apple's computer.
- Improving gesture handling for iOS mac apps + Improving gesture handling for iOS Mac appsTools
LanguageTool
[grammar] ~8-~8: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...id - Improving gesture handling for iOS mac apps - Other fixes and stability imrpov...(APPLE_PRODUCTS)
djinni/map/core.djinni (2)
165-165
: Enhance documentation forcoord_from_screen_position_zoom
.Consider adding documentation to describe the purpose and parameters of
coord_from_screen_position_zoom
, especially how the zoom factor influences the coordinate conversion.
168-168
: Enhance documentation forscreen_pos_from_coord_zoom
.Consider adding documentation to describe the purpose and parameters of
screen_pos_from_coord_zoom
, particularly how the zoom factor affects screen position calculation.Package.swift (1)
141-178
: Header Search Paths Do Not Match Current Directory StructureThe header search paths specified in
Package.swift
do not correspond to any existing directories undersrc
. This suggests that the paths may be outdated or incorrect given the current project structure.
- Verify and update the header search paths in
Package.swift
to align with the actual directory structure.- Ensure that all necessary headers are correctly included in the project.
Analysis chain
Verify the correctness of header search paths.
The updated header search paths in
Package.swift
improve specificity. Ensure these paths correctly reflect the current project structure and include all necessary headers.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of updated header search paths in the project. # Test: Check if the specified directories exist. Expect: All directories should be present. fd --type d --exact-depth 1 'src' | grep -E 'external/pugixml|external/gpc|logger|map/layers/tiled/vector/sublayers|map/layers/polygon'Length of output: 135
Script:
#!/bin/bash # Description: Verify the existence of updated header search paths in the project. # Test: Check if the specified directories exist at any depth under 'src'. fd --type d 'src' | grep -E 'external/pugixml|external/gpc|logger|map/layers/tiled/vector/sublayers|map/layers/polygon'Length of output: 119
Script:
#!/bin/bash # Description: List all directories under 'src' to verify the existence and correct naming of header search paths. # List all directories under 'src' to manually verify against expected paths. fd --type d 'src'Length of output: 42
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (29)
- CHANGELOG.md (1 hunks)
- Package.swift (1 hunks)
- android/build.gradle (1 hunks)
- android/gradle.properties (1 hunks)
- android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
- android/readme.md (3 hunks)
- bridging/android/java/io/openmobilemaps/mapscore/shared/map/MapCamera2dInterface.kt (2 hunks)
- bridging/android/jni/map/NativeMapCamera2dInterface.cpp (2 hunks)
- bridging/ios/MCMapCamera2dInterface+Private.mm (1 hunks)
- bridging/ios/MCMapCamera2dInterface.h (1 hunks)
- djinni/map/core.djinni (1 hunks)
- ios/graphics/Model/Polygon/Polygon2d.swift (3 hunks)
- ios/maps/MCMapView.swift (2 hunks)
- ios/maps/MCMapViewTouchHandler.swift (3 hunks)
- ios/readme.md (1 hunks)
- shared/public/CollisionGrid.h (1 hunks)
- shared/public/MapCamera2dInterface.h (1 hunks)
- shared/public/Tiled2dMapVersionedTileInfo.h (1 hunks)
- shared/public/Value.h (1 hunks)
- shared/src/MapsCoreSharedModule.cpp (1 hunks)
- shared/src/graphics/Renderer.cpp (3 hunks)
- shared/src/map/MapScene.cpp (2 hunks)
- shared/src/map/camera/MapCamera2d.cpp (3 hunks)
- shared/src/map/camera/MapCamera2d.h (1 hunks)
- shared/src/map/layers/text/TextHelper.cpp (2 hunks)
- shared/src/map/layers/tiled/vector/geojson/GeoJsonHelperInterface.cpp (1 hunks)
- shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1 hunks)
- shared/src/map/scheduling/ThreadPoolSchedulerImpl.cpp (5 hunks)
- shared/src/map/scheduling/ThreadPoolSchedulerImpl.h (1 hunks)
Files skipped from review due to trivial changes (5)
- android/gradle.properties
- shared/public/Value.h
- shared/src/MapsCoreSharedModule.cpp
- shared/src/map/layers/text/TextHelper.cpp
- shared/src/map/layers/tiled/vector/geojson/GeoJsonHelperInterface.cpp
Additional context used
LanguageTool
CHANGELOG.md
[grammar] ~8-~8: Did you mean Apple’s computer “Mac” (= trademark, capitalized)?
Context: ...id - Improving gesture handling for iOS mac apps - Other fixes and stability imrpov...(APPLE_PRODUCTS)
Markdownlint
android/readme.md
185-185: Column: 1
Hard tabs(MD010, no-hard-tabs)
186-186: Column: 1
Hard tabs(MD010, no-hard-tabs)
327-327: Column: 1
Hard tabs(MD010, no-hard-tabs)
328-328: Column: 1
Hard tabs(MD010, no-hard-tabs)
Additional comments not posted (53)
android/gradle/wrapper/gradle-wrapper.properties (1)
16-16
: Verify compatibility with Gradle 8.2.The update to Gradle 8.2 should be verified for compatibility with existing build scripts and plugins used in the project. Ensure that there are no deprecated features or breaking changes affecting the build process.
shared/public/Tiled2dMapVersionedTileInfo.h (1)
47-47
: LGTM! Verify compatibility oftileVersion
usage.The change to use
size_t
for hashingtileVersion
is appropriate. Ensure that all uses oftileVersion
in the codebase are compatible withsize_t
, especially if they previously assumed anint
type.Verification successful
Verified:
tileVersion
is consistently used assize_t
.The change to use
size_t
fortileVersion
is compatible throughout the fileTiled2dMapVersionedTileInfo.h
. All occurrences align with this type, confirming the appropriateness of the change. No further issues found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all uses of `tileVersion` are compatible with `size_t`. # Test: Search for `tileVersion` usage in the codebase. # Expect: All occurrences are compatible with `size_t`. rg --type cpp 'tileVersion'Length of output: 795
shared/src/map/scheduling/ThreadPoolSchedulerImpl.h (1)
77-77
: LGTM! Verify integration ofpaused
variable.The addition of the
paused
variable enhances task scheduling control. Ensure that this variable is correctly integrated and utilized in the class methods to manage task execution appropriately.Verification successful
Integration of
paused
variable verified.The
paused
variable is well-integrated into the task scheduling logic ofThreadPoolSchedulerImpl
. It is used in several conditional checks and assignments, effectively controlling task execution flow.
- Verified usage in conditional checks and assignments within the implementation file.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of the `paused` variable in the class methods. # Test: Search for the usage of `paused` in the class methods. # Expect: Proper integration and usage in task scheduling logic. rg --type cpp 'paused' shared/src/map/scheduling/ThreadPoolSchedulerImpl.hLength of output: 110
Script:
#!/bin/bash # Description: Verify the integration of the `paused` variable in the implementation file. # Find the implementation file for ThreadPoolSchedulerImpl. fd 'ThreadPoolSchedulerImpl' --type f --extension cpp --exec rg --type cpp 'paused' {}Length of output: 366
shared/src/graphics/Renderer.cpp (3)
35-35
: Consolidate stencil condition checks.The introduction of
usesStencil
simplifies the condition checks for stencil operations. This change improves code readability and potentially enhances performance by reducing redundant checks.
45-48
: Verify stencil operations logic.The logic for handling stencil operations now depends on
usesStencil
. Ensure that this change correctly reflects the intended behavior and that no scenarios are missed.Verification successful
Stencil Operations Logic Verified
The logic for handling stencil operations using
usesStencil
is correctly implemented. The conditions for stencil operations are appropriately defined and used, ensuring no scenarios are missed. The change reflects the intended behavior.
usesStencil
is defined based onhasMask
andisPassMasked
, ensuring stencil operations are only performed when necessary.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of stencil operations logic. # Test: Search for the usage of `preRenderStencilMask` and `postRenderStencilMask`. # Expect: Correct usage of `usesStencil` and no missed scenarios. rg --type cpp -A 5 $'preRenderStencilMask|postRenderStencilMask'Length of output: 9657
Script:
#!/bin/bash # Description: Verify the definition and usage of `usesStencil` to ensure no scenarios are missed. # Search for the definition of `usesStencil` and its usage in the codebase. rg --type cpp -A 5 'usesStencil'Length of output: 1370
65-65
: Ensure stencil operations are properly closed.The call to
postRenderStencilMask
is conditioned onusesStencil
. Verify that stencil operations are correctly initiated and concluded in all cases.Verification successful
Stencil operations are properly closed.
The stencil operations are correctly initiated and concluded across the codebase. The use of
glEnable(GL_STENCIL_TEST)
andglDisable(GL_STENCIL_TEST)
ensures that stencil operations are managed properly.
OpenGlContext.cpp
: Stencil operations are enabled and disabled correctly.LineGroup2dOpenGl.cpp
: Stencil operations are also managed correctly here.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Ensure stencil operations are properly closed. # Test: Search for the usage of `postRenderStencilMask`. # Expect: Proper closure of stencil operations in all relevant scenarios. rg --type cpp -A 5 $'postRenderStencilMask'Length of output: 6227
Script:
#!/bin/bash # Search for stencil test enabling to ensure it is paired with postRenderStencilMask rg --type cpp -A 5 $'glEnable(GL_STENCIL_TEST)'Length of output: 48
Script:
#!/bin/bash # Search for any stencil-related operations to verify if stencil operations are used and properly closed rg --type cpp -A 5 $'STENCIL'Length of output: 2776
bridging/ios/MCMapCamera2dInterface.h (2)
87-88
: Add method for coordinate transformation with zoom.The method
coordFromScreenPositionZoom
is a valuable addition for handling coordinate transformations with zoom consideration. Ensure that it integrates well with the existing interface.
92-93
: Add method for screen position conversion with zoom.The method
screenPosFromCoordZoom
complements the interface by enabling conversion of coordinates to screen positions with zoom consideration. This addition is consistent with existing functionality.shared/public/MapCamera2dInterface.h (2)
80-81
: Add virtual method for coordinate transformation with zoom.The virtual method
coordFromScreenPositionZoom
enhances the interface by allowing coordinate transformations with zoom consideration. Ensure implementations adhere to this new method.
84-85
: Add virtual method for screen position conversion with zoom.The virtual method
screenPosFromCoordZoom
is a valuable addition for converting coordinates to screen positions with zoom consideration. This aligns well with existing interface methods.android/build.gradle (1)
20-22
: Version updates approved. Verify compatibility.The updates to AGP, Kotlin, and KSP versions are straightforward. Ensure that the rest of the project is compatible with these new versions and that any new features or deprecations are addressed.
ios/graphics/Model/Polygon/Polygon2d.swift (2)
23-24
: Introduction ofrenderPassStencilState
approved.The addition of
renderPassStencilState
enhances the management of stencil states during rendering operations.
Line range hint
35-73
:
Enhancements torender
method approved. Verify rendering performance.The updates to the
render
method improve handling of masked rendering passes. Ensure that these changes do not negatively impact rendering performance.ios/maps/MCMapViewTouchHandler.swift (3)
78-100
: Ensure comprehensive testing forhandlePan
.The
handlePan
method effectively handles pan gestures by mapping gesture states to touch events. Ensure that this functionality is thoroughly tested across different gesture scenarios to maintain robustness.
102-144
: Ensure comprehensive testing forhandlePinch
.The
handlePinch
method manages pinch gestures, converting them into touch events. Verify that this method is tested for various pinch scales and positions to ensure accurate touch event generation.
161-174
: Review the private extensions for touch conversion.The extensions for converting
UITouch
andCGPoint
arrays into touch events encapsulate functionality well. Ensure that these conversions are accurate and consistent with the expected touch event data.shared/src/map/camera/MapCamera2d.h (2)
124-124
: Addition ofcoordFromScreenPositionZoom
method.The new method
coordFromScreenPositionZoom
enhances the class by allowing coordinate conversion with a zoom factor. Ensure that this method is implemented in derived classes.
128-128
: Addition ofscreenPosFromCoordZoom
method.The new method
screenPosFromCoordZoom
provides functionality to convert coordinates to screen positions with zoom consideration. Verify its implementation in derived classes.shared/src/map/scheduling/ThreadPoolSchedulerImpl.cpp (9)
35-37
: Conditional notification for delayed tasks.The notification to
delayedTasksCv
is now conditional on thepaused
state. This prevents unnecessary wake-ups when the scheduler is paused, improving efficiency.
55-57
: Conditional notification for default tasks.The notification to
defaultCv
is gated by thepaused
flag, ensuring no tasks are processed when paused. This change enhances task scheduling control.
100-100
: Introduction ofpaused
state inpause
method.The
paused
flag is set to true, effectively pausing task execution. This addition allows for better control over the task lifecycle.
104-106
: Resuming tasks with notifications.The
resume
method clears thepaused
state and notifies all waiting threads. This ensures tasks can resume processing efficiently.
155-157
: Handling paused state in scheduler thread.The main loop now checks the
paused
state, skipping task execution when paused. This prevents unnecessary task processing.
160-160
: Loop condition updated for paused state.The while loop condition now includes a check for
paused
, ensuring tasks are not executed when the scheduler is paused.
225-225
: Detaching thread upon termination.The
makeDelayedTasksThread
method detaches the thread if terminated, ensuring proper cleanup and resource management.
232-234
: Checking paused state in delayed tasks thread.The loop in
makeDelayedTasksThread
now checks thepaused
state, preventing task execution when paused. This maintains consistency with the main scheduler thread.
236-236
: Iterating over delayed tasks with pause check.The iteration over delayed tasks includes a check for
paused
, ensuring tasks are not scheduled when the scheduler is paused.bridging/ios/MCMapCamera2dInterface+Private.mm (2)
250-257
: Addition ofcoordFromScreenPositionZoom
method.The method
coordFromScreenPositionZoom
enhances the interface by allowing conversion with zoom consideration. Exception handling ensures robustness.
266-273
: Addition ofscreenPosFromCoordZoom
method.The method
screenPosFromCoordZoom
provides functionality to convert coordinates to screen positions with zoom consideration. The use of exception handling is commendable.ios/maps/MCMapView.swift (6)
328-350
: Gesture recognizers setup for macOS is well-implemented.The method
setupMacGestureRecognizersIfNeeded
correctly configures pinch and pan gestures for macOS. The use ofrequire(toFail:)
ensures proper gesture interaction.
352-354
: Simultaneous gesture recognition is correctly enabled.The method
gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:)
correctly allows simultaneous gesture recognition by returningtrue
.
356-358
: Gesture recognition initiation is correctly configured.The method
gestureRecognizerShouldBegin
correctly allows gestures to begin by returningtrue
.
360-362
: Pinch gesture handling is correctly delegated.The method
pinched
correctly delegates pinch gesture handling totouchHandler.handlePinch
.
364-366
: Pan gesture handling is correctly delegated.The method
panned
correctly delegates pan gesture handling totouchHandler.handlePan
.
Line range hint
368-387
: Map readiness callback handling is well-implemented.The class
MCMapViewMapReadyCallbacks
correctly implements map readiness callbacks with appropriate synchronization using semaphores.ios/readme.md (1)
34-34
: Version update formaps-core
dependency is appropriate.The update from version
2.3.0
to2.4.0
for themaps-core
dependency aligns with the release objectives and ensures the use of the latest features and fixes.android/readme.md (3)
68-68
: Version update formapscore
dependency is appropriate.The update from version
2.3.0
to2.4.0
for themapscore
dependency ensures the use of the latest features and fixes, aligning with the release objectives.
327-328
: Enhancements in line rendering options are well-implemented.The addition of
dotted
anddottedSkew
properties to theLine
object enhances line rendering options, allowing more control over visual representation.Tools
Markdownlint
327-327: Column: 1
Hard tabs(MD010, no-hard-tabs)
328-328: Column: 1
Hard tabs(MD010, no-hard-tabs)
185-186
: Verify changes ingetZoomInfo
parameters.The reduction of
numDrawPreviousLayers
from10
to2
and settingnumDrawPreviousOrLaterTLayers
to0
may impact performance and visual output. Ensure these changes align with the intended behavior.Tools
Markdownlint
185-185: Column: 1
Hard tabs(MD010, no-hard-tabs)
186-186: Column: 1
Hard tabs(MD010, no-hard-tabs)
shared/public/CollisionGrid.h (1)
58-59
: Ensure Robustness with Conditional Checks.The added conditional checks for
cellSize
ensure that division operations are safe and prevent potential division by zero errors. This enhances the robustness of the code.shared/src/map/MapScene.cpp (2)
391-392
: Synchronize Scheduler State inresume()
.The addition of
scheduler->resume()
ensures that the scheduler's state is updated before resuming the layers. This synchronization is crucial for maintaining consistent state management.
412-413
: Synchronize Scheduler State inpause()
.The addition of
scheduler->pause()
ensures that the scheduler's state is updated after pausing the layers. This helps maintain consistent state management across the scene.bridging/android/java/io/openmobilemaps/mapscore/shared/map/MapCamera2dInterface.kt (4)
73-74
: Enhance Precision with Zoom Parameter incoordFromScreenPositionZoom
.The new method
coordFromScreenPositionZoom
allows for coordinate transformations with a zoom factor, enhancing precision in mapping operations.
77-78
: Enhance Precision with Zoom Parameter inscreenPosFromCoordZoom
.The new method
screenPosFromCoordZoom
facilitates screen position transformations with a zoom factor, improving precision in graphical applications.
280-285
: Implement Native Function forcoordFromScreenPositionZoom
.The implementation of
coordFromScreenPositionZoom
ensures that the method is only used on non-destroyed objects, maintaining integrity and extending functionality.
292-297
: Implement Native Function forscreenPosFromCoordZoom
.The implementation of
screenPosFromCoordZoom
includes assertions to ensure operations are performed on valid objects, maintaining integrity while extending capabilities.bridging/android/jni/map/NativeMapCamera2dInterface.cpp (2)
283-291
: Ensure Exception Safety in JNI Function:native_1coordFromScreenPositionZoom
.The function correctly wraps the logic in a try-catch block with
JNI_TRANSLATE_EXCEPTIONS_RETURN
. This ensures that any C++ exceptions are translated into JNI exceptions, maintaining robustness in the JNI interface.
302-310
: Ensure Exception Safety in JNI Function:native_1screenPosFromCoordZoom
.This function also uses a try-catch block with
JNI_TRANSLATE_EXCEPTIONS_RETURN
, ensuring that exceptions are properly handled and translated into JNI exceptions.shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1)
190-190
: Robustness Improvement: Skip Negative Glyph Indices.The addition of
if (i.glyphIndex < 0) continue;
effectively prevents processing invalid glyph indices, enhancing the robustness of the glyph handling logic and preventing potential runtime errors.shared/src/map/camera/MapCamera2d.cpp (4)
Line range hint
787-799
: Enhanced Functionality:coordFromScreenPositionZoom
.This method now includes a zoom parameter, allowing for more precise coordinate transformations that account for zoom levels. The use of trigonometric functions and coordinate adjustments appears correct.
804-806
: Consistent Zoom Handling: UpdatedcoordFromScreenPosition
.This method now delegates to
coordFromScreenPositionZoom
, ensuring consistent application of zoom across coordinate transformations.
Line range hint
808-835
: New Method:screenPosFromCoordZoom
.This method introduces zoom handling in the conversion from coordinates to screen positions. It correctly uses trigonometric transformations and ensures that the zoom factor is applied.
837-839
: Consistent Zoom Handling: UpdatedscreenPosFromCoord
.This method now calls
screenPosFromCoordZoom
, ensuring that zoom is consistently applied in screen position calculations.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores