Optimize setting fill and stroke color in cairo quartz backend

NEW
Unassigned

Status

()

Core
Graphics
8 years ago
7 years ago

People

(Reporter: jrmuizel, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
We spend more time than necessary in:

CGContextSetRGBStrokeColor ();
CGContextSetRGBFillColor ();

When these are called they construct a new CGColorSpace and compare the color components with old fill/stroke color. If the components aren't equal then they construct a new CGColor and set that using CGContextSet(Stroke/Fill)ColorWithColor.

Further we call both functions each time we call _cairo_quartz_setup_source.

The simplest thing we can do here is avoid calling both in _cairo_quartz_setup_source.

The ideal thing would be to take advantage of the fact that set_source_rgb already does a comparison of the colors and have it communicate source changes to the backend instead of passing all the state into the _fill()/_stroke() functions. Then we could keep a DeviceRGB color space around and construct a new CGColor everytime the source pattern changes.
(Reporter)

Updated

8 years ago
Blocks: 577623
You need to log in before you can comment on or make changes to this bug.