Title: [230912] trunk/Source/WebCore
Revision
230912
Author
[email protected]
Date
2018-04-23 07:12:24 -0700 (Mon, 23 Apr 2018)

Log Message

[CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
https://bugs.webkit.org/show_bug.cgi?id=184880

Reviewed by Michael Catanzaro.

Drop the m_supportsAlpha member from the TiledBackingStore class. The
member value was unused. TiledBackingStore::setSupportsAlpha() method
is removed.

TiledBackingStore::setSupportsAlpha() invalidated the backing store,
so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
behavior by manually updating the m_needsDisplay struct. This means
that during the following layer flush the backing store is repainted
in its entirety.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (230911 => 230912)


--- trunk/Source/WebCore/ChangeLog	2018-04-23 13:45:20 UTC (rev 230911)
+++ trunk/Source/WebCore/ChangeLog	2018-04-23 14:12:24 UTC (rev 230912)
@@ -1,3 +1,28 @@
+2018-04-23  Zan Dobersek  <[email protected]>
+
+        [CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
+        https://bugs.webkit.org/show_bug.cgi?id=184880
+
+        Reviewed by Michael Catanzaro.
+
+        Drop the m_supportsAlpha member from the TiledBackingStore class. The
+        member value was unused. TiledBackingStore::setSupportsAlpha() method
+        is removed.
+
+        TiledBackingStore::setSupportsAlpha() invalidated the backing store,
+        so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
+        behavior by manually updating the m_needsDisplay struct. This means
+        that during the following layer flush the backing store is repainted
+        in its entirety.
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
+        (WebCore::CoordinatedGraphicsLayer::createBackingStore):
+        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::TiledBackingStore):
+        (WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
+        * platform/graphics/texmap/coordinated/TiledBackingStore.h:
+
 2018-04-23  Thibault Saunier  <[email protected]>
 
         [GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (230911 => 230912)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-04-23 13:45:20 UTC (rev 230911)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-04-23 14:12:24 UTC (rev 230912)
@@ -313,12 +313,19 @@
 {
     if (contentsOpaque() == b)
         return;
-    if (m_mainBackingStore)
-        m_mainBackingStore->setSupportsAlpha(!b);
+
     GraphicsLayer::setContentsOpaque(b);
     m_layerState.contentsOpaque = b;
     m_layerState.flagsChanged = true;
 
+    // Demand a repaint of the whole layer.
+    if (!m_needsDisplay.completeLayer) {
+        m_needsDisplay.completeLayer = true;
+        m_needsDisplay.rects.clear();
+
+        addRepaintRect({ { }, m_size });
+    }
+
     didChangeLayerState();
 }
 
@@ -846,7 +853,6 @@
 void CoordinatedGraphicsLayer::createBackingStore()
 {
     m_mainBackingStore = std::make_unique<TiledBackingStore>(*this, effectiveContentsScale());
-    m_mainBackingStore->setSupportsAlpha(!contentsOpaque());
 }
 
 void CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation()

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp (230911 => 230912)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp	2018-04-23 13:45:20 UTC (rev 230911)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp	2018-04-23 14:12:24 UTC (rev 230912)
@@ -41,7 +41,6 @@
     , m_tileSize(defaultTileDimension, defaultTileDimension)
     , m_coverAreaMultiplier(2.0f)
     , m_contentsScale(contentsScale)
-    , m_supportsAlpha(false)
     , m_pendingTileCreation(false)
 {
 }
@@ -394,14 +393,6 @@
     return Tile::Coordinate(std::max(x, 0), std::max(y, 0));
 }
 
-void TiledBackingStore::setSupportsAlpha(bool a)
-{
-    if (a == m_supportsAlpha)
-        return;
-    m_supportsAlpha = a;
-    invalidate(m_rect);
 }
 
-}
-
 #endif

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h (230911 => 230912)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h	2018-04-23 13:45:20 UTC (rev 230911)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h	2018-04-23 14:12:24 UTC (rev 230912)
@@ -62,8 +62,6 @@
     bool visibleAreaIsCovered() const;
     void removeAllNonVisibleTiles(const IntRect& unscaledVisibleRect, const IntRect& contentsRect);
 
-    void setSupportsAlpha(bool);
-
 private:
     void createTiles(const IntRect& visibleRect, const IntRect& scaledContentsRect, float coverAreaMultiplier);
     void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const;
@@ -96,7 +94,6 @@
 
     float m_contentsScale;
 
-    bool m_supportsAlpha;
     bool m_pendingTileCreation;
 
     friend class Tile;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to