[Spice-devel] [PATCH 2/2] Add patch fixing performance issue
Dmitry Fleytman
dmitry at daynix.com
Sun Aug 9 09:23:18 PDT 2015
> On Aug 5, 2015, at 18:01 PM, Marc-André Lureau <mlureau at redhat.com> wrote:
>
> Hi
>
>
> ----- Original Message -----
>> From: Kirill Moizik <kmoizik at redhat.com>
>>
>> ---
>> cairo-quartz-surface-performance-patch.patch | 61
>> ++++++++++++++++++++++++++++
>> 1 file changed, 61 insertions(+)
>> create mode 100644 cairo-quartz-surface-performance-patch.patch
>>
>
>
> The patch is lacking a commit message.
> Did you submit it to the cairo ML?
Hello Marc-Andre,
This patch is not ready for submission to the Cairo mailing lists because it introduces a somewhat “dirty” fix for for the problem.
While it is totally good for Mac client, more work is need in order to make it truly generic.
Dmitry
>
> thanks
>
>> diff --git a/cairo-quartz-surface-performance-patch.patch
>> b/cairo-quartz-surface-performance-patch.patch
>> new file mode 100644
>> index 0000000..0da3243
>> --- /dev/null
>> +++ b/cairo-quartz-surface-performance-patch.patch
>> @@ -0,0 +1,61 @@
>> +--- spice-jhbuild/source/cairo-1.14.0/src/cairo-quartz-surface.c 2014-10-14
>> 04:46:33.000000000 +0300
>> ++++ spice-jhbuild/source/cairo-1.14.0/src/cairo-quartz-surface_patched.c
>> 2015-08-05 16:29:10.000000000 +0300
>> +@@ -35,6 +35,7 @@
>> + */
>> +
>> + #define _GNU_SOURCE /* required for RTLD_DEFAULT */
>> ++#define PERFORMANCE_FIX
>> + #include "cairoint.h"
>> +
>> + #include "cairo-quartz-private.h"
>> +@@ -229,7 +230,15 @@
>> + dataProvider,
>> + decode,
>> + interpolate);
>> +- } else
>> ++ } else {
>> ++#ifdef PERFORMANCE_FIX
>> ++ CMProfileRef systemMonitorProfile = NULL;
>> ++ CMError getProfileErr = CMGetSystemProfile(&systemMonitorProfile);
>> ++ if(noErr == getProfileErr) {
>> ++ colorSpace =
>> CGColorSpaceCreateWithPlatformColorSpace(systemMonitorProfile);
>> ++ CMCloseProfile(systemMonitorProfile);
>> ++ }
>> ++#endif
>> + image = CGImageCreate (width, height,
>> + bitsPerComponent,
>> + bitsPerPixel,
>> +@@ -240,6 +249,7 @@
>> + NULL,
>> + interpolate,
>> + kCGRenderingIntentDefault);
>> ++ }
>> +
>> + FINISH:
>> +
>> +@@ -1389,7 +1399,11 @@
>> + cairo_operator_t op)
>> + {
>> + CGContextSetShouldAntialias (state->cgDrawContext, state->filter !=
>> kCGInterpolationNone);
>> ++#ifdef PERFORMANCE_FIX
>> ++ CGContextSetInterpolationQuality(state->cgDrawContext,
>> kCGInterpolationNone);
>> ++#else
>> + CGContextSetInterpolationQuality(state->cgDrawContext, state->filter);
>> ++#endif
>> +
>> + if (state->action == DO_DIRECT) {
>> + CGContextFillRect (state->cgDrawContext, state->rect);
>> +@@ -1672,7 +1686,12 @@
>> +
>> + state.filter = filter;
>> +
>> +- CGContextSetInterpolationQuality (state.cgMaskContext, filter);
>> ++#ifdef PERFORMANCE_FIX
>> ++ CGContextSetInterpolationQuality(state.cgDrawContext,
>> kCGInterpolationNone);
>> ++#else
>> ++ CGContextSetInterpolationQuality(state.cgDrawContext, filter);
>> ++#endif
>> ++
>> + CGContextSetShouldAntialias (state.cgMaskContext, filter !=
>> kCGInterpolationNone);
>> +
>> + CGContextClipToMask (state.cgMaskContext, rect, img);
>> --
>> 2.3.2 (Apple Git-55)
>>
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list