#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
, m_visibleContentRect(IntRect())
, m_scaleFactor(1.0f)
- , m_drawingScrollPosition(IntPoint())
- , m_drawingScaleFactor(1.0f)
, m_hasSuspendedContent(false)
#endif
#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
}
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
+// Before rendering, scale factor and scroll position is different from m_viewImpl.
+float PageClientImpl::scaleFactor()
+{
+ return m_pageDidRendered ? m_viewImpl->scaleFactor() : (m_restoredScaleFactor ? m_restoredScaleFactor : m_viewportConstraints.initialScale);
+}
+
+const IntPoint PageClientImpl::scrollPosition()
+{
+ return m_pageDidRendered ? m_viewImpl->scrollPosition() : (m_restoredScaleFactor ? m_restoredScrollPosition : IntPoint());
+}
+
IntRect PageClientImpl::adjustVisibleContentRect(IntRect visibleContentRect, float targetScale)
{
IntSize contentsSize = page()->contentsSize();
// update both drawing scale factor and scroll position after page is rendered
if (m_pageDidRendered) {
- m_drawingScaleFactor = m_scaleFactor;
- m_drawingScrollPosition = m_visibleContentRect.location();
+ if (!m_hasSuspendedContent) {
+ // FIXME: We have to update EwkViewImpl's scale and position here because we use them to draw contents.
+ // PageViewport's values are updated when resuming content in the webkit opensource,
+ // but we have to update viewImpl's values here to sync with PageClient's values.
+ // However, We should not update them when hasSuspendedContent is true in order to maintain last values.
+ // The values will be updated when resuming content.
+ // Below codes should be refactored when PageViewportController codes are merged into Tizen.
+ m_viewImpl->setScaleFactor(m_scaleFactor);
+ m_viewImpl->setScrollPosition(m_visibleContentRect.location());
+ }
}
// enclosingIntRect produces inconsistent width and height when scale factor is not 1.
ceilf(m_visibleContentRect.height() / m_scaleFactor));
if (!drawingArea())
return;
- drawingArea()->setVisibleContentsRect(mapToContentsVisibleContentRect, newScale, trajectory, FloatPoint(m_drawingScrollPosition));
+ drawingArea()->setVisibleContentsRect(mapToContentsVisibleContentRect, newScale, trajectory, FloatPoint(m_viewImpl->scrollPosition()));
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
// FIXME: We need to calculate exact visibleRect size here instead of mapToContentsVisibleContentRect.
drawingArea()->setVisibleContentsRectForScrollingContentsLayers(mapToContentsVisibleContentRect);
void PageClientImpl::drawContents(BackingStore::PlatformGraphicsContext context)
{
- if (!m_hasSuspendedContent) {
- // FIXME: We have to update EwkViewImpl's scale and position here because we use them to draw contents.
- // PageViewport's values are updated when resuming content in the webkit opensource,
- // but we have to update viewImpl's values here to sync with PageClient's values.
- // However, We should not update them when hasSuspendedContent is true in order to maintain last values.
- // The values will be updated when resuming content.
- // Below codes should be refactored when PageViewportController codes are merged into Tizen.
- m_viewImpl->setScaleFactor(m_drawingScaleFactor);
- m_viewImpl->setScrollPosition(m_drawingScrollPosition);
- }
-
cairo_save(context);
const cairo_matrix_t matrix = cairo_matrix_t(m_viewImpl->transformToView());
cairo_transform(context, &matrix);
void PageClientImpl::resumeContent()
{
- // FIXME: Update viewImpl's values after resuming content.
- // Actually PageViewport's values are updated when resuming content in the webkit opensource,
- // but we have to update viewImpl's values here(Tizen) to sync with PageClient's values.
- // The concept is that the values of EwkViewImpl and PageClient can be different during suspending
- // content and they become same when content is resumed.
- m_viewImpl->setScaleFactor(m_drawingScaleFactor);
- m_viewImpl->setScrollPosition(m_drawingScrollPosition);
-
if (!m_hasSuspendedContent)
return;
+ // FIXME: Update visibleContentRect with m_viewImpl after resuming content.
+ // The concept is that the values of EwkViewImpl and PageClient can be different
+ // during suspending content and they become same when content is resumed.
+ // Below codes should be refactored when PageViewportController codes are merged into Tizen.
+ setVisibleContentRect(IntRect(m_viewImpl->scrollPosition(), m_visibleContentRect.size()), m_viewImpl->scaleFactor());
m_hasSuspendedContent = false;
}
if (m_horizontalScrollbar) {
m_horizontalScrollbar->setProportion(viewSize().width(), scaledContentsSize.width());
- m_horizontalScrollbar->setPosition(m_drawingScrollPosition.x());
+ m_horizontalScrollbar->setPosition(m_viewImpl->scrollPosition().x());
}
if (m_verticalScrollbar) {
m_verticalScrollbar->setProportion(viewSize().height(), scaledContentsSize.height());
- m_verticalScrollbar->setPosition(m_drawingScrollPosition.y());
+ m_verticalScrollbar->setPosition(m_viewImpl->scrollPosition().y());
}
}
IntRect clipRect;
IntSize ewkViewSize = viewSize();
- if (!m_hasSuspendedContent) {
- // FIXME: We have to update EwkViewImpl's scale and position here because we use them to draw contents.
- // PageViewport's values are updated when resuming content in the webkit opensource,
- // but we have to update viewImpl's values here to sync with PageClient's values.
- // However, We should not update them when hasSuspendedContent is true in order to maintain last values.
- // The values will be updated when resuming content.
- // Below codes should be refactored when PageViewportController codes are merged into Tizen.
- m_viewImpl->setScaleFactor(m_drawingScaleFactor);
- m_viewImpl->setScrollPosition(m_drawingScrollPosition);
- }
-
#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewWidget));
m_angle = ecore_evas_rotation_get(ee);
#if ENABLE(TIZEN_WEBKIT2_TILED_AC)
DrawingAreaProxy* drawingArea() const { return m_page->drawingArea(); }
#endif
- // Before rendering, scale factor and scroll position is different from m_drawingScaleFactor and m_drawingScrollPosition
- float scaleFactor() { return m_pageDidRendered ? m_drawingScaleFactor : (m_restoredScaleFactor ? m_restoredScaleFactor : m_viewportConstraints.initialScale); }
- WebCore::IntPoint scrollPosition() { return m_pageDidRendered ? m_drawingScrollPosition : (m_restoredScaleFactor ? m_restoredScrollPosition : WebCore::IntPoint()); }
+ float scaleFactor();
+ const WebCore::IntPoint scrollPosition();
WebCore::IntRect adjustVisibleContentRect(WebCore::IntRect, float);
void setVisibleContentRect(const WebCore::IntRect&, float newScale, const WebCore::FloatPoint& trajectory = WebCore::FloatPoint());
TIZEN_VIRTUAL void displayViewport();
WebCore::IntRect m_visibleContentRect;
float m_scaleFactor;
- // below drawing values should be updated after page did rendered
- WebCore::IntPoint m_drawingScrollPosition;
- float m_drawingScaleFactor;
-
// FIXME: The concept of suspending content comes from webkit opensource's PageViewportController,
// so below code should be replaced when PageViewportController codes are merged.
// Please do not use below codes. They are only for scaling contents.