-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace old render cache API with new implementation.
- Loading branch information
Showing
7 changed files
with
52 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
sdk/src/main/java/com/mapbox/maps/RenderCacheOptionsExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.mapbox.maps | ||
|
||
/** | ||
* Set render cache size to 0MB in order to disable it. | ||
*/ | ||
fun RenderCacheOptions.Builder.setDisabled(): RenderCacheOptions.Builder = also { | ||
size(RENDER_CACHE_DISABLED) | ||
} | ||
|
||
/** | ||
* Set render cache size to small(64MB). | ||
* | ||
* Works best with devices with not so powerful GPUs, or devices with pixel ratio of 1.0. | ||
*/ | ||
fun RenderCacheOptions.Builder.setSmallSize(): RenderCacheOptions.Builder = also { | ||
size(RENDER_CACHE_SIZE_SMALL_MB) | ||
} | ||
|
||
/** | ||
* Set render cache size to large(128MB). | ||
* | ||
* Works best with devices powerful GPUs, or devices with pixel ratio > 1.0. | ||
*/ | ||
fun RenderCacheOptions.Builder.setLargeSize(): RenderCacheOptions.Builder = also { | ||
size(RENDER_CACHE_SIZE_LARGE_MB) | ||
} | ||
|
||
/** | ||
* Static variables. | ||
*/ | ||
internal const val RENDER_CACHE_DISABLED = 0 | ||
internal const val RENDER_CACHE_SIZE_SMALL_MB = 64 | ||
internal const val RENDER_CACHE_SIZE_LARGE_MB = 128 |