Disable backup storage on CAShapeLayer or CALayer subclass to prevent "dummy level" error warning

I want to overlay a large one CATiledLayer

on some vector art. For starters, I would like to use CAShapeLayer

which should be replaced with some custom subclass CALayer

or delegate.

It's good that it works. However, I get this warning on every redraw:

-[<CAShapeLayer: 0x1700daa0> display]: Ignoring bogus layer size (150000.000000, 150000.000000), contentsScale 1.000000, backing store size (150000.000000, 150000.000000)

How can I get rid of this warning correctly?

I suppose I don't need a fallback store as the whole point of this layer is that it (and continuously) draws the visible part of the layer.

One (accidentally discovered) way to prevent this error is to set it layer.contentsScale

to a small value or even zero, so that there is no "bogus size" in the backup store. (this property is commonly used to make @ 2x / @ 3x devices have high-res storage)

But this looks like a hack that will break my application one day. So how can I disable the backup storage for CALayer?

CATiledLayer (a subclass of CALayer) gives no such warning despite being the same size. I've looked into subclasses of CALayer or CAShapeLayer trying to replicate the CAShapeLayer, but this is pretty confusing. The CAShapeLayer doesn't seem to play by the same rules as me; my drawInContext:

renders the pixels of the vectors, while the layer draws its own vectors crisp, even within the same CALayer. The almost undocumented property layer.contents

only applies to the backup store for my pixel lines.

Is it still possible to create a CAShapeLayer with a public API?

+3
ios vector-graphics calayer catiledlayer cashapelayer


source to share


No one has answered this question yet

Check out similar questions:

354
Fast and Fast PDF Viewer for iPhone / iPad / iOs - Tips and Tricks?
nineteen
IOS drawing in CALayers drawInContext is either pixelated or blurred on the retina
nine
Is NSView supported with a custom CALayer not calling updateLayer?
7
- [CALayer setNeedsDisplayInRect:] forces the whole layer to redraw
4
CATextLayer rasterizes too early and is blurry
3
Differences on CALayer and UIView
2
Force redrawing UIView or CALayer by scale / transform
1
UIWiew with class CAShapeLayer does not animate during device rotation
1
CALayer - strange drawInContext error
0
Forcing repainting of paused animation view layers



All Articles
Loading...
X
Show
Funny
Dev
Pics