Title: [196054] trunk/Source/WebCore
Revision
196054
Author
[email protected]
Date
2016-02-03 00:33:31 -0800 (Wed, 03 Feb 2016)

Log Message

PlatformPathCairo: Lazily allocate the path surface
https://bugs.webkit.org/show_bug.cgi?id=153821

Reviewed by Carlos Garcia Campos.

Move the static variable that holds the Cairo surface into
the pathSurface() function (previously getPathSurface). This
way the surface will only be allocated once the function is
called for the first time from the CairoPath surface.

No change in functionality, just a cleanup.

* platform/graphics/cairo/PlatformPathCairo.cpp:
(WebCore::pathSurface):
(WebCore::CairoPath::CairoPath):
(WebCore::getPathSurface): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (196053 => 196054)


--- trunk/Source/WebCore/ChangeLog	2016-02-03 08:18:23 UTC (rev 196053)
+++ trunk/Source/WebCore/ChangeLog	2016-02-03 08:33:31 UTC (rev 196054)
@@ -1,3 +1,22 @@
+2016-02-03  Zan Dobersek  <[email protected]>
+
+        PlatformPathCairo: Lazily allocate the path surface
+        https://bugs.webkit.org/show_bug.cgi?id=153821
+
+        Reviewed by Carlos Garcia Campos.
+
+        Move the static variable that holds the Cairo surface into
+        the pathSurface() function (previously getPathSurface). This
+        way the surface will only be allocated once the function is
+        called for the first time from the CairoPath surface.
+
+        No change in functionality, just a cleanup.
+
+        * platform/graphics/cairo/PlatformPathCairo.cpp:
+        (WebCore::pathSurface):
+        (WebCore::CairoPath::CairoPath):
+        (WebCore::getPathSurface): Deleted.
+
 2016-02-02  Fujii Hironori  <[email protected]>
 
         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)

Modified: trunk/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp (196053 => 196054)


--- trunk/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp	2016-02-03 08:18:23 UTC (rev 196053)
+++ trunk/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp	2016-02-03 08:33:31 UTC (rev 196054)
@@ -26,15 +26,14 @@
 
 namespace WebCore {
 
-static cairo_surface_t* getPathSurface() 
+static cairo_surface_t* pathSurface()
 {
-    return cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
+    static cairo_surface_t* s_pathSurface = cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
+    return s_pathSurface;
 }
 
-static cairo_surface_t* gPathSurface = getPathSurface(); 
-
 CairoPath::CairoPath()
-    : m_cr(adoptRef(cairo_create(gPathSurface)))
+    : m_cr(adoptRef(cairo_create(pathSurface())))
 {
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to