Example #1
0
BackingStoreClient* BackingStoreClient::create(Frame* frame, Frame* parentFrame, WebPage* parentPage)
{
    ASSERT(parentPage);
    ASSERT(frame->view());

    // FIXME: We do not support inner frames for now.
    if (parentFrame)
        return 0;

    BackingStoreClient* parentBackingStoreClient
        = parentFrame
        ? parentPage->d->backingStoreClientForFrame(parentFrame)
        : 0;

    // If this frame has a parent with no backingstore then just stop since
    // our frame heirarchy is done.
    if (parentFrame && !parentBackingStoreClient)
        return 0;

    BackingStoreClient* it = new BackingStoreClient(frame, parentFrame, parentPage);
    ASSERT(it);

    // Frame -> BackingStoreClient mapping is controlled by the Page.
    parentPage->d->addBackingStoreClientForFrame(frame, it);

    // Add the backing store client to the child list of its parent.
    if (parentBackingStoreClient)
        parentBackingStoreClient->addChild(it);

    return it;
}
Example #2
0
void ChromeClientBlackBerry::invalidateContentsForSlowScroll(const IntSize& delta, const IntRect& updateRect, bool immediate, const ScrollView* scrollView)
{
    if (scrollView != m_webPagePrivate->m_mainFrame->view())
        invalidateContentsAndRootView(updateRect, true /*immediate*/);
    else {
        BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
        ASSERT(backingStoreClient);
        backingStoreClient->checkOriginOfCurrentScrollOperation();

        m_webPagePrivate->m_backingStore->d->slowScroll(delta, updateRect, immediate);
    }
}
Example #3
0
void ChromeClientBlackBerry::invalidateContentsForSlowScroll(const IntSize& delta, const IntRect& updateRect, bool immediate, const ScrollView* scrollView)
{
    if (scrollView != m_webPage->d->m_mainFrame->view())
        m_webPage->backingStore()->d->repaint(updateRect, true /*contentChanged*/, true /*immediate*/);
    else {
        BackingStoreClient* backingStoreClientForFrame = m_webPage->d->backingStoreClientForFrame(m_webPage->d->m_mainFrame);
        ASSERT(backingStoreClientForFrame);
        backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();

        m_webPage->backingStore()->d->slowScroll(delta, updateRect, immediate);
    }
}
Example #4
0
void ChromeClientBlackBerry::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect)
{
    // FIXME: There's a chance the function is called indirectly by FrameView's dtor
    // when the Frame's view() is null. We probably want to fix it in another way, but
    // at this moment let's do a quick fix.
    if (!m_webPagePrivate->m_mainFrame->view())
        return;

    BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_webPagePrivate->m_mainFrame);
    ASSERT(backingStoreClientForFrame);
    backingStoreClientForFrame->checkOriginOfCurrentScrollOperation();

    m_webPagePrivate->m_backingStore->d->scroll(delta, scrollViewRect, clipRect);
}
Example #5
0
void ChromeClientBlackBerry::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect)
{
    // FIXME: There's a chance the function is called indirectly by FrameView's dtor
    // when the Frame's view() is null. We probably want to fix it in another way, but
    // at this moment let's do a quick fix.
    if (!m_webPagePrivate->m_mainFrame->view())
        return;

    BackingStoreClient* backingStoreClient = m_webPagePrivate->backingStoreClient();
    ASSERT(backingStoreClient);
    backingStoreClient->checkOriginOfCurrentScrollOperation();

    m_webPagePrivate->m_backingStore->d->scroll(delta, scrollViewRect, clipRect);

    // Shift the spell check dialog box as we scroll.
    m_webPagePrivate->m_inputHandler->redrawSpellCheckDialogIfRequired();
}
void FrameLoaderClientBlackBerry::transitionToCommittedForNewPage()
{
    m_cancelLoadOnNextData = false;

    // In Frame::createView, Frame's FrameView object is set to 0 and recreated.
    // This operation is not atomic, and an attempt to blit contents might happen
    // in the backing store from another thread (see BackingStorePrivate::blitContents method),
    // so we suspend and resume screen update to make sure we do not get a invalid FrameView
    // state.
    BackingStoreClient* backingStoreClientForFrame = m_webPagePrivate->backingStoreClientForFrame(m_frame);
    if (backingStoreClientForFrame)
        backingStoreClientForFrame->backingStore()->d->suspendScreenAndBackingStoreUpdates();

    // We are navigating away from this document, so clean up any footprint we might have.
    if (m_frame->document())
        m_webPagePrivate->clearDocumentData(m_frame->document());

    Color backgroundColor(m_webPagePrivate->m_webSettings->backgroundColor());

    m_frame->createView(m_webPagePrivate->viewportSize(),      /* viewport */
                        backgroundColor,                       /* background color */
                        backgroundColor.hasAlpha(),            /* is transparent */
                        m_webPagePrivate->actualVisibleSize(), /* fixed reported size */
                        m_webPagePrivate->fixedLayoutSize(),   /* fixed layout size */
                        m_webPagePrivate->useFixedLayout(),    /* use fixed layout */
                        ScrollbarAlwaysOff,                    /* hor mode */
                        true,                                  /* lock the mode */
                        ScrollbarAlwaysOff,                    /* ver mode */
                        true);                                 /* lock the mode */

    if (backingStoreClientForFrame)
        backingStoreClientForFrame->backingStore()->d->resumeScreenAndBackingStoreUpdates(BackingStore::None);
    m_frame->view()->updateCanHaveScrollbars();

    if (isMainFrame()) {
        // Since the mainframe has a tiled backingstore request to receive all update
        // rects instead of the default which just sends update rects for currently
        // visible viewport.
        m_frame->view()->setPaintsEntireContents(true);
    }
}