Skip to content

Commit

Permalink
Add a comment about tiling mode and issue TextureGroup#1046 (TextureG…
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseoldduck authored and nguyenhuy committed Jul 24, 2018
1 parent d9d5b12 commit 1beeb9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Private/_ASCoreAnimationExtras.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage *

void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIImage *image)
{
// FIXME (https://github.com/TextureGroup/Texture/issues/1046): This method does not currently handle UIImageResizingModeTile, which is the default.
// See also https://developer.apple.com/documentation/uikit/uiimage/1624157-resizingmode?language=objc
// I'm not sure of a way to use CALayer directly to perform such tiling on the GPU, though the stretch is handled by the GPU,
// and CALayer.h documents the fact that contentsCenter is used to stretch the pixels.

if (image) {
ASDisplayNodeCAssert(image.resizingMode == UIImageResizingModeStretch || UIEdgeInsetsEqualToEdgeInsets(image.capInsets, UIEdgeInsetsZero),
@"Image insets must be all-zero or resizingMode has to be UIImageResizingModeStretch. XCode assets default value is UIImageResizingModeTile which is not supported by Texture because of GPU-accelerated CALayer features.");
Expand Down

0 comments on commit 1beeb9c

Please sign in to comment.