[BlackBerry] GraphicsLayer: fix code that was accidentally reverted
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 19:36:10 +0000 (19:36 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2013 19:36:10 +0000 (19:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112143

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-03-21
Reviewed by Rob Buis.

Several changes were accidentally reverted in r144465 due to the
upstreaming of some new code:

- clearBackgroundColor() and m_contentsLayerHasBackgroundColor had
  been removed in r137798.

- showDebugBorders() had been renamed to isShowingDebugBorder() in
  r133517.

- A new GraphicsLayer::create() overload had been introduced in
  r130185.

This patch fixes them all.

* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayer::create):
(WebCore):
(WebCore::GraphicsLayerBlackBerry::GraphicsLayerBlackBerry):
(WebCore::GraphicsLayerBlackBerry::setBackgroundColor):
(WebCore::GraphicsLayerBlackBerry::updateLayerBackgroundColor):
(WebCore::GraphicsLayerBlackBerry::setupContentsLayer):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
(GraphicsLayerBlackBerry):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.h

index 0985874..6374c2a 100644 (file)
@@ -1,3 +1,34 @@
+2013-03-21  Alberto Garcia  <agarcia@igalia.com>
+
+        [BlackBerry] GraphicsLayer: fix code that was accidentally reverted
+        https://bugs.webkit.org/show_bug.cgi?id=112143
+
+        Reviewed by Rob Buis.
+
+        Several changes were accidentally reverted in r144465 due to the
+        upstreaming of some new code:
+
+        - clearBackgroundColor() and m_contentsLayerHasBackgroundColor had
+          been removed in r137798.
+
+        - showDebugBorders() had been renamed to isShowingDebugBorder() in
+          r133517.
+
+        - A new GraphicsLayer::create() overload had been introduced in
+          r130185.
+
+        This patch fixes them all.
+
+        * platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
+        (WebCore::GraphicsLayer::create):
+        (WebCore):
+        (WebCore::GraphicsLayerBlackBerry::GraphicsLayerBlackBerry):
+        (WebCore::GraphicsLayerBlackBerry::setBackgroundColor):
+        (WebCore::GraphicsLayerBlackBerry::updateLayerBackgroundColor):
+        (WebCore::GraphicsLayerBlackBerry::setupContentsLayer):
+        * platform/graphics/blackberry/GraphicsLayerBlackBerry.h:
+        (GraphicsLayerBlackBerry):
+
 2013-03-21  Zan Dobersek  <zdobersek@igalia.com>
 
         [GTK] Move libLevelDB.la setup into a separate GNUmakefile.am
index b5f4cc2..e0efd37 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "FloatConversion.h"
 #include "FloatRect.h"
+#include "GraphicsLayerFactory.h"
 #include "Image.h"
 #include "LayerAnimation.h"
 #include "LayerWebKitThread.h"
@@ -79,6 +80,14 @@ static void clearLayerBackgroundColor(LayerWebKitThread& layer)
     layer.setBackgroundColor(Color::transparent);
 }
 
+PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
+{
+    if (!factory)
+        return adoptPtr(new GraphicsLayerBlackBerry(client));
+
+    return factory->createGraphicsLayer(client);
+}
+
 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
 {
     return adoptPtr(new GraphicsLayerBlackBerry(client));
@@ -88,7 +97,6 @@ GraphicsLayerBlackBerry::GraphicsLayerBlackBerry(GraphicsLayerClient* client)
     : GraphicsLayer(client)
     , m_suspendTime(0)
     , m_contentsLayerPurpose(NoContentsLayer)
-    , m_contentsLayerHasBackgroundColor(false)
 {
     m_layer = LayerWebKitThread::create(LayerData::Layer, this);
 
@@ -312,24 +320,14 @@ bool GraphicsLayerBlackBerry::setFilters(const FilterOperations& filters)
 
 void GraphicsLayerBlackBerry::setBackgroundColor(const Color& color)
 {
-    if (m_backgroundColorSet && m_backgroundColor == color)
+    if (color == m_backgroundColor)
         return;
 
     GraphicsLayer::setBackgroundColor(color);
 
-    m_contentsLayerHasBackgroundColor = true;
     updateLayerBackgroundColor();
 }
 
-void GraphicsLayerBlackBerry::clearBackgroundColor()
-{
-    if (!m_backgroundColorSet)
-        return;
-
-    GraphicsLayer::clearBackgroundColor();
-    clearLayerBackgroundColor(*m_contentsLayer);
-}
-
 void GraphicsLayerBlackBerry::setContentsOpaque(bool opaque)
 {
     if (m_contentsOpaque == opaque)
@@ -806,14 +804,10 @@ void GraphicsLayerBlackBerry::updateHasFixedAncestorInDOMTree()
 
 void GraphicsLayerBlackBerry::updateLayerBackgroundColor()
 {
-    if (!m_contentsLayer)
-        return;
-
-    // We never create the contents layer just for background color yet.
-    if (m_backgroundColorSet)
-        setLayerBackgroundColor(*m_contentsLayer, m_backgroundColor);
+    if (m_backgroundColor.isValid())
+        setLayerBackgroundColor(*m_layer, m_backgroundColor);
     else
-        clearLayerBackgroundColor(*m_contentsLayer);
+        clearLayerBackgroundColor(*m_layer);
 }
 
 #if ENABLE(CSS_FILTERS)
@@ -888,7 +882,7 @@ void GraphicsLayerBlackBerry::setupContentsLayer(LayerWebKitThread* contentsLaye
 
         updateContentsRect();
 
-        if (showDebugBorders()) {
+        if (isShowingDebugBorder()) {
             setLayerBorderColor(*m_contentsLayer, Color(0, 0, 128, 180));
             m_contentsLayer->setBorderWidth(1);
         }
index 6d4afb1..76ebe83 100644 (file)
@@ -83,7 +83,6 @@ public:
 #endif
 
     virtual void setBackgroundColor(const Color&);
-    virtual void clearBackgroundColor();
 
     virtual void setContentsOpaque(bool);
     virtual void setBackfaceVisibility(bool);
@@ -180,7 +179,6 @@ private:
     };
 
     ContentsLayerPurpose m_contentsLayerPurpose;
-    bool m_contentsLayerHasBackgroundColor : 1;
 };
 
 } // namespace WebCore