Title: [229621] trunk/Source/WebCore
- Revision
- 229621
- Author
- [email protected]
- Date
- 2018-03-15 00:14:28 -0700 (Thu, 15 Mar 2018)
Log Message
[TexMap] Don't bother caching pattern transform matrix
https://bugs.webkit.org/show_bug.cgi?id=183633
Reviewed by Michael Catanzaro.
Remove the m_patternTransform and m_patternTransformDirty member
variables from the TextureMapperLayer class. These unnecessarily
complicate the state update methods that need to compare the given
attribute against the current state, and only update it if it has
changed.
Instead, compute the pattern TransformationMatrix value on-the-fly in
the paintSelf() method, if at all necessary.
No change in functionality.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::setContentsRect):
(WebCore::TextureMapperLayer::setContentsTileSize):
(WebCore::TextureMapperLayer::setContentsTilePhase):
(WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
* platform/graphics/texmap/TextureMapperLayer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (229620 => 229621)
--- trunk/Source/WebCore/ChangeLog 2018-03-15 05:54:53 UTC (rev 229620)
+++ trunk/Source/WebCore/ChangeLog 2018-03-15 07:14:28 UTC (rev 229621)
@@ -1,3 +1,29 @@
+2018-03-15 Zan Dobersek <[email protected]>
+
+ [TexMap] Don't bother caching pattern transform matrix
+ https://bugs.webkit.org/show_bug.cgi?id=183633
+
+ Reviewed by Michael Catanzaro.
+
+ Remove the m_patternTransform and m_patternTransformDirty member
+ variables from the TextureMapperLayer class. These unnecessarily
+ complicate the state update methods that need to compare the given
+ attribute against the current state, and only update it if it has
+ changed.
+
+ Instead, compute the pattern TransformationMatrix value on-the-fly in
+ the paintSelf() method, if at all necessary.
+
+ No change in functionality.
+
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::paintSelf):
+ (WebCore::TextureMapperLayer::setContentsRect):
+ (WebCore::TextureMapperLayer::setContentsTileSize):
+ (WebCore::TextureMapperLayer::setContentsTilePhase):
+ (WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
+ * platform/graphics/texmap/TextureMapperLayer.h:
+
2018-03-14 John Wilander <[email protected]>
Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (229620 => 229621)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2018-03-15 05:54:53 UTC (rev 229620)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2018-03-15 07:14:28 UTC (rev 229621)
@@ -91,17 +91,6 @@
return color.colorWithAlphaMultipliedBy(opacity);
}
-void TextureMapperLayer::computePatternTransformIfNeeded()
-{
- if (!m_patternTransformDirty)
- return;
-
- m_patternTransformDirty = false;
- m_patternTransform =
- TransformationMatrix::rectToRect(FloatRect(FloatPoint::zero(), m_state.contentsTileSize), FloatRect(FloatPoint::zero(), m_state.contentsRect.size()))
- .multiply(TransformationMatrix().translate(m_state.contentsTilePhase.width() / m_state.contentsRect.width(), m_state.contentsTilePhase.height() / m_state.contentsRect.height()));
-}
-
void TextureMapperLayer::paintSelf(const TextureMapperPaintOptions& options)
{
if (!m_state.visible || !m_state.contentsVisible)
@@ -138,9 +127,11 @@
return;
if (!m_state.contentsTileSize.isEmpty()) {
- computePatternTransformIfNeeded();
options.textureMapper.setWrapMode(TextureMapper::RepeatWrap);
- options.textureMapper.setPatternTransform(m_patternTransform);
+
+ auto patternTransform = TransformationMatrix::rectToRect({ { }, m_state.contentsTileSize }, { { }, m_state.contentsRect.size() })
+ .translate(m_state.contentsTilePhase.width() / m_state.contentsRect.width(), m_state.contentsTilePhase.height() / m_state.contentsRect.height());
+ options.textureMapper.setPatternTransform(patternTransform);
}
ASSERT(!layerRect().isEmpty());
@@ -555,26 +546,17 @@
void TextureMapperLayer::setContentsRect(const FloatRect& contentsRect)
{
- if (contentsRect == m_state.contentsRect)
- return;
m_state.contentsRect = contentsRect;
- m_patternTransformDirty = true;
}
void TextureMapperLayer::setContentsTileSize(const FloatSize& size)
{
- if (size == m_state.contentsTileSize)
- return;
m_state.contentsTileSize = size;
- m_patternTransformDirty = true;
}
void TextureMapperLayer::setContentsTilePhase(const FloatSize& phase)
{
- if (phase == m_state.contentsTilePhase)
- return;
m_state.contentsTilePhase = phase;
- m_patternTransformDirty = true;
}
void TextureMapperLayer::setMasksToBounds(bool masksToBounds)
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h (229620 => 229621)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h 2018-03-15 05:54:53 UTC (rev 229620)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h 2018-03-15 07:14:28 UTC (rev 229621)
@@ -47,7 +47,6 @@
, m_textureMapper(0)
, m_fixedToViewport(false)
, m_id(0)
- , m_patternTransformDirty(false)
{ }
virtual ~TextureMapperLayer();
@@ -147,7 +146,6 @@
void paintSelfAndChildren(const TextureMapperPaintOptions&);
void paintSelfAndChildrenWithReplica(const TextureMapperPaintOptions&);
void applyMask(const TextureMapperPaintOptions&);
- void computePatternTransformIfNeeded();
// TextureMapperAnimation::Client
void setAnimatedTransform(const TransformationMatrix&) override;
@@ -226,8 +224,6 @@
FloatSize m_scrollPositionDelta;
bool m_fixedToViewport;
uint32_t m_id;
- TransformationMatrix m_patternTransform;
- bool m_patternTransformDirty;
};
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes