Changeset 187178 in webkit


Ignore:
Timestamp:
Jul 22, 2015 1:59:49 PM (9 years ago)
Author:
Simon Fraser
Message:

Add logging for TiledCoreAnimationDrawingArea resizing
https://bugs.webkit.org/show_bug.cgi?id=147180

Reviewed by Tim Horton.

Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().

  • Platform/Logging.h:
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r187174 r187178  
     12015-07-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add logging for TiledCoreAnimationDrawingArea resizing
     4        https://bugs.webkit.org/show_bug.cgi?id=147180
     5
     6        Reviewed by Tim Horton.
     7
     8        Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
     9
     10        * Platform/Logging.h:
     11        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     12        (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
     13
    1142015-07-22  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/WebKit2/Platform/Logging.h

    r187135 r187178  
    5151    M(Printing) \
    5252    M(RemoteLayerTree) \
     53    M(Resize) \
    5354    M(SessionState) \
    5455    M(StorageAPI) \
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r187054 r187178  
    3333#import "LayerHostingContext.h"
    3434#import "LayerTreeContext.h"
     35#import "Logging.h"
    3536#import "ViewGestureControllerMessages.h"
    3637#import "WebFrame.h"
     
    281282        return;
    282283
     284    LOG(Resize, "TiledCoreAnimationDrawingArea %p scaleViewToFitDocumentIfNeeded", this);
    283285    m_webPage.layoutIfNeeded();
    284286
     
    288290    bool documentWidthChanged = m_lastDocumentSizeForScaleToFit.width() != documentWidth;
    289291    bool viewWidthChanged = m_lastViewSizeForScaleToFit.width() != viewWidth;
     292
     293    LOG(Resize, "  documentWidthChanged=%d, viewWidthChanged=%d", documentWidthChanged, viewWidthChanged);
    290294
    291295    if (!documentWidthChanged && !viewWidthChanged)
     
    308312        m_webPage.setFixedLayoutSize(fixedLayoutSize);
    309313        m_webPage.scaleView(viewScale);
    310         return;
    311     }
     314
     315        LOG(Resize, "  using fixed layout at %dx%d. document width %d unchanged, scaled to %.4f to fit view width %d", fixedLayoutSize.width(), fixedLayoutSize.height(), documentWidth, viewScale, viewWidth);
     316        return;
     317    }
     318
     319
     320    LOG(Resize, "  doing unconstrained layout");
    312321
    313322    // Lay out at the view size.
     
    322331
    323332    float viewScale = 1;
     333
     334    LOG(Resize, "  unscaled document size %dx%d. need to scale down: %d", documentSize.width(), documentSize.height(), documentWidth && documentWidth < maximumDocumentWidthForScaling && viewWidth < documentWidth);
    324335
    325336    // Avoid scaling down documents that don't fit in a certain width, to allow
     
    336347        IntSize fixedLayoutSize(documentWidth, std::ceil((m_webPage.size().height() - m_webPage.corePage()->topContentInset()) / viewScale));
    337348        m_webPage.setFixedLayoutSize(fixedLayoutSize);
     349
     350        LOG(Resize, "  using fixed layout at %dx%d. document width %d, scaled to %.4f to fit view width %d", fixedLayoutSize.width(), fixedLayoutSize.height(), documentWidth, viewScale, viewWidth);
    338351    }
    339352
Note: See TracChangeset for help on using the changeset viewer.