m_scrollingLayer->setSize(paddingBox.size());
m_scrollingLayer->setOffsetFromRenderer(IntPoint() - paddingBox.location(), false);
// Note that we implement the contents offset via the bounds origin on this layer, rather than a position on the sublayer.
- m_scrollingLayer->setBoundsOrigin(FloatPoint(scrollOffset.width(), scrollOffset.height()));
+ m_scrollingLayer->setBoundsOrigin(FloatPoint(-scrollOffset.width(), -scrollOffset.height()));
- m_scrollingContentsLayer->setPosition(FloatPoint());
+ m_scrollingContentsLayer->setPosition(FloatPoint(-scrollOffset.width(), -scrollOffset.height()));
IntSize scrollSize(m_owningLayer->scrollWidth(), m_owningLayer->scrollHeight());
if (scrollSize != m_scrollingContentsLayer->size())
const Vector<GraphicsLayer*>& childLayers = contentsLayer->children();
for (size_t i = 0; i < childLayers.size(); ++i)
if (childLayers[i]->isScrollbar())
- toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin().x(), contentsLayer->boundsOrigin().y()));
+ toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
#endif
- textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
+ textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin() - contentsLayer->position()));
}
}
return false;
const IntSize contentLayerSize(contentsLayer->size().width(), contentsLayer->size().height());
- const IntRect boundaryRect(FloatRect(scrollingLayer->position(), scrollingLayer->size()));
- const IntRect visibleRect(FloatRect(contentsLayer->boundsOrigin(), scrollingLayer->size()));
+ const IntRect boundaryRect(FloatRect(FloatPoint(0, 0), scrollingLayer->size()));
+ const IntRect visibleRect(FloatRect(-contentsLayer->boundsOrigin().x(),
+ -contentsLayer->boundsOrigin().y(),
+ scrollingLayer->size().width(),
+ scrollingLayer->size().height()));
+
IntRect newVisibleRect = visibleRect;
newVisibleRect.moveBy(flooredIntPoint(offset));
if (visibleRect == newVisibleRect)
return false;
- contentsLayer->setBoundsOrigin(newVisibleRect.location());
+ contentsLayer->setBoundsOrigin(FloatPoint(-newVisibleRect.x(), -newVisibleRect.y()));
m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, visibleRect, offset), m_drawingAreaProxy->page()->pageID());
if (!contentsLayer)
return;
- toWebGraphicsLayer(contentsLayer)->setVisibleRect(visibleRect);
if (trajectoryVector != FloatPoint::zero()) {
m_webPage->scrollOverflowWithTrajectoryVector(trajectoryVector);
toWebGraphicsLayer(contentsLayer)->setVisibleContentRectTrajectoryVector(trajectoryVector);
contentsLayer->setPosition(-offset);
IntRect visibleRect(FloatRect(offset, scrollingLayer->size()));
- toWebGraphicsLayer(contentsLayer)->setVisibleRect(visibleRect);
// FIXME: Need to set trajectoryVector?
// FloatPoint trajectoryVector(scrollingLayer->trajectoryVector());
void WebGraphicsLayer::setNeedsDisplay()
{
-#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
- if (!m_visibleRect.isEmpty()) {
- setNeedsDisplayInRect(IntRect(m_visibleRect));
- return;
- }
-#endif
setNeedsDisplayInRect(IntRect(IntPoint::zero(), IntSize(size().width(), size().height())));
}
return IntRect();
#endif
-#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
- if (!m_visibleRect.isEmpty())
- return m_visibleRect;
-#endif
-
FloatRect perspectiveRect = m_webGraphicsLayerClient->visibleContentsRect();
#if ENABLE(TIZEN_CSS_OVERFLOW_CLIPPING_BACKING_STORE)
return endAnimationRect;
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
+ if (isScrollbar()) {
+ WebGraphicsLayer* parentLayer = toWebGraphicsLayer(parent());
+ if (parentLayer && parentLayer->isOverflow()) {
+ GraphicsLayerTransform adjustedTransform = m_layerTransform;
+ adjustedTransform.setPosition(FloatPoint(position().x() - parentLayer->position().x(),
+ position().y() - parentLayer->position().y()));
+ adjustedTransform.combineTransforms(parent() ? toWebGraphicsLayer(parent())->m_layerTransform.combinedForChildren() : TransformationMatrix());
+ return enclosingIntRect(adjustedTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(perspectiveRect)));
+ }
+ }
+#endif
+
// 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).
#endif
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
- void setVisibleRect(const IntRect& rect) { m_visibleRect = rect; }
void setIsOverflow(const bool b);
bool isOverflow() const { return m_isOverflow; }
#endif
float m_fixedAnimationScale;
#endif
-#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
- IntRect m_visibleRect;
-#endif
PlatformLayer* m_canvasPlatformLayer;
Timer<WebGraphicsLayer> m_animationStartedTimer;
GraphicsLayerAnimations m_animations;