IntRect bounds = m_rect;
IntSize candidateSize = rect.size();
- // If candidateSize is bigger than bounds (i.e. TBS is used as a backing store of GraphicsLayer), we skip the below adjusting logic which expects bounds to cover the given rect.
- if (candidateSize.width() > bounds.width() && candidateSize.height() > bounds.height()) {
- rect.intersect(bounds);
+ rect.intersect(bounds);
+
+ if (rect.size() == candidateSize)
return;
- }
- // We will try to keep the cover and keep rect the same size at all time, which
- // might not be the case when at the content edges.
+ if (rect.isEmpty())
+ return;
// We start by moving when at the edges.
rect.move(std::max(0, bounds.x() - rect.x()), std::max(0, bounds.y() - rect.y()));
rect.move(std::min(0, bounds.maxX() - rect.maxX()), std::min(0, bounds.maxY() - rect.maxY()));
- rect.intersect(bounds);
-
#if !ENABLE(TIZEN_WEBKIT2_TILED_AC_DONT_ADJUST_COVER_RECT)
if (rect.size() == candidateSize)
return;