2008-01-04 Alp Toker <alp@atoker.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 10:44:18 +0000 (10:44 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2008 10:44:18 +0000 (10:44 +0000)
        Reviewed by Mark Rowe.

        Re-use a single static dummy surface rather than creating and
        destroying a surface for each CairoPath.

        * platform/graphics/cairo/CairoPath.h:
        (WebCore::CairoPath::CairoPath):

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

WebCore/ChangeLog
WebCore/platform/graphics/cairo/CairoPath.h

index 7f85775fc9f1367f8da75345eb98123f69d91b60..07d9cf94d73b873f024b380418da418047647981 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-04  Alp Toker  <alp@atoker.com>
+
+        Reviewed by Mark Rowe.
+
+        Re-use a single static dummy surface rather than creating and
+        destroying a surface for each CairoPath.
+
+        * platform/graphics/cairo/CairoPath.h:
+        (WebCore::CairoPath::CairoPath):
+
 2008-01-04  Mark Rowe  <mrowe@apple.com>
 
         Tiger build fix.
index 217a1288d04edc4d568d61e22532db18dc924f18..b761ce6401d99435628c998654a6479f0d481a81 100644 (file)
 
 namespace WebCore {
 
+    // This is necessary since cairo_path_fixed_t isn't exposed in Cairo's public API.
     struct CairoPath {
         cairo_t* m_cr;
 
         CairoPath()
         {
-            cairo_surface_t* pathSurface = cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
+            static cairo_surface_t* pathSurface = cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
             m_cr = cairo_create(pathSurface);
-            cairo_surface_destroy(pathSurface);
         }
 
         ~CairoPath()