#include "ewk_context_private.h"
#endif
-#if ENABLE(TIZEN_SCREEN_READER)
-#include "ScreenReaderProxy.h"
-#endif
-
using namespace WebCore;
using namespace std;
, m_viewportFitsToContent(false)
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
, m_visibleContentRect(IntRect())
- , m_scaleFactor(1.0f)
+ , m_scaleFactor(0)
, m_hasSuspendedContent(false)
#endif
#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
, m_restoredScaleFactor(0)
#endif
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+ , m_scrollPositionBeforePageRendered(IntPoint())
+#endif
, m_isVisible(true)
+ , m_deferUpdateViewportSize(false)
, m_isScrollableLayerFocused(false)
, m_isScrollableNodeFocused(false)
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
, m_waitFrameOfNewViewortSize(false)
#endif
+ , m_nonemptyLayoutRendered(false)
#endif // #if OS(TIZEN)
{
#if ENABLE(TIZEN_CANVAS_CAIRO_GLES_RENDERING)
#if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
m_formDataCandidate = FormDataCandidate::create(m_viewImpl);
#endif
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
+ m_viewportAngle = ecore_evas_rotation_get(ee);
#endif
setBackgroundColor(1, 1, 1, 1);
PageClientImpl::~PageClientImpl()
{
- m_viewImpl->page()->close();
+ if (m_viewImpl && m_viewImpl->page())
+ m_viewImpl->page()->close();
}
#if OS(TIZEN)
constraints.layoutSize = attributes.layoutSize;
constraints.contentsDefinedInitialScale = (ViewportArguments::ValueAuto != attributes.initialScale);
- double defaultViewLevel = m_viewImpl->page()->pageGroup()->preferences()->defaultViewLevel();
- // If defaultViewLevel is 1, "Default View" is set as "Readable"
- // if not, "Default View" is set as "Fit to width"
- if (defaultViewLevel) {
+ bool autoFittingEnabled = m_viewImpl->page()->pageGroup()->preferences()->autoFittingEnabled();
+ if (autoFittingEnabled)
+ constraints.initialScale = attributes.minimumScale * attributes.devicePixelRatio;
+ else {
// if content doesn't set initial scale value, set readable scale factor
// if not, set initial scale factor of viewport attribute
if (attributes.initialScale == ViewportArguments::ValueAuto)
constraints.initialScale = m_viewImpl->page()->deviceScaleFactor();
else
constraints.initialScale = attributes.initialScale * attributes.devicePixelRatio;
- } else {
- // Minimize initial scale factor
- constraints.initialScale = attributes.minimumScale * attributes.devicePixelRatio;
}
// adjust scale with both minimum and maximum scale factor
- constraints.initialScale = clampTo(constraints.initialScale, constraints.minimumScale, constraints.maximumScale);
+ constraints.initialScale = adjustScaleWithViewport(constraints.initialScale);
return constraints;
}
#if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int angle)
{
- // update device width & height
- int deviceWidth = WebCore::getDefaultScreenResolution().width();
- int deviceHeight = WebCore::getDefaultScreenResolution().height();
-
- if (angle == 90 || angle == 270) {
- int tempWidth = deviceWidth;
- deviceWidth = deviceHeight;
- deviceHeight = tempWidth;
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI(" view size: [%d, %d], angle: [%d]", viewportSize.width(), viewportSize.height(), angle);
+#endif
+#if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
+ if (m_deferUpdateViewportSize) {
+ m_visibleContentRect.setSize(viewportSize);
+ m_viewImpl->page()->setViewportSize(viewportSize);
+ m_deferUpdateViewportSize = false;
+ return;
}
- m_viewImpl->page()->pageGroup()->preferences()->setDeviceWidth(deviceWidth);
- m_viewImpl->page()->pageGroup()->preferences()->setDeviceHeight(deviceHeight);
+#endif
// update viewport size of webkit
- m_visibleContentRect.setSize(viewportSize);
m_viewImpl->page()->setViewportSize(viewportSize);
}
+
+void PageClientImpl::updateVisibleContentRectSize(const IntSize& size)
+{
+ // update visible content rect's size
+ m_visibleContentRect.setSize(size);
+}
+#endif
+
+void PageClientImpl::prepareRestoredVisibleContectRect()
+{
+ m_restoredScaleFactor = scaleFactor();
+ m_restoredScrollPosition = scrollPosition();
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_restoredScrollPosition.x(), m_restoredScrollPosition.y(), m_restoredScaleFactor);
#endif
+}
void PageClientImpl::initializeVisibleContentRect()
{
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
IntPoint initialScrollPosition;
float initialScaleFactor = m_viewportConstraints.initialScale;
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+ initialScrollPosition = m_scrollPositionBeforePageRendered;
+ m_scrollPositionBeforePageRendered = IntPoint();
+#endif
#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
// if scroll position and scale factor are restored by history controller,
// move scroll position and scale factor with them
initialScrollPosition = m_restoredScrollPosition;
initialScaleFactor = m_restoredScaleFactor;
}
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+ m_restoredScaleFactor = 0;
+#endif
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", initialScrollPosition.x(), initialScrollPosition.y(), initialScaleFactor);
+#endif
#endif
setVisibleContentRect(IntRect(initialScrollPosition, m_visibleContentRect.size()), initialScaleFactor);
#else
IntSize contentsSize = m_viewImpl->page()->contentsSize();
double horizontalMinScale = max(((double)viewSize().width() / contentsSize.width()), 0.25);
double verticalMinScale = max(((double)viewSize().height() / contentsSize.height()), 0.25);
+ // If there's only a bit ignorable difference between horizontalMinScale and verticalMinScale,
+ // ignore verticalMinScale to fit content's width to view
+ const double ignorableThreshold = 0.01;
+ if (fabs(horizontalMinScale - verticalMinScale) < ignorableThreshold)
+ verticalMinScale = horizontalMinScale;
return min(max(horizontalMinScale, verticalMinScale), m_viewportConstraints.maximumScale);
}
void PageClientImpl::fitViewportToContent()
{
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_visibleContentRect.x(), m_visibleContentRect.y(), m_viewportConstraints.minimumScale);
+#endif
setVisibleContentRect(m_visibleContentRect, m_viewportConstraints.minimumScale);
}
#else
m_viewImpl->redrawRegion(rect);
#endif
-
-#if ENABLE(TIZEN_SCREEN_READER)
- if (rect.intersects(ewkViewGetFocusRing(m_viewImpl->view())->rect()))
- m_viewImpl->page()->recalcScreenReaderFocusRect();
-#endif
}
void PageClientImpl::displayView()
void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes& attributes)
{
+ double scaleRatioBeforeRotation = m_scaleFactor / m_viewportConstraints.minimumScale;
m_viewportConstraints = computeViewportConstraints(attributes);
+#if ENABLE(TIZEN_GESTURE)
+ m_viewImpl->setDoubleTapEnabled(userScalable());
+#endif
+
+ // Initially, m_scaleFactor is not decided yet.
+ // So, we should update visible content rect at here.
+ if (!m_scaleFactor) {
+ setVisibleContentRect(m_visibleContentRect, m_viewportConstraints.initialScale);
+ return;
+ }
+
// if content is reloaded, contents size will not be changed
// so, we need to calculate minimum scale here.
// if content size is changed later, minimum scale will be re-calculated on didChangeContentsSize()
- if (m_viewportConstraints.userScalable)
+ if (m_viewportConstraints.userScalable) {
+ if (fabs(m_viewportConstraints.initialScale - m_viewportConstraints.minimumScale) < numeric_limits<float>::epsilon())
+ m_viewportConstraints.initialScale = availableMinimumScale();
m_viewportConstraints.minimumScale = availableMinimumScale();
+ }
+
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("layout size: [%d, %d], scale: [%.2f, %.2f, %.2f], user scalable: [%s]",
+ m_viewportConstraints.layoutSize.width(), m_viewportConstraints.layoutSize.height(),
+ m_viewportConstraints.initialScale, m_viewportConstraints.minimumScale, m_viewportConstraints.maximumScale,
+ m_viewportConstraints.userScalable ? "TRUE" : "FALSE");
+#endif
// setVisibleContentRect() should be called to adjust visible content rect only when view is resized
if (!m_pageDidRendered || m_viewImpl->page()->estimatedProgress() <= 0.1)
return;
float newScale = scaleFactor();
+ IntPoint newScrollPosition = m_visibleContentRect.location();
Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
int angle = ecore_evas_rotation_get(ee);
bool isRotated = (angle != m_viewportAngle);
// if it's rotated, we need to fit content to viewport by minimize the scale
if (isRotated) {
m_viewportAngle = angle;
+ newScale = m_viewportConstraints.minimumScale * scaleRatioBeforeRotation;
if (m_viewportFitsToContent)
newScale = m_viewportConstraints.minimumScale;
+ newScrollPosition.scale(newScale / m_scaleFactor, newScale / m_scaleFactor);
}
#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
if (m_waitFrameOfNewViewortSize)
ewk_view_resume(m_viewImpl->view());
#endif
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f], rotated: [%s]", m_visibleContentRect.x(), m_visibleContentRect.y(), newScale, isRotated ? "Rotated" : "Not rotated");
+#endif
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- setVisibleContentRect(m_visibleContentRect, newScale);
+ setVisibleContentRect(IntRect(newScrollPosition, m_visibleContentRect.size()), newScale);
#else
- m_viewImpl->page()->scalePage(newScale, m_visibleContentRect.location());
+ m_viewImpl->page()->scalePage(newScale, newScrollPosition);
#endif
#if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
if (smartData->api->formdata_candidate_is_showing(smartData))
smartData->api->formdata_candidate_hide(smartData);
#endif
+
+#if ENABLE(TIZEN_FULLSCREEN_API)
+ if (m_viewImpl->page()->fullScreenManager()->isFullScreen())
+ m_viewImpl->page()->fullScreenManager()->updateMediaControlsStyle();
+#endif
}
#if OS(TIZEN)
#if OS(TIZEN)
void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame()
{
+ m_nonemptyLayoutRendered = true;
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
m_initialViewRect.setSize(viewSize());
#endif
void PageClientImpl::didChangeContentsSize(const WebCore::IntSize size)
{
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI(" [%d, %d]", size.width(), size.height());
+#endif
#if USE(TILED_BACKING_STORE)
if (size.isEmpty())
return;
// FIXME: Do we really need to adjust visible content rect at here?
// if contents size is changed smaller and visible content rect is outside of content area,
// adjust visible content rect
- IntRect adjustedVisibleContentRect = adjustVisibleContentRect(m_visibleContentRect, scaleFactor());
- if (adjustedVisibleContentRect != m_visibleContentRect)
+ bool needScrollAdjustment = (adjustVisibleContentRect(m_visibleContentRect, scaleFactor()) != m_visibleContentRect);
+ bool needScaleAdjustment = (fabs(adjustScaleWithViewport(scaleFactor()) - scaleFactor()) > numeric_limits<float>::epsilon());
+ if (needScrollAdjustment || needScaleAdjustment) {
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI(" setVisibleContentRect: [%d, %d], [%.2f]", m_visibleContentRect.x(), m_visibleContentRect.y(), scaleFactor());
+#endif
setVisibleContentRect(m_visibleContentRect, scaleFactor());
+ }
}
void PageClientImpl::pageScaleFactorDidChange()
#if OS(TIZEN)
m_pageDidRendered = false;
m_viewportFitsToContent = false;
-#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
- m_restoredScaleFactor = 0;
-#endif
+ m_nonemptyLayoutRendered = false;
return;
#endif
notImplemented();
void PageClientImpl::updateTextInputState()
{
- InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
- if (inputMethodContext)
- inputMethodContext->updateTextInputState();
-
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
m_textSelection->update();
+ if (isTextSelectionMode() && isTextSelectionHandleDowned())
+ return;
#endif
+
+ InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
+ if (inputMethodContext)
+ inputMethodContext->updateTextInputState();
}
void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
IntPoint newPoint = point;
newPoint.scale(scaleFactor(), scaleFactor());
+#if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
+ if (!m_pageDidRendered)
+ m_scrollPositionBeforePageRendered = newPoint;
+ else
+ setVisibleContentRect(IntRect(newPoint, m_visibleContentRect.size()), scaleFactor());
+#else
setVisibleContentRect(IntRect(newPoint, m_visibleContentRect.size()), scaleFactor());
#endif
+#endif
}
#endif
m_restoredScrollPosition = point;
m_restoredScrollPosition.scale(scale, scale);
m_restoredScaleFactor = scale;
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_restoredScrollPosition.x(), m_restoredScrollPosition.y(), m_restoredScaleFactor);
+#endif
// Before contents size is fixed, just update visible content rect's position
m_visibleContentRect.setLocation(m_restoredScrollPosition);
void PageClientImpl::setVisibleContentRect(const IntRect& newRect, float newScale, const FloatPoint& trajectory)
{
-#if ENABLE(TIZEN_SCREEN_READER)
+#if OS(TIZEN)
IntPoint previousScrollPosition(scrollPosition());
float previousScale = m_scaleFactor;
#endif
#endif
displayViewport();
-#if ENABLE(TIZEN_SCREEN_READER)
- if (ScreenReaderProxy::screenReader().isEnabled()
- && (scrollPosition() != previousScrollPosition || m_scaleFactor != previousScale))
- ewkViewGetFocusRing(m_viewImpl->view())->updateScrollAndScale(previousScrollPosition, previousScale);
+#if OS(TIZEN)
+ if (scrollPosition() != previousScrollPosition || m_scaleFactor != previousScale)
+ m_viewImpl->didChangeScrollAndScale(previousScrollPosition, previousScale);
#endif
#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
#if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
updateScrollbar();
#endif
-
-#if ENABLE(TIZEN_SCREEN_READER)
- m_viewImpl->page()->recalcScreenReaderFocusRect();
-#endif
}
void PageClientImpl::drawContents()
if (!m_hasSuspendedContent)
return;
+#if ENABLE(TIZEN_DLOG_SUPPORT)
+ TIZEN_LOGI("scroll position: [%d, %d], scale factor: [%.2f]", m_viewImpl->scrollPosition().x(), m_viewImpl->scrollPosition().y(), m_viewImpl->scaleFactor());
+#endif
+
// 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.
m_textSelection->updateHandlesAndContextMenu(isShow, isScrolling);
}
-bool PageClientImpl::textSelectionDown(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
+bool PageClientImpl::textSelectionDown(const WebCore::IntPoint& point)
{
if (!evas_object_focus_get(m_viewImpl->view())) {
InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
evas_object_focus_set(m_viewImpl->view(), true);
}
- return m_textSelection->textSelectionDown(point, isStartedTextSelectionFromOutside);
+ return m_textSelection->textSelectionDown(point);
}
-void PageClientImpl::textSelectionMove(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
+void PageClientImpl::textSelectionMove(const WebCore::IntPoint& point)
{
- m_textSelection->textSelectionMove(point, isStartedTextSelectionFromOutside);
+ m_textSelection->textSelectionMove(point);
}
void PageClientImpl::textSelectionUp(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside)
}
#endif
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
void PageClientImpl::requestToShowTextSelectionHandlesAndContextMenu()
{
m_textSelection->requestToShow();
}
-#endif
+
+void PageClientImpl::initTextSelectionHandlesMouseDownedStatus()
+{
+ m_textSelection->initHandlesMouseDownedStatus();
+}
+
+void PageClientImpl::changeContextMenuPosition(IntPoint& point)
+{
+ m_textSelection->changeContextMenuPosition(point);
+}
#endif
#if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
String dragStorageName("Drag");
m_viewImpl->page()->dragEntered(dragInfo, dragStorageName);
setDragMode(true);
- m_drag->setDragData(dragInfo);
+ m_drag->setDragData(dragInfo, dragImage);
m_drag->Show();
}
#endif
}
#endif
-#if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
-void PageClientImpl::didGetTextStyleStateForSelection(int underlineState, int italicState, int boldState)
-{
- WebCore::IntPoint startPoint, endPoint;
- WebCore::IntRect leftRect, rightRect;
-
- WebCore::IntRect caretRect;
- m_viewImpl->page()->getCaretPosition(caretRect);
- if (!caretRect.isEmpty()) {
- startPoint.setX(caretRect.x());
- startPoint.setY(caretRect.y() + caretRect.height());
-
- endPoint.setX(caretRect.x() + caretRect.width());
- endPoint.setY(caretRect.y() + caretRect.height());
- }
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
- else if (m_viewImpl->page()->getSelectionHandlers(leftRect, rightRect)) {
- startPoint.setX(leftRect.x());
- startPoint.setY(leftRect.y() + leftRect.height());
-
- endPoint.setX(rightRect.x() + rightRect.width());
- endPoint.setY(rightRect.y() + rightRect.height());
- }
-#endif
-
- startPoint.scale(scaleFactor(), scaleFactor());
- endPoint.scale(scaleFactor(), scaleFactor());
-
- int viewPositionX, viewPositionY;
- evas_object_geometry_get(m_viewImpl->view(), &viewPositionX, &viewPositionY, NULL, NULL);
-
- startPoint.move(-scrollPosition().x(), -scrollPosition().y());
- startPoint.move(viewPositionX, viewPositionY);
-
- endPoint.move(-scrollPosition().x(), -scrollPosition().y());
- endPoint.move(viewPositionX, viewPositionY);
-
- ewkViewDidGetTextStyleStateForSelection(m_viewImpl->view(), underlineState, italicState, boldState, startPoint, endPoint);
-}
-#endif
-
void PageClientImpl::didFindZoomableArea(const IntPoint& target, const IntRect& area)
{
ewk_view_zoomable_area_set(m_viewImpl->view(), target, area);
PageClientEvasGL::~PageClientEvasGL()
{
- m_viewImpl->page()->close();
+ if (m_viewImpl && m_viewImpl->page())
+ m_viewImpl->page()->close();
}
void PageClientEvasGL::updateViewportSize(const WebCore::IntSize& viewportSize, const int angle)
{
+ PageClientImpl::updateViewportSize(viewportSize, angle);
+}
+
+void PageClientEvasGL::updateVisibleContentRectSize(const WebCore::IntSize& size)
+{
if (m_surface) {
evas_gl_surface_destroy(m_evasGL, m_surface);
m_surface = 0;
}
setTargetSurface();
- PageClientImpl::updateViewportSize(viewportSize, angle);
+ PageClientImpl::updateVisibleContentRectSize(size);
}
void PageClientEvasGL::setViewNeedsDisplay(const WebCore::IntRect& rect)
{
-#if !ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
- drawContents();
+#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
+ if (!isDirectRendering())
#endif
+ drawContents();
m_viewImpl->redrawRegion(rect);
-
-#if ENABLE(TIZEN_SCREEN_READER)
- if (rect.intersects(ewkViewGetFocusRing(m_viewImpl->view())->rect()))
- m_viewImpl->page()->recalcScreenReaderFocusRect();
-#endif
}
void PageClientEvasGL::displayViewport()
#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
// We should not draw here when Direct Rendering is enabled.
// Because we will draw directly when evas is updated - on_pixels_for_accelerated_compositing().
- ewk_view_mark_for_sync(m_viewImpl->view());
-#else
- setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
+ if (isDirectRendering())
+ ewk_view_mark_for_sync(m_viewImpl->view());
+ else
#endif
+ setViewNeedsDisplay(IntRect(IntPoint(), viewSize()));
#if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
updateScrollbar();
#endif
-
-#if ENABLE(TIZEN_SCREEN_READER)
- m_viewImpl->page()->recalcScreenReaderFocusRect();
-#endif
}
void PageClientEvasGL::drawContents()
{
- if (evas_gl_make_current(m_evasGL, m_surface, m_context) != EINA_TRUE)
+ if (!drawingArea() || !(drawingArea()->layerTreeCoordinatorProxy()) || !m_isVisible)
+ return;
+
+ WebLayerTreeRenderer* renderer = drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer();
+ if (!renderer)
+ return;
+
+ if (!makeContextCurrent())
return;
WebCore::TransformationMatrix matrix;
IntSize ewkViewSize = viewSize();
#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
- Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
- m_angle = ecore_evas_rotation_get(ee);
- if (drawingArea())
- drawingArea()->setAngle(m_angle);
- matrix.rotate3d(0.0, 0.0, 1.0, 360 - m_angle);
-
- if (m_angle == 90 || m_angle == 270) {
- glViewport(0, 0, ewkViewSize.height(), ewkViewSize.width());
- if (m_angle == 90)
- matrix.translate(-ewkViewSize.width(), 0);
- else if (m_angle == 270)
- matrix.translate(0, -ewkViewSize.height());
- clipRect = IntRect(IntPoint(), ewkViewSize.transposedSize());
- } else {
+ if (isDirectRendering()) {
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
+ m_angle = ecore_evas_rotation_get(ee);
+ renderer->setAngle(m_angle);
+ matrix.rotate3d(0.0, 0.0, 1.0, 360 - m_angle);
+
+ if (m_angle == 90 || m_angle == 270) {
+ glViewport(0, 0, ewkViewSize.height(), ewkViewSize.width());
+ if (m_angle == 90)
+ matrix.translate(-ewkViewSize.width(), 0);
+ else if (m_angle == 270)
+ matrix.translate(0, -ewkViewSize.height());
+ clipRect = IntRect(IntPoint(), ewkViewSize.transposedSize());
+ } else {
+ glViewport(0, 0, ewkViewSize.width(), ewkViewSize.height());
+ if (m_angle == 180)
+ matrix.translate(-ewkViewSize.width(), -ewkViewSize.height());
+ clipRect = IntRect(IntPoint(), ewkViewSize);
+ }
+ } else
+#endif
+ {
glViewport(0, 0, ewkViewSize.width(), ewkViewSize.height());
- if (m_angle == 180)
- matrix.translate(-ewkViewSize.width(), -ewkViewSize.height());
clipRect = IntRect(IntPoint(), ewkViewSize);
}
-#else
- glViewport(0, 0, ewkViewSize.width(), ewkViewSize.height());
- clipRect = IntRect(IntPoint(), ewkViewSize);
-#endif
+
matrix *= m_viewImpl->transformToView().toTransformationMatrix();
- if (drawingArea()) {
- if (drawingArea()->layerTreeCoordinatorProxy()) {
- WebLayerTreeRenderer* renderer = drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer();
#if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
- if (m_shouldMakeBackupTexture) {
- glViewport(0, 0, m_initialViewRect.width(), m_initialViewRect.height());
- glClearColor(1, 1, 1, 1);
- glClear(GL_COLOR_BUFFER_BIT);
- renderer->paintToBackupTexture(matrix, 1.0f, m_initialViewRect, m_bgColor);
- m_shouldMakeBackupTexture = false;
- } else if (m_shouldShowBackupTexture) {
- matrix.makeIdentity();
- glViewport(0, 0, m_initialViewRect.width(), m_initialViewRect.height());
- renderer->showBackupTexture(matrix, 1.0f, m_initialViewRect);
- } else
-#endif
- renderer->paintToCurrentGLContext(matrix, 1.0f, clipRect, m_bgColor);
- }
- }
+ if (m_shouldMakeBackupTexture) {
+ glViewport(0, 0, m_initialViewRect.width(), m_initialViewRect.height());
+ glClearColor(1, 1, 1, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ renderer->paintToBackupTexture(matrix, 1.0f, m_initialViewRect, m_bgColor);
+ m_shouldMakeBackupTexture = false;
+ } else if (m_shouldShowBackupTexture) {
+ matrix.makeIdentity();
+ glViewport(0, 0, m_initialViewRect.width(), m_initialViewRect.height());
+ renderer->showBackupTexture(matrix, 1.0f, m_initialViewRect);
+ } else
+#endif
+ renderer->paintToCurrentGLContext(matrix, 1.0f, clipRect, m_bgColor);
}
void PageClientEvasGL::didRenderFrame()
m_config = evas_gl_config_new();
#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
- setenv("EVAS_GL_DIRECT_OVERRIDE", "1", 1);
- m_config->options_bits = EVAS_GL_OPTIONS_DIRECT;
+ char* directRenderingEnv = getenv("TIZEN_WEBKIT_DIRECT_RENDERING");
+ if (!directRenderingEnv || atoi(directRenderingEnv)) {
+ setenv("EVAS_GL_DIRECT_OVERRIDE", "1", 1);
+ m_config->options_bits = EVAS_GL_OPTIONS_DIRECT;
+ }
#endif
m_config->color_format = EVAS_GL_RGBA_8888;
m_config->depth_bits = EVAS_GL_DEPTH_BIT_24;
}
#if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
- makeContextCurrent();
-#else
- if (makeContextCurrent()) {
- glViewport(0, 0, width, height);
- glClearColor(1.0, 1.0, 1.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
- glFinish();
- }
+ if (isDirectRendering())
+ makeContextCurrent();
+ else
#endif
+ {
+ if (makeContextCurrent()) {
+ glViewport(0, 0, width, height);
+ glClearColor(1.0, 1.0, 1.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glFinish();
+ }
+ }
Evas_Native_Surface nativeSurface;
if (evas_gl_native_surface_get(m_evasGL, m_surface, &nativeSurface))