Title: [89057] trunk/Source/WebCore
Revision
89057
Author
[email protected]
Date
2011-06-16 12:14:29 -0700 (Thu, 16 Jun 2011)

Log Message

2011-06-16  una sabovic  <[email protected]>

        Reviewed by Simon Fraser.

        Optimization: do a single fillRect when painting the root background in RenderBoxModelObject::paintFillLayerExtended
        https://bugs.webkit.org/show_bug.cgi?id=62593

        When painting the root background, instead of doing two fillRects blend the base with background color and do a single fillRect.

        No new tests. This is an optimization and it doesn't change any existing functionality.

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89056 => 89057)


--- trunk/Source/WebCore/ChangeLog	2011-06-16 19:11:32 UTC (rev 89056)
+++ trunk/Source/WebCore/ChangeLog	2011-06-16 19:14:29 UTC (rev 89057)
@@ -1,3 +1,17 @@
+2011-06-16  una sabovic  <[email protected]>
+
+        Reviewed by Simon Fraser.
+
+        Optimization: do a single fillRect when painting the root background in RenderBoxModelObject::paintFillLayerExtended
+        https://bugs.webkit.org/show_bug.cgi?id=62593
+
+        When painting the root background, instead of doing two fillRects blend the base with background color and do a single fillRect.
+        
+        No new tests. This is an optimization and it doesn't change any existing functionality.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
 2011-06-16  Ryosuke Niwa  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (89056 => 89057)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-06-16 19:11:32 UTC (rev 89056)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-06-16 19:14:29 UTC (rev 89057)
@@ -741,18 +741,22 @@
         IntRect backgroundRect(scrolledPaintRect);
         backgroundRect.intersect(paintInfo.rect);
         // If we have an alpha and we are painting the root element, go ahead and blend with the base background color.
+        Color baseColor;
         if (isOpaqueRoot) {
-            Color baseColor = view()->frameView()->baseBackgroundColor();
-            if (baseColor.alpha() > 0) {
-                CompositeOperator previousOperator = context->compositeOperation();
-                context->setCompositeOperation(CompositeCopy);
-                context->fillRect(backgroundRect, baseColor, style()->colorSpace());
-                context->setCompositeOperation(previousOperator);
-            } else
+            baseColor = view()->frameView()->baseBackgroundColor();
+            if (!baseColor.alpha())
                 context->clearRect(backgroundRect);
         }
 
-        if (bgColor.isValid() && bgColor.alpha() > 0)
+        if (baseColor.alpha() > 0) {
+            if (bgColor.alpha())
+                baseColor = baseColor.blend(bgColor);
+
+            CompositeOperator previousOperator = context->compositeOperation();
+            context->setCompositeOperation(CompositeCopy);
+            context->fillRect(backgroundRect, baseColor, style()->colorSpace());
+            context->setCompositeOperation(previousOperator);
+        } else if (bgColor.alpha() > 0)
             context->fillRect(backgroundRect, bgColor, style()->colorSpace());
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to