Instance Method

allocateGState()

Causes the view to maintain a private graphics state object, which encapsulates all parameters of the graphics environment.

Declaration

func allocateGState()

Discussion

If you do not invoke allocateGState(), a graphics state object is constructed from scratch each time the NSView is focused.

The view builds the graphics state parameters using setUpGState(), then automatically establishes this graphics state each time the focus is locked on it. A graphics state may improve performance for view objects that are focused often and need to set many parameters, but use of standard rendering operators is normally efficient enough.

Because graphics states occupy a fair amount of memory, they can actually degrade performance. Be sure to test application performance with and without the private graphics state before committing to its use.

See Also

Deprecated Methods

func shouldDrawColor() -> Bool

Returns a Boolean value indicating whether the view is being drawn to an environment that supports color.

Deprecated
func gState() -> Int

Returns the identifier for the view’s graphics state object, or 0 if the view doesn’t have a graphics state object.

Deprecated
func setUpGState()

Overridden by subclasses to (re)initialize the view’s graphics state object.

Deprecated
func renewGState()

Invalidates the view’s graphics state object, if it has one.

Deprecated
func releaseGState()

Frees the view’s graphics state object, if it has one.

Deprecated