Changeset 170830 in webkit


Ignore:
Timestamp:
Jul 6, 2014 1:05:03 PM (10 years ago)
Author:
Antti Koivisto
Message:

Don't throttle layer flushes when the main resource is a GIF
https://bugs.webkit.org/show_bug.cgi?id=134650

Source/WebCore:
<rdar://problem/17490712>

Reviewed by Simon Fraser.

Avoid throttling big image animations.

  • page/FrameView.cpp:

(WebCore::determineLayerFlushThrottleState):

Disable for image documents.

(WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
(WebCore::FrameView::updateLayerFlushThrottling):

Refactor a bit.

  • page/LayerFlushThrottleState.h:


Rename the flag.

Source/WebKit2:

Reviewed by Simon Fraser.

  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r170829 r170830  
     12014-07-06  Antti Koivisto  <antti@apple.com>
     2
     3        Don't throttle layer flushes when the main resource is a GIF
     4        https://bugs.webkit.org/show_bug.cgi?id=134650
     5        <rdar://problem/17490712>
     6
     7        Reviewed by Simon Fraser.
     8       
     9        Avoid throttling big image animations.
     10
     11        * page/FrameView.cpp:
     12        (WebCore::determineLayerFlushThrottleState):
     13       
     14            Disable for image documents.
     15
     16        (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
     17        (WebCore::FrameView::updateLayerFlushThrottling):
     18       
     19            Refactor a bit.
     20
     21        * page/LayerFlushThrottleState.h:
     22       
     23            Rename the flag.
     24
    1252014-07-06  Andreas Kling  <akling@apple.com>
    226
  • trunk/Source/WebCore/page/FrameView.cpp

    r170557 r170830  
    5252#include "HTMLNames.h"
    5353#include "HTMLPlugInImageElement.h"
     54#include "ImageDocument.h"
    5455#include "InspectorClient.h"
    5556#include "InspectorController.h"
     
    22522253}
    22532254
     2255static LayerFlushThrottleState::Flags determineLayerFlushThrottleState(Page& page)
     2256{
     2257    // We only throttle when constantly receiving new data during the inital page load.
     2258    if (!page.progress().isMainLoadProgressing())
     2259        return 0;
     2260    // Disable for image documents so large GIF animations don't get throttled during loading.
     2261    auto* document = page.mainFrame().document();
     2262    if (!document || isImageDocument(*document))
     2263        return 0;
     2264    return LayerFlushThrottleState::Enabled;
     2265}
     2266
    22542267void FrameView::disableLayerFlushThrottlingTemporarilyForInteraction()
    22552268{
    2256     bool mainLoadProgressing = frame().page()->progress().isMainLoadProgressing();
    2257 
    2258     LayerFlushThrottleState::Flags flags = LayerFlushThrottleState::UserIsInteracting | (mainLoadProgressing ? LayerFlushThrottleState::MainLoadProgressing : 0);
    2259     if (frame().page()->chrome().client().adjustLayerFlushThrottling(flags))
     2269    if (!frame().page())
     2270        return;
     2271    auto& page = *frame().page();
     2272
     2273    LayerFlushThrottleState::Flags flags = LayerFlushThrottleState::UserIsInteracting | determineLayerFlushThrottleState(page);
     2274    if (page.chrome().client().adjustLayerFlushThrottling(flags))
    22602275        return;
    22612276
     
    22732288{
    22742289    ASSERT(frame().isMainFrame());
    2275 
    2276     bool isMainLoadProgressing = frame().page()->progress().isMainLoadProgressing();
     2290    auto& page = *frame().page();
     2291
     2292    LayerFlushThrottleState::Flags flags = determineLayerFlushThrottleState(page);
    22772293
    22782294    // See if the client is handling throttling.
    2279     LayerFlushThrottleState::Flags flags = isMainLoadProgressing ? LayerFlushThrottleState::MainLoadProgressing : 0;
    2280     if (frame().page()->chrome().client().adjustLayerFlushThrottling(flags))
     2295    if (page.chrome().client().adjustLayerFlushThrottling(flags))
    22812296        return;
    22822297
    22832298    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
    22842299        if (RenderView* renderView = frame->contentRenderer())
    2285             renderView->compositor().setLayerFlushThrottlingEnabled(isMainLoadProgressing);
     2300            renderView->compositor().setLayerFlushThrottlingEnabled(flags & LayerFlushThrottleState::Enabled);
    22862301    }
    22872302}
  • trunk/Source/WebCore/page/LayerFlushThrottleState.h

    r170557 r170830  
    3131struct LayerFlushThrottleState {
    3232    enum {
    33         MainLoadProgressing = 1 << 0,
     33        Enabled = 1 << 0,
    3434        UserIsInteracting = 1 << 1
    3535    };
  • trunk/Source/WebKit2/ChangeLog

    r170814 r170830  
     12014-07-06  Antti Koivisto  <antti@apple.com>
     2
     3        Don't throttle layer flushes when the main resource is a GIF
     4        https://bugs.webkit.org/show_bug.cgi?id=134650
     5
     6        Reviewed by Simon Fraser.
     7
     8        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     9        (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
     10
    1112014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
    212
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r170787 r170830  
    275275
    276276    bool wasThrottlingLayerFlushes = m_isThrottlingLayerFlushes;
    277     m_isThrottlingLayerFlushes = flags & WebCore::LayerFlushThrottleState::MainLoadProgressing;
     277    m_isThrottlingLayerFlushes = flags & WebCore::LayerFlushThrottleState::Enabled;
    278278
    279279    if (!wasThrottlingLayerFlushes && m_isThrottlingLayerFlushes)
Note: See TracChangeset for help on using the changeset viewer.