[PATCH 2/2] Add patch fixing performance issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kirill Moizik <kmoizik@xxxxxxxxxx>

---
 cairo-quartz-surface-performance-patch.patch | 61 ++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 cairo-quartz-surface-performance-patch.patch

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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]