WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-126122-20160218233751.patch (text/plain), 24.30 KB, created by
Gwang Yoon Hwang
on 2016-02-18 06:38:11 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gwang Yoon Hwang
Created:
2016-02-18 06:38:11 PST
Size:
24.30 KB
patch
obsolete
>Subversion Revision: 196746 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 27353e7bda2d86ce698fc332a1012c8f3f20b748..c0a840c8c626e4226f9c92ce03e80f806c6b7ffd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2016-02-18 Gwang Yoon Hwang <yoon@igalia.com> >+ >+ [GTK] Limit the number of tiles according to the visible area >+ https://bugs.webkit.org/show_bug.cgi?id=126122 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ TextureMapperTiledBackingStore creates tiles for whole layer bounds, which >+ means it creates the huge amount of textures if there is an excessively big >+ layer. Not only it wastes the memory and the CPU time, it even can crash GPU >+ drivers. >+ >+ This patch modifies TextureMapperTiledBackingStore to take into account the >+ visible area with a coverage multiplier when creating tiles. >+ >+ * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: >+ (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): >+ Set a flag to recalculate the visible area of the layer when there are >+ geometric changes. >+ (WebCore::GraphicsLayerTextureMapper::setContentsToImage): >+ (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): >+ (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): >+ (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded): >+ (WebCore::GraphicsLayerTextureMapper::markVisibleRectAsDirty): >+ (WebCore::GraphicsLayerTextureMapper::selfOrAncestorHasActiveTransformAnimation): >+ (WebCore::GraphicsLayerTextureMapper::computeTransformedVisibleRect): >+ Compute the inverse transform matrix to map a global visible are to >+ the local visible area. >+ (WebCore::clampToContentsRectIfRectIsInfinite): >+ (WebCore::GraphicsLayerTextureMapper::transformedVisibleRect): >+ * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: >+ (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper): >+ In HiDPI, the directly composited image is uploaded to the unscaled >+ texture to reduce memory usages. So we should apply device scale >+ factor to render it correctly. >+ (WebCore::TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded): >+ Create tiles which covered by visible rect with a coverage multiplier. >+ > 2016-02-17 Mark Lam <mark.lam@apple.com> > > Callers of JSString::value() should check for exceptions thereafter. >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 6e7af286b153d4aade696e7ee028a20bdb7e41ab..fb6a34f014c2539b6fa917180a90053847b79b18 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,17 @@ >+2016-02-18 Gwang Yoon Hwang <yoon@igalia.com> >+ >+ [GTK] Limit the number of tiles according to the visible area >+ https://bugs.webkit.org/show_bug.cgi?id=126122 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: >+ (WebKit::LayerTreeHostGtk::initialize): Because we creates >+ nonCompositingLayer with a size of current view, we should not apply >+ the currently visible rect when creating / deleting tiles. >+ (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): Passes the current >+ visible rect to the GraphicsLayers. >+ > 2016-02-17 Brady Eidson <beidson@apple.com> > > Modern IDB: Rename some "UniqueIDBDatabase" classes that conflict with new classes in WebCore. >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >index 3af4a89be26f250c452ec700e33880304f2977c5..f99cc97939c1c83edd25a81613c4452c1731b80c 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >@@ -48,6 +48,8 @@ GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(Type layerType, GraphicsL > , m_contentsLayer(0) > , m_animationStartTime(0) > , m_isScrollable(false) >+ , m_isNonCompositingLayer(false) >+ , m_isVisibleRectDirty(true) > { > } > >@@ -167,6 +169,7 @@ void GraphicsLayerTextureMapper::setPosition(const FloatPoint& value) > return; > GraphicsLayer::setPosition(value); > notifyChange(PositionChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setAnchorPoint(const FloatPoint3D& value) >@@ -175,6 +178,7 @@ void GraphicsLayerTextureMapper::setAnchorPoint(const FloatPoint3D& value) > return; > GraphicsLayer::setAnchorPoint(value); > notifyChange(AnchorPointChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setSize(const FloatSize& value) >@@ -186,6 +190,7 @@ void GraphicsLayerTextureMapper::setSize(const FloatSize& value) > if (maskLayer()) > maskLayer()->setSize(value); > notifyChange(SizeChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setTransform(const TransformationMatrix& value) >@@ -195,6 +200,7 @@ void GraphicsLayerTextureMapper::setTransform(const TransformationMatrix& value) > > GraphicsLayer::setTransform(value); > notifyChange(TransformChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setChildrenTransform(const TransformationMatrix& value) >@@ -203,6 +209,7 @@ void GraphicsLayerTextureMapper::setChildrenTransform(const TransformationMatrix > return; > GraphicsLayer::setChildrenTransform(value); > notifyChange(ChildrenTransformChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setPreserves3D(bool value) >@@ -211,6 +218,7 @@ void GraphicsLayerTextureMapper::setPreserves3D(bool value) > return; > GraphicsLayer::setPreserves3D(value); > notifyChange(Preserves3DChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setMasksToBounds(bool value) >@@ -219,6 +227,7 @@ void GraphicsLayerTextureMapper::setMasksToBounds(bool value) > return; > GraphicsLayer::setMasksToBounds(value); > notifyChange(MasksToBoundsChange); >+ markVisibleRectAsDirty(); > } > > void GraphicsLayerTextureMapper::setDrawsContent(bool value) >@@ -301,6 +310,7 @@ void GraphicsLayerTextureMapper::setContentsToImage(Image* image) > m_compositedImage = TextureMapperTiledBackingStore::create(); > m_compositedImage->setContentsToImage(image); > m_compositedImage->updateContentsScale(pageScaleFactor() * deviceScaleFactor()); >+ m_compositedImage->updateContentsSize(image->size()); > } else { > m_compositedNativeImagePtr = nullptr; > m_compositedImage = nullptr; >@@ -369,6 +379,8 @@ void GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly(bool) > prepareBackingStoreIfNeeded(); > commitLayerChanges(); > m_layer.syncAnimations(); >+ if (!m_isNonCompositingLayer) >+ computeTransformedVisibleRect(); > } > > void GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded() >@@ -512,22 +524,22 @@ void GraphicsLayerTextureMapper::flushCompositingState(const FloatRect& rect, bo > child->flushCompositingState(rect, viewportIsStable); > } > >-void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers() >+void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers(const FloatRect& visibleContentRect) > { > if (!m_layer.textureMapper()) > return; > >- updateBackingStoreIfNeeded(); >+ updateBackingStoreIfNeeded(visibleContentRect); > > if (maskLayer()) >- downcast<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded(); >+ downcast<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded(visibleContentRect); > if (replicaLayer()) >- downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIfNeeded(); >+ downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIfNeeded(visibleContentRect); > for (auto* child : children()) >- downcast<GraphicsLayerTextureMapper>(*child).updateBackingStoreIncludingSubLayers(); >+ downcast<GraphicsLayerTextureMapper>(*child).updateBackingStoreIncludingSubLayers(visibleContentRect); > } > >-void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded() >+void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded(const FloatRect& visibleContentRect) > { > TextureMapper* textureMapper = m_layer.textureMapper(); > if (!textureMapper) >@@ -547,9 +559,10 @@ void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded() > > TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get()); > backingStore->updateContentsScale(pageScaleFactor() * deviceScaleFactor()); >+ backingStore->updateContentsSize(m_size); > > dirtyRect.scale(pageScaleFactor() * deviceScaleFactor()); >- backingStore->updateContents(*textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); >+ backingStore->updateContents(*textureMapper, this, transformedVisibleRect(visibleContentRect), dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); > > m_needsDisplay = false; > m_needsDisplayRect = IntRect(); >@@ -626,5 +639,81 @@ void GraphicsLayerTextureMapper::setRepaintCount(int repaintCount) > notifyChange(RepaintCountChange); > } > >+void GraphicsLayerTextureMapper::markVisibleRectAsDirty() >+{ >+ m_isVisibleRectDirty = true; >+ >+ if (maskLayer()) >+ downcast<GraphicsLayerTextureMapper>(*maskLayer()).markVisibleRectAsDirty(); >+ if (replicaLayer()) >+ downcast<GraphicsLayerTextureMapper>(*replicaLayer()).markVisibleRectAsDirty(); >+ for (auto* child : children()) >+ downcast<GraphicsLayerTextureMapper>(*child).markVisibleRectAsDirty(); >+} >+ >+bool GraphicsLayerTextureMapper::selfOrAncestorHasActiveTransformAnimation() const >+{ >+ if (m_animations.hasActiveAnimationsOfType(AnimatedPropertyTransform)) >+ return true; >+ >+ if (!parent()) >+ return false; >+ >+ return downcast<GraphicsLayerTextureMapper>(*parent()).selfOrAncestorHasActiveTransformAnimation(); >+} >+ >+void GraphicsLayerTextureMapper::computeTransformedVisibleRect() >+{ >+ if (!m_isVisibleRectDirty && !selfOrAncestorHasActiveTransformAnimation()) >+ return; >+ >+ m_isVisibleRectDirty = false; >+ TransformationMatrix currentTransform = transform(); >+ if (selfOrAncestorHasActiveTransformAnimation()) >+ client().getCurrentTransform(this, currentTransform); >+ m_layerTransform.setLocalTransform(currentTransform); >+ >+ m_layerTransform.setAnchorPoint(m_anchorPoint); >+ m_layerTransform.setPosition(m_position); >+ m_layerTransform.setSize(m_size); >+ >+ m_layerTransform.setFlattening(!preserves3D()); >+ m_layerTransform.setChildrenTransform(childrenTransform()); >+ m_layerTransform.combineTransforms(parent() ? downcast<GraphicsLayerTextureMapper>(*parent()).m_layerTransform.combinedForChildren() : TransformationMatrix()); >+ >+ m_cachedInverseTransform = m_layerTransform.combined().inverse().valueOr(TransformationMatrix()); >+} >+ >+static void clampToContentsRectIfRectIsInfinite(FloatRect& rect, const FloatSize& contentsSize) >+{ >+ if (rect.width() >= LayoutUnit::nearlyMax() || rect.width() <= LayoutUnit::nearlyMin()) { >+ rect.setX(0); >+ rect.setWidth(contentsSize.width()); >+ } >+ >+ if (rect.height() >= LayoutUnit::nearlyMax() || rect.height() <= LayoutUnit::nearlyMin()) { >+ rect.setY(0); >+ rect.setHeight(contentsSize.height()); >+ } >+} >+ >+FloatRect GraphicsLayerTextureMapper::transformedVisibleRect(const FloatRect& visibleContentRect) >+{ >+ if (m_isNonCompositingLayer) >+ return FloatRect(FloatPoint::zero(), m_size); >+ >+ // Non-invertible layers are not visible. >+ if (!m_layerTransform.combined().isInvertible()) >+ return IntRect(); >+ >+ // Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates). >+ // The resulting quad might be squewed and the visible rect is the bounding box of this quad, >+ // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier). >+ ASSERT(m_cachedInverseTransform == m_layerTransform.combined().inverse().valueOr(TransformationMatrix())); >+ FloatRect rect = m_cachedInverseTransform.clampedBoundsOfProjectedQuad(FloatQuad(visibleContentRect)); >+ clampToContentsRectIfRectIsInfinite(rect, size()); >+ return rect; >+} >+ > } > #endif >diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >index b0aa4637d8bc61fb2f964e93e13015d2e2e3160d..e8f8ee97246e440dd827a7de7d58b2e28f624c6e 100644 >--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h >@@ -86,7 +86,7 @@ public: > virtual void flushCompositingState(const FloatRect&, bool) override; > virtual void flushCompositingStateForThisLayerOnly(bool) override; > >- void updateBackingStoreIncludingSubLayers(); >+ void updateBackingStoreIncludingSubLayers(const FloatRect&); > > TextureMapperLayer& layer() { return m_layer; } > >@@ -102,6 +102,7 @@ public: > void setRepaintCount(int); > > void setAnimations(const TextureMapperAnimations&); >+ void setAsNonCompositingLayer() { m_isNonCompositingLayer = true; } > > private: > // GraphicsLayer >@@ -113,10 +114,15 @@ private: > > void commitLayerChanges(); > void updateDebugBorderAndRepaintCount(); >- void updateBackingStoreIfNeeded(); >+ void updateBackingStoreIfNeeded(const FloatRect&); > void prepareBackingStoreIfNeeded(); > bool shouldHaveBackingStore() const; > >+ bool selfOrAncestorHasActiveTransformAnimation() const; >+ void computeTransformedVisibleRect(); >+ void markVisibleRectAsDirty(); >+ FloatRect transformedVisibleRect(const FloatRect&); >+ > // This set of flags help us defer which properties of the layer have been > // modified by the compositor, so we can know what to look for in the next flush. > enum ChangeMask { >@@ -182,6 +188,11 @@ private: > > IntSize m_committedScrollOffset; > bool m_isScrollable; >+ >+ bool m_isNonCompositingLayer; >+ bool m_isVisibleRectDirty; >+ GraphicsLayerTransform m_layerTransform; >+ TransformationMatrix m_cachedInverseTransform; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp >index 990ca76492dcd733f4e644b8beff3af729523c6d..707c9bbc0404430204656b1d73326aba40434b36 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp >@@ -35,7 +35,7 @@ void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapp > if (!m_image) > return; > >- updateContents(textureMapper, m_image.get(), m_image->size(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData); >+ updateContents(textureMapper, m_image.get(), m_image->rect(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData); > > if (m_image->imageObserver()) > m_image->imageObserver()->didDraw(m_image.get()); >@@ -44,15 +44,23 @@ void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapp > > TransformationMatrix TextureMapperTiledBackingStore::adjustedTransformForRect(const FloatRect& targetRect) > { >- return TransformationMatrix::rectToRect(rect(), targetRect); >+ FloatRect scaledContentsRect(FloatPoint::zero(), m_contentsSize); >+ scaledContentsRect.scale(m_contentsScale); >+ return TransformationMatrix::rectToRect(scaledContentsRect, targetRect); > } > > void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity) > { >+ FloatRect scaledTargetRect(targetRect); >+ if (m_image) >+ scaledTargetRect.scale(m_contentsScale); >+ > updateContentsFromImageIfNeeded(textureMapper); >- TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect); >+ TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(scaledTargetRect); >+ FloatRect scaledContentsRect(FloatPoint::zero(), m_contentsSize); >+ scaledContentsRect.scale(m_contentsScale); > for (auto& tile : m_tiles) >- tile.paint(textureMapper, adjustedTransform, opacity, calculateExposedTileEdges(rect(), tile.rect())); >+ tile.paint(textureMapper, adjustedTransform, opacity, calculateExposedTileEdges(scaledContentsRect, tile.rect())); > } > > void TextureMapperTiledBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform) >@@ -78,17 +86,37 @@ void TextureMapperTiledBackingStore::updateContentsScale(float scale) > m_contentsScale = scale; > } > >-void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSize& size, const IntSize& tileSize, bool hasAlpha) >+void TextureMapperTiledBackingStore::updateContentsSize(const FloatSize& size) > { >- if (size == m_size && !m_isScaleDirty) >+ if (m_contentsSize == size) > return; > >- m_size = size; >+ m_isSizeDirty = true; >+ m_contentsSize = size; >+} >+ >+void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatRect& visibleRect, const IntSize& tileSize, bool hasAlpha) >+{ >+ if (visibleRect == m_visibleRect && !m_isScaleDirty && !m_isSizeDirty) >+ return; >+ >+ m_visibleRect = visibleRect; > m_isScaleDirty = false; >+ m_isSizeDirty = false; > >- FloatSize scaledSize(m_size); >- if (!m_image) >- scaledSize.scale(m_contentsScale); >+ FloatRect scaledContentsRect(FloatRect(FloatPoint::zero(), m_contentsSize)); >+ FloatRect scaledVisibleRect(m_visibleRect); >+ >+ static const float coverRectMultiplier = 1.2; >+ FloatPoint delta(scaledVisibleRect.center()); >+ delta.scale(1 - coverRectMultiplier, 1 - coverRectMultiplier); >+ >+ scaledVisibleRect.scale(coverRectMultiplier); >+ scaledVisibleRect.moveBy(delta); >+ if (!m_image) { >+ scaledContentsRect.scale(m_contentsScale); >+ scaledVisibleRect.scale(m_contentsScale); >+ } > > Vector<FloatRect> tileRectsToAdd; > Vector<int> tileIndicesToRemove; >@@ -96,11 +124,12 @@ void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSiz > > // This method recycles tiles. We check which tiles we need to add, which to remove, and use as many > // removable tiles as replacement for new tiles when possible. >- for (float y = 0; y < scaledSize.height(); y += tileSize.height()) { >- for (float x = 0; x < scaledSize.width(); x += tileSize.width()) { >+ for (float y = 0; y < scaledContentsRect.height(); y += tileSize.height()) { >+ for (float x = 0; x < scaledContentsRect.width(); x += tileSize.width()) { > FloatRect tileRect(x, y, tileSize.width(), tileSize.height()); >- tileRect.intersect(rect()); >- tileRectsToAdd.append(tileRect); >+ tileRect.intersect(scaledContentsRect); >+ if (tileRect.intersects(scaledVisibleRect)) >+ tileRectsToAdd.append(tileRect); > } > } > >@@ -150,16 +179,16 @@ void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSiz > } > } > >-void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) >+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) > { >- createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque()); >+ createOrDestroyTilesIfNeeded(visibleRect, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque()); > for (auto& tile : m_tiles) > tile.updateContents(textureMapper, image, dirtyRect, updateContentsFlag); > } > >-void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) >+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) > { >- createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true); >+ createOrDestroyTilesIfNeeded(visibleRect, textureMapper.maxTextureSize(), true); > for (auto& tile : m_tiles) > tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag, m_contentsScale); > } >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h b/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h >index b45b508e4ba925f72950d367b8e5eb803b974e6a..0ebfae432f309c6165f46f8475a1a61a1e812dc9 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h >@@ -43,29 +43,28 @@ public: > virtual void drawRepaintCounter(TextureMapper&, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override; > > void updateContentsScale(float); >- void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag); >- void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag); >+ void updateContentsSize(const FloatSize&); >+ >+ void updateContents(TextureMapper&, Image*, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag); >+ void updateContents(TextureMapper&, GraphicsLayer*, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag); > > void setContentsToImage(Image* image) { m_image = image; } > > private: > TextureMapperTiledBackingStore() { } > >- void createOrDestroyTilesIfNeeded(const FloatSize& backingStoreSize, const IntSize& tileSize, bool hasAlpha); >+ void createOrDestroyTilesIfNeeded(const FloatRect& visibleRect, const IntSize& tileSize, bool hasAlpha); > void updateContentsFromImageIfNeeded(TextureMapper&); > TransformationMatrix adjustedTransformForRect(const FloatRect&); >- inline FloatRect rect() const >- { >- FloatRect rect(FloatPoint::zero(), m_size); >- rect.scale(m_contentsScale); >- return rect; >- } > > Vector<TextureMapperTile> m_tiles; >- FloatSize m_size; >+ FloatSize m_contentsSize; >+ FloatRect m_visibleRect; >+ FloatRect m_scaledvisibleRect; > RefPtr<Image> m_image; > float m_contentsScale { 1 }; > bool m_isScaleDirty { false }; >+ bool m_isSizeDirty { false }; > }; > > } // namespace WebCore >diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp >index 5b83c723e9f8ef26dbb486ad4bebb1e33f09f918..0c4b281915ef8d256d4a9dbc9be03af61c395cd9 100644 >--- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp >+++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp >@@ -172,6 +172,7 @@ void LayerTreeHostGtk::initialize() > > // The non-composited contents are a child of the root layer. > m_nonCompositedContentLayer = GraphicsLayer::create(graphicsLayerFactory(), *this); >+ downcast<GraphicsLayerTextureMapper>(*m_nonCompositedContentLayer).setAsNonCompositingLayer(); > m_nonCompositedContentLayer->setDrawsContent(true); > m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground()); > m_nonCompositedContentLayer->setSize(m_webPage->size()); >@@ -322,7 +323,8 @@ bool LayerTreeHostGtk::flushPendingLayerChanges() > if (m_viewOverlayRootLayer) > m_viewOverlayRootLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size()), viewportIsStable); > >- downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(); >+ FloatRect visibleRect(m_webPage->mainFrame()->view()->scrollPosition(), m_webPage->size()); >+ downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(visibleRect); > return true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 126122
:
244084
|
244085
|
244086
|
261082
|
270564
|
270986
| 271659