⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 126878 in webkit


Ignore:
Timestamp:
Aug 28, 2012, 8:12:58 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] One shot drawing synchronization broken
https://bugs.webkit.org/show_bug.cgi?id=95179

Patch by Andrew Lo <anlo@rim.com> on 2012-08-28
Reviewed by Antonio Gomes.
Internally reviewed by Arvid Nilsson.

Make sure no backing store blits happen during one shot drawing
synchronization.
Since we always blit during commit now, make sure we don't blit if
we commit after a render.
We no longer need a deferred blit since we don't commit during renderContents
now. Instead, we only commit & blit once after a full render job.

  • Api/BackingStore.cpp:

(BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
(BlackBerry::WebKit::BackingStorePrivate::repaint):
(BlackBerry::WebKit::BackingStorePrivate::slowScroll):
(BlackBerry::WebKit::BackingStorePrivate::renderJob):
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::blitContents):
(BlackBerry::WebKit::BackingStorePrivate::renderContents):
(WebKit):
(BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
(BlackBerry::WebKit::BackingStorePrivate::didRenderContent):

  • Api/BackingStore_p.h:

(BackingStorePrivate):

  • Api/WebPage.cpp:

(WebKit):
(BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):

  • Api/WebPage_p.h:

(WebPagePrivate):

  • WebKitSupport/RenderQueue.cpp:

(BlackBerry::WebKit::RenderQueue::renderAllCurrentRegularRenderJobs):
(BlackBerry::WebKit::RenderQueue::renderRegularRenderJob):
(BlackBerry::WebKit::RenderQueue::visibleScrollJobsCompleted):

Location:
trunk/Source/WebKit/blackberry
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/BackingStore.cpp

    r126875 r126878  
    209209    , m_preferredTileMatrixDimension(Vertical)
    210210#if USE(ACCELERATED_COMPOSITING)
    211     , m_needsDrawLayersOnCommit(false)
    212211    , m_isDirectRenderingAnimationMessageScheduled(false)
    213212#endif
     
    391390        if (immediate) {
    392391            if (render(rect)) {
    393                 if (!shouldDirectRenderingToWindow())
     392                if (!shouldDirectRenderingToWindow() && !m_webPage->d->commitRootLayerIfNeeded())
    394393                    blitVisibleContents();
    395394                m_webPage->d->m_client->notifyContentRendered(rect);
     
    414413
    415414    if (immediate) {
    416         if (render(rect) && !isSuspended() && !shouldDirectRenderingToWindow())
     415        if (render(rect) && !isSuspended() && !shouldDirectRenderingToWindow() && !m_webPage->d->commitRootLayerIfNeeded())
    417416            blitVisibleContents();
    418417    } else {
     
    524523
    525524#if USE(ACCELERATED_COMPOSITING)
    526     drawLayersOnCommitIfNeeded();
     525    m_webPage->d->commitRootLayerIfNeeded();
    527526#endif
    528527
     
    11481147
    11491148    if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
    1150 #if USE(ACCELERATED_COMPOSITING)
    1151         // The blit will draw accelerated compositing layers if necessary
    1152         m_needsDrawLayersOnCommit = false;
    1153 #endif
    1154 
    11551149        BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage(
    11561150            BlackBerry::Platform::createMethodCallMessage(
     
    12481242
    12491243    if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
    1250 #if USE(ACCELERATED_COMPOSITING)
    1251         // The blit will draw accelerated compositing layers if necessary
    1252         m_needsDrawLayersOnCommit = false;
    1253 #endif
    1254 
    12551244        BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage(
    12561245            BlackBerry::Platform::createMethodCallMessage(
     
    22892278        return;
    22902279
    2291 #if USE(ACCELERATED_COMPOSITING)
    2292     // When committing the pending accelerated compositing layer changes, it's
    2293     // necessary to draw the new layer appearance. This is normally done as
    2294     // part of a blit, but if no blit happens because of this rendering, for
    2295     // example because we're rendering an offscreen rectangle, someone needs to
    2296     // catch this flag and make sure those layers get drawn.
    2297     // This is just a complicated way to do
    2298     // "if (commitRootLayerIfNeeded()) drawLayersOnCommit();"
    2299     if (m_webPage->d->commitRootLayerIfNeeded())
    2300         m_needsDrawLayersOnCommit = true;
    2301 #endif
    2302 
    23032280    BlackBerry::Platform::Graphics::Drawable* bufferDrawable =
    23042281        BlackBerry::Platform::Graphics::lockBufferDrawable(targetBuffer);
     
    26022579
    26032580#if USE(ACCELERATED_COMPOSITING)
    2604 bool BackingStorePrivate::drawLayersOnCommitIfNeeded()
    2605 {
    2606     // Check if rendering caused a commit and we need to redraw the layers
    2607     if (!m_needsDrawLayersOnCommit)
    2608         return false;
    2609 
    2610     m_needsDrawLayersOnCommit = false;
    2611     m_webPage->d->drawLayersOnCommit();
    2612 
    2613     return true;
    2614 }
    2615 
    26162581void BackingStorePrivate::drawAndBlendLayersForDirectRendering(const Platform::IntRect& dirtyRect)
    26172582{
     
    26292594
    26302595    // Check if rendering caused a commit and we need to redraw the layers.
    2631     m_needsDrawLayersOnCommit = false;
    26322596    if (WebPageCompositorPrivate* compositor = m_webPage->d->compositor())
    26332597        compositor->drawLayers(dstRect, untransformedContentsRect);
     
    26492613}
    26502614
     2615void BackingStorePrivate::didRenderContent(const Platform::IntRect& renderedRect)
     2616{
     2617    if (isScrollingOrZooming())
     2618        return;
     2619
     2620    if (!shouldDirectRenderingToWindow()) {
     2621        if (!m_webPage->d->needsOneShotDrawingSynchronization())
     2622            blitVisibleContents();
     2623    } else
     2624        invalidateWindow();
     2625
     2626    m_webPage->client()->notifyContentRendered(renderedRect);
     2627}
     2628
    26512629BackingStore::BackingStore(WebPage* webPage, BackingStoreClient* client)
    26522630    : d(new BackingStorePrivate)
  • trunk/Source/WebKit/blackberry/Api/BackingStore_p.h

    r126485 r126878  
    335335    BlackBerry::Platform::Graphics::Buffer* buffer() const;
    336336
     337    void didRenderContent(const Platform::IntRect& renderedRect);
     338
    337339    static WebPage* s_currentBackingStoreOwner;
    338340
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r126871 r126878  
    54875487
    54885488#if USE(ACCELERATED_COMPOSITING)
    5489 void WebPagePrivate::drawLayersOnCommit()
    5490 {
    5491     if (!Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
    5492         // This method will only be called when the layer appearance changed due to
    5493         // animations. And only if we don't need a one shot drawing sync.
    5494         ASSERT(!needsOneShotDrawingSynchronization());
    5495 
    5496         if (!m_webPage->isVisible())
    5497             return;
    5498 
    5499         m_backingStore->d->willDrawLayersOnCommit();
    5500 
    5501         Platform::userInterfaceThreadMessageClient()->dispatchMessage(
    5502             Platform::createMethodCallMessage(&WebPagePrivate::drawLayersOnCommit, this));
    5503         return;
    5504     }
    5505 
    5506 #if DEBUG_AC_COMMIT
    5507     Platform::log(Platform::LogLevelCritical, "%s", WTF_PRETTY_FUNCTION);
    5508 #endif
    5509 
    5510     if (!m_backingStore->d->shouldDirectRenderingToWindow())
    5511         m_backingStore->d->blitVisibleContents();
    5512 }
    5513 
    55145489void WebPagePrivate::scheduleRootLayerCommit()
    55155490{
     
    57605735    }
    57615736
    5762     // If the web page needs layout, the commit will fail.
    5763     // No need to draw the layers if nothing changed.
    5764     if (commitRootLayerIfNeeded())
    5765         drawLayersOnCommit();
     5737    commitRootLayerIfNeeded();
    57665738}
    57675739
  • trunk/Source/WebKit/blackberry/Api/WebPage_p.h

    r126768 r126878  
    410410    // Thread safe.
    411411    void resetCompositingSurface();
    412     void drawLayersOnCommit(); // Including backing store blit.
    413412
    414413    // Compositing thread.
  • trunk/Source/WebKit/blackberry/ChangeLog

    r126875 r126878  
     12012-08-28  Andrew Lo  <anlo@rim.com>
     2
     3        [BlackBerry] One shot drawing synchronization broken
     4        https://bugs.webkit.org/show_bug.cgi?id=95179
     5
     6        Reviewed by Antonio Gomes.
     7        Internally reviewed by Arvid Nilsson.
     8
     9        Make sure no backing store blits happen during one shot drawing
     10        synchronization.
     11        Since we always blit during commit now, make sure we don't blit if
     12        we commit after a render.
     13        We no longer need a deferred blit since we don't commit during renderContents
     14        now. Instead, we only commit & blit once after a full render job.
     15
     16        * Api/BackingStore.cpp:
     17        (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
     18        (BlackBerry::WebKit::BackingStorePrivate::repaint):
     19        (BlackBerry::WebKit::BackingStorePrivate::slowScroll):
     20        (BlackBerry::WebKit::BackingStorePrivate::renderJob):
     21        (BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
     22        (BlackBerry::WebKit::BackingStorePrivate::blitContents):
     23        (BlackBerry::WebKit::BackingStorePrivate::renderContents):
     24        (WebKit):
     25        (BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
     26        (BlackBerry::WebKit::BackingStorePrivate::didRenderContent):
     27        * Api/BackingStore_p.h:
     28        (BackingStorePrivate):
     29        * Api/WebPage.cpp:
     30        (WebKit):
     31        (BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):
     32        * Api/WebPage_p.h:
     33        (WebPagePrivate):
     34        * WebKitSupport/RenderQueue.cpp:
     35        (BlackBerry::WebKit::RenderQueue::renderAllCurrentRegularRenderJobs):
     36        (BlackBerry::WebKit::RenderQueue::renderRegularRenderJob):
     37        (BlackBerry::WebKit::RenderQueue::visibleScrollJobsCompleted):
     38
    1392012-08-28  Parth Patel  <parpatel@rim.com>
    240
  • trunk/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp

    r126636 r126878  
    656656    m_currentRegularRenderJobsBatchUnderPressure = false;
    657657
    658     // Update the screen only if we're not scrolling or zooming.
    659     if (rendered && !m_parent->isScrollingOrZooming()) {
    660         if (!m_parent->shouldDirectRenderingToWindow())
    661             m_parent->blitVisibleContents();
    662         else
    663             m_parent->invalidateWindow();
    664         m_parent->m_webPage->client()->notifyContentRendered(renderedRect);
    665     }
     658    if (rendered)
     659        m_parent->didRenderContent(renderedRect);
    666660
    667661    if (m_parent->shouldSuppressNonVisibleRegularRenderJobs() && !regionNotRendered.isEmpty())
     
    811805        m_currentRegularRenderJobsBatchRegion = Platform::IntRectRegion();
    812806        m_currentRegularRenderJobsBatchUnderPressure = false;
    813         // Update the screen only if we're not scrolling or zooming.
    814         if (!m_parent->isScrollingOrZooming()) {
    815             if (!m_parent->shouldDirectRenderingToWindow())
    816                 m_parent->blitVisibleContents();
    817             else
    818                 m_parent->invalidateWindow();
    819             m_parent->m_webPage->client()->notifyContentRendered(renderedRect);
    820         }
     807        m_parent->didRenderContent(renderedRect);
    821808    }
    822809
     
    881868    ASSERT(m_visibleScrollJobs.empty());
    882869    m_visibleScrollJobsCompleted.clear();
    883     if (shouldBlit && !m_parent->isScrollingOrZooming()) {
    884         if (!m_parent->shouldDirectRenderingToWindow())
    885             m_parent->blitVisibleContents();
    886         else
    887             m_parent->invalidateWindow();
    888         m_parent->m_webPage->client()->notifyContentRendered(m_parent->visibleContentsRect());
    889     }
     870    if (shouldBlit)
     871        m_parent->didRenderContent(m_parent->visibleContentsRect());
    890872}
    891873
Note: See TracChangeset for help on using the changeset viewer.