Changeset 140634 in webkit


Ignore:
Timestamp:
Jan 23, 2013 6:57:46 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Coordinated Graphics : Reduce the number of calls to Functional and number of IPC messages by sending the created/deleted layers in a vector.
https://bugs.webkit.org/show_bug.cgi?id=107625

Patch by Seulgi Kim <seulgikim@company100.net> on 2013-01-23
Reviewed by Benjamin Poulain.

Currently, the number of messages sent by CoordinatedLayerTreeHost is
equal to the number of layers created/deleted even though they requested
in the same cycle.
It's not good since CoreIPC creates functional before sending messages,
and CoordinatedLayerTreeHostProxy creates functional before
create/delete layers.

This patch makes CoordinatedLayerTreeHost send just one
CreateCompositingLayers message and CoordinatedLayerTreeHostProxy create
just one functional in a cycle. The same work has been done with
DeleteCompositingLayers message.

This patch will reduce the number of calls to Functional and number of
IPC messages by sending the created/deleted layers in a vector.

No new tests, no change in behavior.

  • UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:

(WebKit::CoordinatedLayerTreeHostProxy::createCompositingLayers):
(WebKit::CoordinatedLayerTreeHostProxy::deleteCompositingLayers):

  • UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:

(CoordinatedLayerTreeHostProxy):

  • UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
  • UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:

(WebKit::LayerTreeRenderer::createLayers):
(WebKit):
(WebKit::LayerTreeRenderer::deleteLayers):

  • UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:

(LayerTreeRenderer):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:

(WebKit::CoordinatedLayerTreeHost::createCompositingLayers):
(WebKit::CoordinatedLayerTreeHost::deleteCompositingLayers):

Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r140629 r140634  
     12013-01-23  Seulgi Kim  <seulgikim@company100.net>
     2
     3        Coordinated Graphics : Reduce the number of calls to Functional and number of IPC messages by sending the created/deleted layers in a vector.
     4        https://bugs.webkit.org/show_bug.cgi?id=107625
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Currently, the number of messages sent by CoordinatedLayerTreeHost is
     9        equal to the number of layers created/deleted even though they requested
     10        in the same cycle.
     11        It's not good since CoreIPC creates functional before sending messages,
     12        and CoordinatedLayerTreeHostProxy creates functional before
     13        create/delete layers.
     14
     15        This patch makes CoordinatedLayerTreeHost send just one
     16        CreateCompositingLayers message and CoordinatedLayerTreeHostProxy create
     17        just one functional in a cycle. The same work has been done with
     18        DeleteCompositingLayers message.
     19
     20        This patch will reduce the number of calls to Functional and number of
     21        IPC messages by sending the created/deleted layers in a vector.
     22
     23        No new tests, no change in behavior.
     24
     25        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
     26        (WebKit::CoordinatedLayerTreeHostProxy::createCompositingLayers):
     27        (WebKit::CoordinatedLayerTreeHostProxy::deleteCompositingLayers):
     28        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
     29        (CoordinatedLayerTreeHostProxy):
     30        * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
     31        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
     32        (WebKit::LayerTreeRenderer::createLayers):
     33        (WebKit):
     34        (WebKit::LayerTreeRenderer::deleteLayers):
     35        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
     36        (LayerTreeRenderer):
     37        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     38        (WebKit::CoordinatedLayerTreeHost::createCompositingLayers):
     39        (WebKit::CoordinatedLayerTreeHost::deleteCompositingLayers):
     40
    1412013-01-23  Huang Dongsung  <luxtella@company100.net>
    242
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp

    r138468 r140634  
    9696}
    9797
    98 void CoordinatedLayerTreeHostProxy::createCompositingLayer(CoordinatedLayerID id)
    99 {
    100     dispatchUpdate(bind(&LayerTreeRenderer::createLayer, m_renderer.get(), id));
    101 }
    102 
    103 void CoordinatedLayerTreeHostProxy::deleteCompositingLayer(CoordinatedLayerID id)
    104 {
    105     dispatchUpdate(bind(&LayerTreeRenderer::deleteLayer, m_renderer.get(), id));
     98void CoordinatedLayerTreeHostProxy::createCompositingLayers(const Vector<CoordinatedLayerID>& ids)
     99{
     100    dispatchUpdate(bind(&LayerTreeRenderer::createLayers, m_renderer.get(), ids));
     101}
     102
     103void CoordinatedLayerTreeHostProxy::deleteCompositingLayers(const Vector<CoordinatedLayerID>& ids)
     104{
     105    dispatchUpdate(bind(&LayerTreeRenderer::deleteLayers, m_renderer.get(), ids));
    106106}
    107107
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h

    r138468 r140634  
    4040#include <wtf/Functional.h>
    4141#include <wtf/HashSet.h>
     42#include <wtf/Vector.h>
    4243
    4344namespace WebKit {
     
    6162    void removeCustomFilterProgram(int id);
    6263#endif
    63     void createCompositingLayer(CoordinatedLayerID);
    64     void deleteCompositingLayer(CoordinatedLayerID);
     64    void createCompositingLayers(const Vector<CoordinatedLayerID>&);
     65    void deleteCompositingLayers(const Vector<CoordinatedLayerID>&);
    6566    void setRootCompositingLayer(CoordinatedLayerID);
    6667    void setContentsSize(const WebCore::FloatSize&);
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in

    r140629 r140634  
    3030#endif
    3131    SetRootCompositingLayer(uint32_t id)
    32     CreateCompositingLayer(uint32_t id)
    33     DeleteCompositingLayer(uint32_t id)
     32    CreateCompositingLayers(Vector<uint32_t> ids)
     33    DeleteCompositingLayers(Vector<uint32_t> ids)
    3434    CreateTileForLayer(uint32_t layerID, uint32_t tileID, WebCore::IntRect tileRect, WebKit::SurfaceUpdateInfo updateInfo)
    3535    UpdateTileForLayer(uint32_t layerID, uint32_t tileID, WebCore::IntRect tileRect, WebKit::SurfaceUpdateInfo updateInfo)
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp

    r140053 r140634  
    354354}
    355355
     356void LayerTreeRenderer::createLayers(const Vector<CoordinatedLayerID>& ids)
     357{
     358    for (size_t index = 0; index < ids.size(); ++index)
     359        createLayer(ids[index]);
     360}
     361
    356362void LayerTreeRenderer::createLayer(CoordinatedLayerID id)
    357363{
     
    359365    toGraphicsLayerTextureMapper(newLayer.get())->setHasOwnBackingStore(false);
    360366    m_layers.add(id, newLayer.release());
     367}
     368
     369void LayerTreeRenderer::deleteLayers(const Vector<CoordinatedLayerID>& layerIDs)
     370{
     371    for (size_t index = 0; index < layerIDs.size(); ++index)
     372        deleteLayer(layerIDs[index]);
    361373}
    362374
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h

    r138468 r140634  
    3838#include <wtf/HashSet.h>
    3939#include <wtf/ThreadingPrimitives.h>
     40#include <wtf/Vector.h>
    4041
    4142namespace WebCore {
     
    8788    void setActive(bool);
    8889
    89     void createLayer(CoordinatedLayerID);
    90     void deleteLayer(CoordinatedLayerID);
     90    void createLayers(const Vector<CoordinatedLayerID>&);
     91    void deleteLayers(const Vector<CoordinatedLayerID>&);
    9192    void setRootLayerID(CoordinatedLayerID);
    9293    void setLayerChildren(CoordinatedLayerID, const Vector<CoordinatedLayerID>&);
     
    144145    void purgeBackingStores();
    145146
     147    void createLayer(CoordinatedLayerID);
     148    void deleteLayer(CoordinatedLayerID);
     149
    146150    void assignImageBackingToLayer(WebCore::GraphicsLayer*, CoordinatedImageBackingID);
    147151    void removeReleasedImageBackingsIfNeeded();
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r140620 r140634  
    319319    }
    320320
    321     for (size_t i = 0; i < m_layersToCreate.size(); ++i)
    322         m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CreateCompositingLayer(m_layersToCreate[i]));
     321    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CreateCompositingLayers(m_layersToCreate));
    323322    m_layersToCreate.clear();
    324323    m_shouldSyncFrame = true;
     
    335334    }
    336335
    337     for (size_t i = 0; i < m_layersToDelete.size(); ++i)
    338         m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DeleteCompositingLayer(m_layersToDelete[i]));
     336    m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::DeleteCompositingLayers(m_layersToDelete));
    339337    m_layersToDelete.clear();
    340338    m_shouldSyncFrame = true;
Note: See TracChangeset for help on using the changeset viewer.