Bug #: 4550
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2005 07:45:28 +0000 (07:45 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2005 07:45:28 +0000 (07:45 +0000)
Submitted by: Tobias Lidskog <tobiaslidskog@mac.com>
Reviewed by: eseidel
        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (KCanvasFilterQuartz::prepareFilter):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (KRenderingDeviceQuartz::filtersEnabled):
        (KRenderingDeviceQuartz::setFiltersEnabled):
        (KRenderingDeviceQuartz::hardwareRenderingEnabled):
        (KRenderingDeviceQuartz::setHardwareRenderingEnabled):
        Added ability to disable hardware rendering (for testing).
        http://bugzilla.opendarwin.org/show_bug.cgi?id=4550

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.mm

index 188a965..8407982 100644 (file)
@@ -1,3 +1,19 @@
+2005-08-22  Eric Seidel  <eseidel@apple.com>
+        Fix by Tobias Lidskog <tobiaslidskog@mac.com>
+
+        Reviewed by eseidel.
+
+        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
+        (KCanvasFilterQuartz::prepareFilter):
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
+        (KRenderingDeviceQuartz::filtersEnabled):
+        (KRenderingDeviceQuartz::setFiltersEnabled):
+        (KRenderingDeviceQuartz::hardwareRenderingEnabled):
+        (KRenderingDeviceQuartz::setHardwareRenderingEnabled):
+        Added ability to disable hardware rendering (for testing).
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=4550
+
 2005-08-20  Darin Adler  <darin@apple.com>
 
         * khtml/xml/xml_namespace_table.cpp: Removed this file that's been obsolete and
index 250f253..86c8a59 100644 (file)
@@ -94,7 +94,15 @@ void KCanvasFilterQuartz::prepareFilter(CGContextRef *context, const QRect &bbox
        m_storedCGContext = *context;
                
        // get a CIContext, and CGLayer for drawing in.
-       m_filterCIContext = [[CIContext contextWithCGContext:m_storedCGContext options:nil] retain];
+        bool useSoftware = ! KRenderingDeviceQuartz::hardwareRenderingEnabled();
+        NSDictionary *options = nil;
+        
+        if (useSoftware) {
+            options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCIContextUseSoftwareRenderer, nil];
+        }
+        
+       m_filterCIContext = [[CIContext contextWithCGContext:m_storedCGContext options:options] retain];
+        
        m_filterCGLayer = [m_filterCIContext createCGLayerWithSize:CGRect(bbox).size info:NULL];
        
        // replace the current context with our new one.
index 4af90b7..a973dd8 100644 (file)
@@ -88,6 +88,9 @@ public:
        // filters (mostly debugging)
        static bool filtersEnabled();
        static void setFiltersEnabled(bool enabled);
+        static bool KRenderingDeviceQuartz::hardwareRenderingEnabled();
+        static void KRenderingDeviceQuartz::setHardwareRenderingEnabled(bool enabled);
+            
 };
 
 // Wraps NSBezierPaths for c++ consumption
index bccfb0d..1c9fa54 100644 (file)
@@ -79,12 +79,24 @@ static bool __useFilters = true;
 
 bool KRenderingDeviceQuartz::filtersEnabled()
 {
-       return __useFilters;
+    return __useFilters;
 }
 
 void KRenderingDeviceQuartz::setFiltersEnabled(bool enabled)
 {
-       __useFilters = enabled;
+    __useFilters = enabled;
+}
+
+static bool __useHardwareRendering = true;
+
+bool KRenderingDeviceQuartz::hardwareRenderingEnabled()
+{
+    return __useHardwareRendering;
+}
+
+void KRenderingDeviceQuartz::setHardwareRenderingEnabled(bool enabled)
+{
+    __useHardwareRendering = enabled;
 }
 
 #pragma mark -