Changeset 216502 in webkit


Ignore:
Timestamp:
May 9, 2017 5:38:43 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Coordinated Graphics] Debug Visuals don't hide
https://bugs.webkit.org/show_bug.cgi?id=162704

Patch by Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com> on 2017-05-09
Reviewed by Žan Doberšek.

Source/WebCore:

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
(WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::setDebugBorder):
showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
the "show" argument to the layer state.

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

(WebCore::DebugVisuals::DebugVisuals):
(WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
To set the debug visuals of a layer, the visibility flags of the borders and the repaint
counters as well as the border width and color are needed. Thus a new bundle struct
DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
send the information at once.

Source/WebKit2:

  • Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:

(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
(IPC::ArgumentCoder<DebugVisuals>::encode):
(IPC::ArgumentCoder<DebugVisuals>::decode):
The encoder and decoder for DebugVisuals have been added.

  • Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:

(WebKit::CoordinatedGraphicsScene::setLayerState):
Update the debug visuals of a layer according to the DebugVisuals information
if the debugVisualsChanged flag is set to true.

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r216501 r216502  
     12017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
     2
     3        [Coordinated Graphics] Debug Visuals don't hide
     4        https://bugs.webkit.org/show_bug.cgi?id=162704
     5
     6        Reviewed by Žan Doberšek.
     7
     8        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     9        (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
     10        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
     11        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
     12        (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
     13        showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
     14        the "show" argument to the layer state.
     15
     16        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
     17        (WebCore::DebugVisuals::DebugVisuals):
     18        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
     19        To set the debug visuals of a layer, the visibility flags of the borders and the repaint
     20        counters as well as the border width and color are needed. Thus a new bundle struct
     21        DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
     22        send the information at once.
     23
    1242017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
    225
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r215469 r216502  
    44 Copyright (C) 2012 Company 100, Inc.
    55 Copyright (C) 2012 Intel Corporation. All rights reserved.
     6 Copyright (C) 2017 Sony Interactive Entertainment Inc.
    67
    78 This library is free software; you can redistribute it and/or
     
    448449
    449450    GraphicsLayer::setShowDebugBorder(show);
    450     m_layerState.showDebugBorders = true;
    451     m_layerState.flagsChanged = true;
     451    m_layerState.debugVisuals.showDebugBorders = show;
     452    m_layerState.debugVisualsChanged = true;
    452453
    453454    didChangeLayerState();
     
    460461
    461462    GraphicsLayer::setShowRepaintCounter(show);
    462     m_layerState.showRepaintCounter = true;
    463     m_layerState.flagsChanged = true;
     463    m_layerState.debugVisuals.showRepaintCounter = show;
     464    m_layerState.debugVisualsChanged = true;
    464465
    465466    didChangeLayerState();
     
    662663        m_layerState.preserves3D = preserves3D();
    663664        m_layerState.fixedToViewport = fixedToViewport();
    664         m_layerState.showDebugBorders = isShowingDebugBorder();
    665         m_layerState.showRepaintCounter = isShowingRepaintCounter();
    666665        m_layerState.isScrollable = isScrollable();
    667666    }
    668667
    669     if (m_layerState.showDebugBorders)
     668    if (m_layerState.debugVisualsChanged) {
     669        m_layerState.debugVisuals.showDebugBorders = isShowingDebugBorder();
     670        m_layerState.debugVisuals.showRepaintCounter = isShowingRepaintCounter();
     671    }
     672
     673    if (m_layerState.debugVisuals.showDebugBorders)
    670674        updateDebugIndicators();
    671675}
     
    673677void CoordinatedGraphicsLayer::setDebugBorder(const Color& color, float width)
    674678{
    675     ASSERT(m_layerState.showDebugBorders);
    676     if (m_layerState.debugBorderColor != color) {
    677         m_layerState.debugBorderColor = color;
    678         m_layerState.debugBorderColorChanged = true;
    679     }
    680 
    681     if (m_layerState.debugBorderWidth != width) {
    682         m_layerState.debugBorderWidth = width;
    683         m_layerState.debugBorderWidthChanged = true;
     679    ASSERT(m_layerState.debugVisuals.showDebugBorders);
     680    if (m_layerState.debugVisuals.debugBorderColor != color) {
     681        m_layerState.debugVisuals.debugBorderColor = color;
     682        m_layerState.debugVisualsChanged = true;
     683    }
     684
     685    if (m_layerState.debugVisuals.debugBorderWidth != width) {
     686        m_layerState.debugVisuals.debugBorderWidth = width;
     687        m_layerState.debugVisualsChanged = true;
    684688    }
    685689}
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h

    r216101 r216502  
    22 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies)
    33 * Copyright (C) 2013 Company 100, Inc. All rights reserved.
     4 * Copyright (C) 2017 Sony Interactive Entertainment Inc.
    45 *
    56 * Redistribution and use in source and binary forms, with or without
     
    6566};
    6667
     68struct DebugVisuals {
     69    DebugVisuals()
     70        : showDebugBorders(false)
     71        , showRepaintCounter(false) { }
     72    Color debugBorderColor;
     73    float debugBorderWidth { 0 };
     74    union {
     75        struct {
     76            bool showDebugBorders : 1;
     77            bool showRepaintCounter : 1;
     78        };
     79        unsigned flags;
     80    };
     81};
     82
    6783struct CoordinatedGraphicsLayerState {
    6884    union {
     
    7692            bool opacityChanged: 1;
    7793            bool solidColorChanged: 1;
    78             bool debugBorderColorChanged: 1;
    79             bool debugBorderWidthChanged: 1;
     94            bool debugVisualsChanged: 1;
    8095            bool replicaChanged: 1;
    8196            bool maskChanged: 1;
     
    104119            bool preserves3D : 1;
    105120            bool fixedToViewport : 1;
    106             bool showDebugBorders : 1;
    107             bool showRepaintCounter : 1;
    108121            bool isScrollable: 1;
    109122        };
     
    120133        , preserves3D(false)
    121134        , fixedToViewport(false)
    122         , showDebugBorders(false)
    123         , showRepaintCounter(false)
    124135        , isScrollable(false)
    125136        , opacity(0)
    126         , debugBorderWidth(0)
    127137        , replica(InvalidCoordinatedLayerID)
    128138        , mask(InvalidCoordinatedLayerID)
     
    145155    float opacity;
    146156    Color solidColor;
    147     Color debugBorderColor;
    148     float debugBorderWidth;
    149157    FilterOperations filters;
    150158    TextureMapperAnimations animations;
     
    155163    CoordinatedLayerID mask;
    156164    CoordinatedImageBackingID imageID;
     165    DebugVisuals debugVisuals;
    157166
    158167    unsigned repaintCount;
  • trunk/Source/WebKit2/ChangeLog

    r216497 r216502  
     12017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
     2
     3        [Coordinated Graphics] Debug Visuals don't hide
     4        https://bugs.webkit.org/show_bug.cgi?id=162704
     5
     6        Reviewed by Žan Doberšek.
     7
     8        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
     9        (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
     10        (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
     11        (IPC::ArgumentCoder<DebugVisuals>::encode):
     12        (IPC::ArgumentCoder<DebugVisuals>::decode):
     13        The encoder and decoder for DebugVisuals have been added.
     14
     15        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
     16        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
     17        (WebKit::CoordinatedGraphicsScene::setLayerState):
     18        Update the debug visuals of a layer according to the DebugVisuals information
     19        if the debugVisualsChanged flag is set to true.
     20
    1212017-05-09  Zan Dobersek  <zdobersek@igalia.com>
    222
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp

    r216101 r216502  
    33 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    44 * Copyright (C) 2012 Company 100, Inc.
     5 * Copyright (C) 2017 Sony Interactive Entertainment Inc.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    646647        encoder << state.solidColor;
    647648
    648     if (state.debugBorderColorChanged)
    649         encoder << state.debugBorderColor;
    650 
    651     if (state.debugBorderWidthChanged)
    652         encoder << state.debugBorderWidth;
     649    if (state.debugVisualsChanged)
     650        encoder << state.debugVisuals;
    653651
    654652    if (state.filtersChanged)
     
    721719        return false;
    722720
    723     if (state.debugBorderColorChanged && !decoder.decode(state.debugBorderColor))
    724         return false;
    725 
    726     if (state.debugBorderWidthChanged && !decoder.decode(state.debugBorderWidth))
     721    if (state.debugVisualsChanged && !decoder.decode(state.debugVisuals))
    727722        return false;
    728723
     
    916911}
    917912
     913void ArgumentCoder<DebugVisuals>::encode(Encoder& encoder, const DebugVisuals& debugVisuals)
     914{
     915    encoder << debugVisuals.debugBorderColor;
     916    encoder << debugVisuals.debugBorderWidth;
     917    encoder << debugVisuals.flags;
     918}
     919
     920bool ArgumentCoder<DebugVisuals>::decode(Decoder& decoder, DebugVisuals& debugVisuals)
     921{
     922    if (!decoder.decode(debugVisuals.debugBorderColor))
     923        return false;
     924
     925    if (!decoder.decode(debugVisuals.debugBorderWidth))
     926        return false;
     927
     928    if (!decoder.decode(debugVisuals.flags))
     929        return false;
     930
     931    return true;
     932}
     933
    918934} // namespace IPC
    919935
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h

    r212638 r216502  
    33 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    44 * Copyright (C) 2012 Company 100, Inc.
     5 * Copyright (C) 2017 Sony Interactive Entertainment Inc.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    4445class TransformOperations;
    4546struct Length;
     47struct DebugVisuals;
    4648
    4749class FilterOperations;
     
    9597};
    9698
     99template<> struct ArgumentCoder<WebCore::DebugVisuals> {
     100    static void encode(Encoder&, const WebCore::DebugVisuals&);
     101    static bool decode(Decoder&, WebCore::DebugVisuals&);
     102};
     103
    97104} // namespace IPC
    98105
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp

    r216101 r216502  
    22    Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    33    Copyright (C) 2012 Company 100, Inc.
     4    Copyright (C) 2017 Sony Interactive Entertainment Inc.
    45
    56    This library is free software; you can redistribute it and/or
     
    233234        layer->setSolidColor(layerState.solidColor);
    234235
    235     if (layerState.debugBorderColorChanged || layerState.debugBorderWidthChanged)
    236         layer->setDebugVisuals(layerState.showDebugBorders, layerState.debugBorderColor, layerState.debugBorderWidth, layerState.showRepaintCounter);
     236    if (layerState.debugVisualsChanged)
     237        layer->setDebugVisuals(layerState.debugVisuals.showDebugBorders, layerState.debugVisuals.debugBorderColor, layerState.debugVisuals.debugBorderWidth, layerState.debugVisuals.showRepaintCounter);
    237238
    238239    if (layerState.replicaChanged)
Note: See TracChangeset for help on using the changeset viewer.