Changeset 105460 in webkit


Ignore:
Timestamp:
Jan 19, 2012 4:07:53 PM (12 years ago)
Author:
jamesr@google.com
Message:

[chromium] Remove CCLayerDelegate, add ContentLayerDelegate for painting
https://bugs.webkit.org/show_bug.cgi?id=76663

Reviewed by Kenneth Russell.

Source/WebCore:

CCLayerDelegate used to be an interface with a half-dozen callbacks on it, but now it has only one call -
paintContents() - and that one call is only valid for one subclass of LayerChromium, ContentLayerChromium. This
removes the CCLayerDelegate pointer from LayerChromium and adds a ContentLayerDelegate for the paint call.

The majority of the code changes in this patch are removing the nil parameter from various places that construct
LayerChromium instances. Also tightens the type of GraphicsLayerChromium::m_layer to ContentLayerChromium.

Refactoring/removing dead code, so no new tests.

  • platform/graphics/chromium/Canvas2DLayerChromium.cpp:

(WebCore::Canvas2DLayerChromium::Canvas2DLayerChromium):

  • platform/graphics/chromium/CanvasLayerChromium.cpp:

(WebCore::CanvasLayerChromium::CanvasLayerChromium):

  • platform/graphics/chromium/CanvasLayerChromium.h:
  • platform/graphics/chromium/ContentLayerChromium.cpp:

(WebCore::ContentLayerPainter::create):
(WebCore::ContentLayerPainter::ContentLayerPainter):
(WebCore::ContentLayerChromium::create):
(WebCore::ContentLayerChromium::ContentLayerChromium):

  • platform/graphics/chromium/ContentLayerChromium.h:

(WebCore::ContentLayerDelegate::~ContentLayerDelegate):
(WebCore::ContentLayerChromium::clearDelegate):

  • platform/graphics/chromium/DrawingBufferChromium.cpp:

(WebCore::DrawingBuffer::platformLayer):

  • platform/graphics/chromium/GraphicsLayerChromium.cpp:

(WebCore::GraphicsLayerChromium::~GraphicsLayerChromium):
(WebCore::GraphicsLayerChromium::setContentsToImage):
(WebCore::GraphicsLayerChromium::setContentsToCanvas):
(WebCore::GraphicsLayerChromium::setContentsToMedia):
(WebCore::GraphicsLayerChromium::updateLayerPreserves3D):

  • platform/graphics/chromium/GraphicsLayerChromium.h:
  • platform/graphics/chromium/ImageLayerChromium.cpp:

(WebCore::ImageLayerChromium::create):
(WebCore::ImageLayerChromium::ImageLayerChromium):

  • platform/graphics/chromium/ImageLayerChromium.h:
  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::create):
(WebCore::LayerChromium::LayerChromium):

  • platform/graphics/chromium/LayerChromium.h:
  • platform/graphics/chromium/PluginLayerChromium.cpp:

(WebCore::PluginLayerChromium::create):
(WebCore::PluginLayerChromium::PluginLayerChromium):

  • platform/graphics/chromium/PluginLayerChromium.h:
  • platform/graphics/chromium/TiledLayerChromium.cpp:

(WebCore::TiledLayerChromium::TiledLayerChromium):
(WebCore::TiledLayerChromium::drawsContent):

  • platform/graphics/chromium/TiledLayerChromium.h:
  • platform/graphics/chromium/VideoLayerChromium.cpp:

(WebCore::VideoLayerChromium::create):
(WebCore::VideoLayerChromium::VideoLayerChromium):

  • platform/graphics/chromium/VideoLayerChromium.h:
  • platform/graphics/chromium/WebGLLayerChromium.cpp:

(WebCore::WebGLLayerChromium::create):
(WebCore::WebGLLayerChromium::WebGLLayerChromium):

  • platform/graphics/chromium/WebGLLayerChromium.h:

Source/WebKit/chromium:

  • src/WebContentLayerImpl.cpp:

(WebKit::WebContentLayerImpl::~WebContentLayerImpl):

  • src/WebContentLayerImpl.h:
  • src/WebExternalTextureLayerImpl.cpp:

(WebKit::WebExternalTextureLayerImpl::WebExternalTextureLayerImpl):
(WebKit::WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl):

  • src/WebExternalTextureLayerImpl.h:
  • src/WebLayerImpl.cpp:

(WebKit::WebLayerImpl::WebLayerImpl):
(WebKit::WebLayerImpl::~WebLayerImpl):

  • src/WebLayerImpl.h:
  • src/WebMediaPlayerClientImpl.cpp:

(WebKit::WebMediaPlayerClientImpl::readyStateChanged):

  • src/WebPluginContainerImpl.cpp:

(WebKit::WebPluginContainerImpl::WebPluginContainerImpl):

  • tests/CCLayerIteratorTest.cpp:
  • tests/CCLayerTreeHostCommonTest.cpp:

(WebCore::LayerChromiumWithForcedDrawsContent::LayerChromiumWithForcedDrawsContent):
(WebCore::TEST):

  • tests/CCLayerTreeHostTest.cpp:

(WTF::CCLayerTreeHostTest::doBeginTest):
(WTF::ContentLayerChromiumWithUpdateTracking::create):
(WTF::ContentLayerChromiumWithUpdateTracking::ContentLayerChromiumWithUpdateTracking):

  • tests/LayerChromiumTest.cpp:
  • tests/TiledLayerChromiumTest.cpp:

(WTF::FakeTiledLayerChromium::FakeTiledLayerChromium):

  • tests/TreeSynchronizerTest.cpp:

(WebCore::MockLayerChromium::MockLayerChromium):
(WebCore::TEST):

Location:
trunk/Source
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r105457 r105460  
     12012-01-19  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Remove CCLayerDelegate, add ContentLayerDelegate for painting
     4        https://bugs.webkit.org/show_bug.cgi?id=76663
     5
     6        Reviewed by Kenneth Russell.
     7
     8        CCLayerDelegate used to be an interface with a half-dozen callbacks on it, but now it has only one call -
     9        paintContents() - and that one call is only valid for one subclass of LayerChromium, ContentLayerChromium. This
     10        removes the CCLayerDelegate pointer from LayerChromium and adds a ContentLayerDelegate for the paint call.
     11
     12        The majority of the code changes in this patch are removing the nil parameter from various places that construct
     13        LayerChromium instances. Also tightens the type of GraphicsLayerChromium::m_layer to ContentLayerChromium.
     14
     15        Refactoring/removing dead code, so no new tests.
     16
     17        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
     18        (WebCore::Canvas2DLayerChromium::Canvas2DLayerChromium):
     19        * platform/graphics/chromium/CanvasLayerChromium.cpp:
     20        (WebCore::CanvasLayerChromium::CanvasLayerChromium):
     21        * platform/graphics/chromium/CanvasLayerChromium.h:
     22        * platform/graphics/chromium/ContentLayerChromium.cpp:
     23        (WebCore::ContentLayerPainter::create):
     24        (WebCore::ContentLayerPainter::ContentLayerPainter):
     25        (WebCore::ContentLayerChromium::create):
     26        (WebCore::ContentLayerChromium::ContentLayerChromium):
     27        * platform/graphics/chromium/ContentLayerChromium.h:
     28        (WebCore::ContentLayerDelegate::~ContentLayerDelegate):
     29        (WebCore::ContentLayerChromium::clearDelegate):
     30        * platform/graphics/chromium/DrawingBufferChromium.cpp:
     31        (WebCore::DrawingBuffer::platformLayer):
     32        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
     33        (WebCore::GraphicsLayerChromium::~GraphicsLayerChromium):
     34        (WebCore::GraphicsLayerChromium::setContentsToImage):
     35        (WebCore::GraphicsLayerChromium::setContentsToCanvas):
     36        (WebCore::GraphicsLayerChromium::setContentsToMedia):
     37        (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
     38        * platform/graphics/chromium/GraphicsLayerChromium.h:
     39        * platform/graphics/chromium/ImageLayerChromium.cpp:
     40        (WebCore::ImageLayerChromium::create):
     41        (WebCore::ImageLayerChromium::ImageLayerChromium):
     42        * platform/graphics/chromium/ImageLayerChromium.h:
     43        * platform/graphics/chromium/LayerChromium.cpp:
     44        (WebCore::LayerChromium::create):
     45        (WebCore::LayerChromium::LayerChromium):
     46        * platform/graphics/chromium/LayerChromium.h:
     47        * platform/graphics/chromium/PluginLayerChromium.cpp:
     48        (WebCore::PluginLayerChromium::create):
     49        (WebCore::PluginLayerChromium::PluginLayerChromium):
     50        * platform/graphics/chromium/PluginLayerChromium.h:
     51        * platform/graphics/chromium/TiledLayerChromium.cpp:
     52        (WebCore::TiledLayerChromium::TiledLayerChromium):
     53        (WebCore::TiledLayerChromium::drawsContent):
     54        * platform/graphics/chromium/TiledLayerChromium.h:
     55        * platform/graphics/chromium/VideoLayerChromium.cpp:
     56        (WebCore::VideoLayerChromium::create):
     57        (WebCore::VideoLayerChromium::VideoLayerChromium):
     58        * platform/graphics/chromium/VideoLayerChromium.h:
     59        * platform/graphics/chromium/WebGLLayerChromium.cpp:
     60        (WebCore::WebGLLayerChromium::create):
     61        (WebCore::WebGLLayerChromium::WebGLLayerChromium):
     62        * platform/graphics/chromium/WebGLLayerChromium.h:
     63
    1642012-01-19  Greg Billock  <gbillock@google.com>
    265
  • trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp

    r104044 r105460  
    5454
    5555Canvas2DLayerChromium::Canvas2DLayerChromium(GraphicsContext3D* context, const IntSize& size)
    56     : CanvasLayerChromium(0)
     56    : CanvasLayerChromium()
    5757    , m_context(context)
    5858    , m_size(size)
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp

    r103264 r105460  
    4141namespace WebCore {
    4242
    43 CanvasLayerChromium::CanvasLayerChromium(CCLayerDelegate* delegate)
    44     : LayerChromium(delegate)
     43CanvasLayerChromium::CanvasLayerChromium()
     44    : LayerChromium()
    4545{
    4646}
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h

    r103264 r105460  
    4545
    4646protected:
    47     explicit CanvasLayerChromium(CCLayerDelegate*);
     47    CanvasLayerChromium();
    4848};
    4949
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r105314 r105460  
    4949    WTF_MAKE_NONCOPYABLE(ContentLayerPainter);
    5050public:
    51     static PassOwnPtr<ContentLayerPainter> create(CCLayerDelegate* delegate)
     51    static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate)
    5252    {
    5353        return adoptPtr(new ContentLayerPainter(delegate));
     
    6666    }
    6767private:
    68     explicit ContentLayerPainter(CCLayerDelegate* delegate)
     68    explicit ContentLayerPainter(ContentLayerDelegate* delegate)
    6969        : m_delegate(delegate)
    7070    {
    7171    }
    7272
    73     CCLayerDelegate* m_delegate;
     73    ContentLayerDelegate* m_delegate;
    7474};
    7575
    76 PassRefPtr<ContentLayerChromium> ContentLayerChromium::create(CCLayerDelegate* delegate)
     76PassRefPtr<ContentLayerChromium> ContentLayerChromium::create(ContentLayerDelegate* delegate)
    7777{
    7878    return adoptRef(new ContentLayerChromium(delegate));
    7979}
    8080
    81 ContentLayerChromium::ContentLayerChromium(CCLayerDelegate* delegate)
    82     : TiledLayerChromium(delegate)
     81ContentLayerChromium::ContentLayerChromium(ContentLayerDelegate* delegate)
     82    : TiledLayerChromium()
     83    , m_delegate(delegate)
    8384{
    8485}
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h

    r104742 r105460  
    4343class LayerTextureUpdater;
    4444
     45class ContentLayerDelegate {
     46public:
     47    virtual ~ContentLayerDelegate() { }
     48    virtual void paintContents(GraphicsContext&, const IntRect& clip) = 0;
     49};
     50
    4551// A Layer that requires a GraphicsContext to render its contents.
    4652class ContentLayerChromium : public TiledLayerChromium {
    4753public:
    48     static PassRefPtr<ContentLayerChromium> create(CCLayerDelegate*);
     54    static PassRefPtr<ContentLayerChromium> create(ContentLayerDelegate*);
    4955
    5056    virtual ~ContentLayerChromium();
     57
     58    void clearDelegate() { m_delegate = 0; }
    5159
    5260    virtual void paintContentsIfDirty();
     
    5664
    5765protected:
    58     explicit ContentLayerChromium(CCLayerDelegate*);
     66    explicit ContentLayerChromium(ContentLayerDelegate*);
    5967
    6068private:
     
    6270    virtual LayerTextureUpdater* textureUpdater() const { return m_textureUpdater.get(); }
    6371
     72    ContentLayerDelegate* m_delegate;
    6473    RefPtr<LayerTextureUpdater> m_textureUpdater;
    6574};
  • trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp

    r102098 r105460  
    144144{
    145145    if (!m_platformLayer) {
    146         m_platformLayer = WebGLLayerChromium::create(0);
     146        m_platformLayer = WebGLLayerChromium::create();
    147147        m_platformLayer->setDrawingBuffer(this);
    148148        m_platformLayer->setOpaque(!m_context->getContextAttributes().alpha);
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp

    r103990 r105460  
    8383{
    8484    if (m_layer) {
    85         m_layer->setDelegate(0);
     85        m_layer->clearDelegate();
    8686        m_layer->clearRenderSurface();
    8787    }
    88     if (m_contentsLayer) {
    89         m_contentsLayer->setDelegate(0);
     88    if (m_contentsLayer)
    9089        m_contentsLayer->clearRenderSurface();
    91     }
    92     if (m_transformLayer) {
    93         m_transformLayer->setDelegate(0);
     90    if (m_transformLayer)
    9491        m_transformLayer->clearRenderSurface();
    95     }
    9692}
    9793
     
    328324    if (image) {
    329325        if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForImage) {
    330             RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create(this);
     326            RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create();
    331327            setupContentsLayer(imageLayer.get());
    332328            m_contentsLayerPurpose = ContentsLayerForImage;
     
    354350    bool childrenChanged = false;
    355351    if (platformLayer) {
    356         platformLayer->setDelegate(this);
    357352        if (m_contentsLayer.get() != platformLayer) {
    358353            setupContentsLayer(platformLayer);
     
    384379            childrenChanged = true;
    385380        }
    386         layer->setDelegate(this);
    387381        layer->setNeedsDisplay();
    388382        updateContentsRect();
     
    529523    if (m_preserves3D && !m_transformLayer) {
    530524        // Create the transform layer.
    531         m_transformLayer = LayerChromium::create(this);
     525        m_transformLayer = LayerChromium::create();
    532526        m_transformLayer->setPreserves3D(true);
    533527
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h

    r103990 r105460  
    3434#if USE(ACCELERATED_COMPOSITING)
    3535
     36#include "ContentLayerChromium.h"
    3637#include "LayerChromium.h"
    3738#include "GraphicsContext.h"
     
    4243class LayerChromium;
    4344
    44 class GraphicsLayerChromium : public GraphicsLayer, public CCLayerDelegate {
     45class GraphicsLayerChromium : public GraphicsLayer, public ContentLayerDelegate {
    4546public:
    4647    GraphicsLayerChromium(GraphicsLayerClient*);
     
    9899    virtual void deviceOrPageScaleFactorChanged();
    99100
    100     // The following functions implement the CCLayerDelegate interface.
     101    // ContentLayerDelegate implementation.
    101102    virtual void paintContents(GraphicsContext&, const IntRect& clip);
    102103
     
    131132    String m_nameBase;
    132133
    133     RefPtr<LayerChromium> m_layer;
     134    RefPtr<ContentLayerChromium> m_layer;
    134135    RefPtr<LayerChromium> m_transformLayer;
    135136    RefPtr<LayerChromium> m_contentsLayer;
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r105328 r105460  
    130130};
    131131
    132 PassRefPtr<ImageLayerChromium> ImageLayerChromium::create(CCLayerDelegate* delegate)
    133 {
    134     return adoptRef(new ImageLayerChromium(delegate));
    135 }
    136 
    137 ImageLayerChromium::ImageLayerChromium(CCLayerDelegate* delegate)
    138     : TiledLayerChromium(delegate)
     132PassRefPtr<ImageLayerChromium> ImageLayerChromium::create()
     133{
     134    return adoptRef(new ImageLayerChromium());
     135}
     136
     137ImageLayerChromium::ImageLayerChromium()
     138    : TiledLayerChromium()
    139139    , m_imageForCurrentFrame(0)
    140140{
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h

    r104003 r105460  
    5050class ImageLayerChromium : public TiledLayerChromium {
    5151public:
    52     static PassRefPtr<ImageLayerChromium> create(CCLayerDelegate*);
     52    static PassRefPtr<ImageLayerChromium> create();
    5353    virtual ~ImageLayerChromium();
    5454
     
    6060
    6161private:
    62     explicit ImageLayerChromium(CCLayerDelegate*);
     62    ImageLayerChromium();
    6363
    6464    virtual void createTextureUpdater(const CCLayerTreeHost*);
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r103990 r105460  
    5050static int s_nextLayerId = 1;
    5151
    52 PassRefPtr<LayerChromium> LayerChromium::create(CCLayerDelegate* delegate)
    53 {
    54     return adoptRef(new LayerChromium(delegate));
    55 }
    56 
    57 LayerChromium::LayerChromium(CCLayerDelegate* delegate)
    58     : m_delegate(delegate)
    59     , m_needsDisplay(false)
     52PassRefPtr<LayerChromium> LayerChromium::create()
     53{
     54    return adoptRef(new LayerChromium());
     55}
     56
     57LayerChromium::LayerChromium()
     58    : m_needsDisplay(false)
    6059    , m_layerId(s_nextLayerId++)
    6160    , m_parent(0)
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r104742 r105460  
    5757class GraphicsContext3D;
    5858
    59 class CCLayerDelegate {
    60 public:
    61     virtual ~CCLayerDelegate() { }
    62     virtual void paintContents(GraphicsContext&, const IntRect& clip) = 0;
    63 };
    64 
    6559// Base class for composited layers. Special layer types are derived from
    6660// this class.
     
    6862    friend class LayerTilerChromium;
    6963public:
    70     static PassRefPtr<LayerChromium> create(CCLayerDelegate*);
     64    static PassRefPtr<LayerChromium> create();
    7165
    7266    virtual ~LayerChromium();
     
    149143
    150144    virtual void setLayerTreeHost(CCLayerTreeHost*);
    151 
    152     void setDelegate(CCLayerDelegate* delegate) { m_delegate = delegate; }
    153145
    154146    void setIsDrawable(bool);
     
    205197
    206198protected:
    207     CCLayerDelegate* m_delegate;
    208     explicit LayerChromium(CCLayerDelegate*);
     199    LayerChromium();
    209200
    210201    // This is called to clean up resources being held in the same context as
  • trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp

    r102250 r105460  
    3737namespace WebCore {
    3838
    39 PassRefPtr<PluginLayerChromium> PluginLayerChromium::create(CCLayerDelegate* delegate)
     39PassRefPtr<PluginLayerChromium> PluginLayerChromium::create()
    4040{
    41     return adoptRef(new PluginLayerChromium(delegate));
     41    return adoptRef(new PluginLayerChromium);
    4242}
    4343
    44 PluginLayerChromium::PluginLayerChromium(CCLayerDelegate* delegate)
    45     : LayerChromium(delegate)
     44PluginLayerChromium::PluginLayerChromium()
     45    : LayerChromium()
    4646    , m_textureId(0)
    4747    , m_flipped(true)
  • trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h

    r103990 r105460  
    3737class PluginLayerChromium : public LayerChromium {
    3838public:
    39     static PassRefPtr<PluginLayerChromium> create(CCLayerDelegate* = 0);
     39    static PassRefPtr<PluginLayerChromium> create();
    4040    virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
    4141
     
    5959
    6060protected:
    61     explicit PluginLayerChromium(CCLayerDelegate*);
     61    PluginLayerChromium();
    6262
    6363private:
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r105371 r105460  
    7272};
    7373
    74 TiledLayerChromium::TiledLayerChromium(CCLayerDelegate* delegate)
    75     : LayerChromium(delegate)
     74TiledLayerChromium::TiledLayerChromium()
     75    : LayerChromium()
    7676    , m_textureFormat(GraphicsContext3D::INVALID_ENUM)
    7777    , m_skipsDraw(false)
     
    155155bool TiledLayerChromium::drawsContent() const
    156156{
    157     if (!LayerChromium::drawsContent() || !m_delegate)
     157    if (!LayerChromium::drawsContent())
    158158        return false;
    159159
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h

    r103972 r105460  
    6363
    6464protected:
    65     explicit TiledLayerChromium(CCLayerDelegate*);
     65    TiledLayerChromium();
    6666
    6767    virtual void cleanupResources();
  • trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp

    r103370 r105460  
    3737namespace WebCore {
    3838
    39 PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(CCLayerDelegate* delegate,
    40                                                           VideoFrameProvider* provider)
     39PassRefPtr<VideoLayerChromium> VideoLayerChromium::create(VideoFrameProvider* provider)
    4140{
    42     return adoptRef(new VideoLayerChromium(delegate, provider));
     41    return adoptRef(new VideoLayerChromium(provider));
    4342}
    4443
    45 VideoLayerChromium::VideoLayerChromium(CCLayerDelegate* delegate, VideoFrameProvider* provider)
    46     : LayerChromium(delegate)
     44VideoLayerChromium::VideoLayerChromium(VideoFrameProvider* provider)
     45    : LayerChromium()
    4746    , m_provider(provider)
    4847{
  • trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h

    r103990 r105460  
    4646public:
    4747
    48     static PassRefPtr<VideoLayerChromium> create(CCLayerDelegate* = 0,
    49                                                  VideoFrameProvider* = 0);
     48    static PassRefPtr<VideoLayerChromium> create(VideoFrameProvider* = 0);
    5049    virtual ~VideoLayerChromium();
    5150
     
    5352
    5453private:
    55     VideoLayerChromium(CCLayerDelegate*, VideoFrameProvider*);
     54    explicit VideoLayerChromium(VideoFrameProvider*);
    5655
    5756    // This pointer is only for passing to CCVideoLayerImpl's constructor. It should never be dereferenced by this class.
  • trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp

    r103990 r105460  
    4343namespace WebCore {
    4444
    45 PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create(CCLayerDelegate* delegate)
     45PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create()
    4646{
    47     return adoptRef(new WebGLLayerChromium(delegate));
     47    return adoptRef(new WebGLLayerChromium());
    4848}
    4949
    50 WebGLLayerChromium::WebGLLayerChromium(CCLayerDelegate* delegate)
    51     : CanvasLayerChromium(delegate)
     50WebGLLayerChromium::WebGLLayerChromium()
     51    : CanvasLayerChromium()
    5252    , m_hasAlpha(true)
    5353    , m_premultipliedAlpha(true)
  • trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h

    r103264 r105460  
    4646class WebGLLayerChromium : public CanvasLayerChromium {
    4747public:
    48     static PassRefPtr<WebGLLayerChromium> create(CCLayerDelegate* = 0);
     48    static PassRefPtr<WebGLLayerChromium> create();
    4949
    5050    virtual ~WebGLLayerChromium();
     
    6464    DrawingBuffer* drawingBuffer() const { return m_drawingBuffer; }
    6565private:
    66     explicit WebGLLayerChromium(CCLayerDelegate*);
     66    WebGLLayerChromium();
    6767    friend class WebGLLayerChromiumRateLimitTask;
    6868
  • trunk/Source/WebKit/chromium/ChangeLog

    r105449 r105460  
     12012-01-19  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Remove CCLayerDelegate, add ContentLayerDelegate for painting
     4        https://bugs.webkit.org/show_bug.cgi?id=76663
     5
     6        Reviewed by Kenneth Russell.
     7
     8        * src/WebContentLayerImpl.cpp:
     9        (WebKit::WebContentLayerImpl::~WebContentLayerImpl):
     10        * src/WebContentLayerImpl.h:
     11        * src/WebExternalTextureLayerImpl.cpp:
     12        (WebKit::WebExternalTextureLayerImpl::WebExternalTextureLayerImpl):
     13        (WebKit::WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl):
     14        * src/WebExternalTextureLayerImpl.h:
     15        * src/WebLayerImpl.cpp:
     16        (WebKit::WebLayerImpl::WebLayerImpl):
     17        (WebKit::WebLayerImpl::~WebLayerImpl):
     18        * src/WebLayerImpl.h:
     19        * src/WebMediaPlayerClientImpl.cpp:
     20        (WebKit::WebMediaPlayerClientImpl::readyStateChanged):
     21        * src/WebPluginContainerImpl.cpp:
     22        (WebKit::WebPluginContainerImpl::WebPluginContainerImpl):
     23        * tests/CCLayerIteratorTest.cpp:
     24        * tests/CCLayerTreeHostCommonTest.cpp:
     25        (WebCore::LayerChromiumWithForcedDrawsContent::LayerChromiumWithForcedDrawsContent):
     26        (WebCore::TEST):
     27        * tests/CCLayerTreeHostTest.cpp:
     28        (WTF::CCLayerTreeHostTest::doBeginTest):
     29        (WTF::ContentLayerChromiumWithUpdateTracking::create):
     30        (WTF::ContentLayerChromiumWithUpdateTracking::ContentLayerChromiumWithUpdateTracking):
     31        * tests/LayerChromiumTest.cpp:
     32        * tests/TiledLayerChromiumTest.cpp:
     33        (WTF::FakeTiledLayerChromium::FakeTiledLayerChromium):
     34        * tests/TreeSynchronizerTest.cpp:
     35        (WebCore::MockLayerChromium::MockLayerChromium):
     36        (WebCore::TEST):
     37
    1382012-01-19  Dirk Pranke  <dpranke@chromium.org>
    239
  • trunk/Source/WebKit/chromium/src/WebContentLayerImpl.cpp

    r103990 r105460  
    5353WebContentLayerImpl::~WebContentLayerImpl()
    5454{
    55     setDelegate(0);
     55    clearDelegate();
    5656}
    5757
  • trunk/Source/WebKit/chromium/src/WebContentLayerImpl.h

    r103990 r105460  
    3333class WebContentLayerClient;
    3434
    35 class WebContentLayerImpl : public WebCore::ContentLayerChromium, public WebCore::CCLayerDelegate {
     35class WebContentLayerImpl : public WebCore::ContentLayerChromium, public WebCore::ContentLayerDelegate {
    3636public:
    3737    static PassRefPtr<WebContentLayerImpl> create(WebContentLayerClient* contentClient);
     
    4242    explicit WebContentLayerImpl(WebContentLayerClient* contentClient);
    4343    virtual ~WebContentLayerImpl();
     44
     45    // ContentLayerDelegate implementation.
    4446    virtual void paintContents(WebCore::GraphicsContext&, const WebCore::IntRect& clip);
    4547
  • trunk/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.cpp

    r104209 r105460  
    4040
    4141WebExternalTextureLayerImpl::WebExternalTextureLayerImpl()
    42     : PluginLayerChromium(this)
     42    : PluginLayerChromium()
    4343{
    4444    setFlipped(false);
     
    4848WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl()
    4949{
    50     setDelegate(0);
    5150}
    5251
     
    5655}
    5756
    58 void WebExternalTextureLayerImpl::paintContents(GraphicsContext&, const IntRect&)
    59 {
    60 }
    61 
    6257} // namespace WebKit
  • trunk/Source/WebKit/chromium/src/WebExternalTextureLayerImpl.h

    r103293 r105460  
    3232namespace WebKit {
    3333
    34 class WebExternalTextureLayerImpl : public WebCore::PluginLayerChromium, public WebCore::CCLayerDelegate {
     34class WebExternalTextureLayerImpl : public WebCore::PluginLayerChromium {
    3535public:
    3636    static PassRefPtr<WebExternalTextureLayerImpl> create();
     
    3939    WebExternalTextureLayerImpl();
    4040    virtual ~WebExternalTextureLayerImpl();
    41     virtual void paintContents(WebCore::GraphicsContext&, const WebCore::IntRect& clip);
    4241    virtual bool drawsContent() const;
    4342};
  • trunk/Source/WebKit/chromium/src/WebLayerImpl.cpp

    r103990 r105460  
    3737
    3838WebLayerImpl::WebLayerImpl()
    39     : LayerChromium(this)
     39    : LayerChromium()
    4040{
    4141    // Make sure that this layer does not draw content. This way we don't have to override
     
    4646WebLayerImpl::~WebLayerImpl()
    4747{
    48     setDelegate(0);
    4948}
    5049
  • trunk/Source/WebKit/chromium/src/WebLayerImpl.h

    r103990 r105460  
    3232namespace WebKit {
    3333
    34 class WebLayerImpl : public WebCore::LayerChromium, public WebCore::CCLayerDelegate {
     34class WebLayerImpl : public WebCore::LayerChromium {
    3535public:
    3636    static PassRefPtr<WebLayerImpl> create();
  • trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp

    r105431 r105460  
    121121#if USE(ACCELERATED_COMPOSITING)
    122122    if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer) {
    123         m_videoLayer = VideoLayerChromium::create(0, this);
     123        m_videoLayer = VideoLayerChromium::create(this);
    124124        m_videoLayer->setOpaque(m_opaque);
    125125    }
  • trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp

    r103147 r105460  
    538538    , m_webPlugin(webPlugin)
    539539#if USE(ACCELERATED_COMPOSITING)
    540     , m_platformLayer(PluginLayerChromium::create(0))
     540    , m_platformLayer(PluginLayerChromium::create())
    541541#endif
    542542{
  • trunk/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp

    r104626 r105460  
    5353private:
    5454    TestLayerChromium()
    55         : LayerChromium(0)
     55        : LayerChromium()
    5656        , m_drawsContent(true)
    5757    {
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp

    r102611 r105460  
    7272class LayerChromiumWithForcedDrawsContent : public LayerChromium {
    7373public:
    74     explicit LayerChromiumWithForcedDrawsContent(CCLayerDelegate* delegate)
    75         : LayerChromium(delegate)
     74    LayerChromiumWithForcedDrawsContent()
     75        : LayerChromium()
    7676    {
    7777    }
     
    8787    // layers should also be identity transforms.
    8888
    89     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    90     RefPtr<LayerChromium> child = LayerChromium::create(0);
    91     RefPtr<LayerChromium> grandChild = LayerChromium::create(0);
     89    RefPtr<LayerChromium> parent = LayerChromium::create();
     90    RefPtr<LayerChromium> child = LayerChromium::create();
     91    RefPtr<LayerChromium> grandChild = LayerChromium::create();
    9292    parent->createRenderSurface();
    9393    parent->addChild(child);
     
    117117
    118118    TransformationMatrix identityMatrix;
    119     RefPtr<LayerChromium> layer = LayerChromium::create(0);
     119    RefPtr<LayerChromium> layer = LayerChromium::create();
    120120    layer->createRenderSurface();
    121121
     
    182182{
    183183    TransformationMatrix identityMatrix;
    184     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    185     RefPtr<LayerChromium> child = LayerChromium::create(0);
    186     RefPtr<LayerChromium> grandChild = LayerChromium::create(0);
     184    RefPtr<LayerChromium> parent = LayerChromium::create();
     185    RefPtr<LayerChromium> child = LayerChromium::create();
     186    RefPtr<LayerChromium> grandChild = LayerChromium::create();
    187187    parent->createRenderSurface();
    188188    parent->addChild(child);
     
    264264TEST(CCLayerTreeHostCommonTest, verifyTransformsForSingleRenderSurface)
    265265{
    266     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    267     RefPtr<LayerChromium> child = LayerChromium::create(0);
    268     RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
     266    RefPtr<LayerChromium> parent = LayerChromium::create();
     267    RefPtr<LayerChromium> child = LayerChromium::create();
     268    RefPtr<LayerChromiumWithForcedDrawsContent> grandChild = adoptRef(new LayerChromiumWithForcedDrawsContent());
    269269    parent->createRenderSurface();
    270270    parent->addChild(child);
     
    319319    //   - verifying that each layer has a reference to the correct renderSurface and targetRenderSurface values.
    320320
    321     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    322     RefPtr<LayerChromium> renderSurface1 = LayerChromium::create(0);
    323     RefPtr<LayerChromium> renderSurface2 = LayerChromium::create(0);
    324     RefPtr<LayerChromium> childOfRoot = LayerChromium::create(0);
    325     RefPtr<LayerChromium> childOfRS1 = LayerChromium::create(0);
    326     RefPtr<LayerChromium> childOfRS2 = LayerChromium::create(0);
    327     RefPtr<LayerChromium> grandChildOfRoot = LayerChromium::create(0);
    328     RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS1 = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
    329     RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS2 = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
     321    RefPtr<LayerChromium> parent = LayerChromium::create();
     322    RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
     323    RefPtr<LayerChromium> renderSurface2 = LayerChromium::create();
     324    RefPtr<LayerChromium> childOfRoot = LayerChromium::create();
     325    RefPtr<LayerChromium> childOfRS1 = LayerChromium::create();
     326    RefPtr<LayerChromium> childOfRS2 = LayerChromium::create();
     327    RefPtr<LayerChromium> grandChildOfRoot = LayerChromium::create();
     328    RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
     329    RefPtr<LayerChromiumWithForcedDrawsContent> grandChildOfRS2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
    330330    parent->createRenderSurface();
    331331    parent->addChild(renderSurface1);
     
    455455TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForClipLayer)
    456456{
    457     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    458     RefPtr<LayerChromium> renderSurface1 = LayerChromium::create(0);
    459     RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
     457    RefPtr<LayerChromium> parent = LayerChromium::create();
     458    RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
     459    RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent());
    460460    renderSurface1->setOpacity(0.9);
    461461
     
    484484TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceListForTransparentChild)
    485485{
    486     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    487     RefPtr<LayerChromium> renderSurface1 = LayerChromium::create(0);
    488     RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
     486    RefPtr<LayerChromium> parent = LayerChromium::create();
     487    RefPtr<LayerChromium> renderSurface1 = LayerChromium::create();
     488    RefPtr<LayerChromiumWithForcedDrawsContent> child = adoptRef(new LayerChromiumWithForcedDrawsContent());
    489489    renderSurface1->setOpacity(0);
    490490
     
    527527
    528528    const TransformationMatrix identityMatrix;
    529     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    530     RefPtr<LayerChromium> child = LayerChromium::create(0);
    531     RefPtr<LayerChromium> grandChild = LayerChromium::create(0);
    532     RefPtr<LayerChromium> greatGrandChild = LayerChromium::create(0);
    533     RefPtr<LayerChromiumWithForcedDrawsContent> leafNode1 = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
    534     RefPtr<LayerChromiumWithForcedDrawsContent> leafNode2 = adoptRef(new LayerChromiumWithForcedDrawsContent(0));
     529    RefPtr<LayerChromium> parent = LayerChromium::create();
     530    RefPtr<LayerChromium> child = LayerChromium::create();
     531    RefPtr<LayerChromium> grandChild = LayerChromium::create();
     532    RefPtr<LayerChromium> greatGrandChild = LayerChromium::create();
     533    RefPtr<LayerChromiumWithForcedDrawsContent> leafNode1 = adoptRef(new LayerChromiumWithForcedDrawsContent());
     534    RefPtr<LayerChromiumWithForcedDrawsContent> leafNode2 = adoptRef(new LayerChromiumWithForcedDrawsContent());
    535535    parent->createRenderSurface();
    536536    parent->addChild(child);
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

    r104474 r105460  
    396396    m_client = MockLayerTreeHostClient::create(this);
    397397
    398     RefPtr<LayerChromium> rootLayer = LayerChromium::create(0);
     398    RefPtr<LayerChromium> rootLayer = LayerChromium::create();
    399399    m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings);
    400400    ASSERT_TRUE(m_layerTreeHost);
     
    913913}
    914914
    915 class TestOpacityChangeLayerDelegate : public CCLayerDelegate {
     915class TestOpacityChangeLayerDelegate : public ContentLayerDelegate {
    916916public:
    917917    TestOpacityChangeLayerDelegate(CCLayerTreeHostTest* test)
     
    934934class ContentLayerChromiumWithUpdateTracking : public ContentLayerChromium {
    935935public:
    936     static PassRefPtr<ContentLayerChromiumWithUpdateTracking> create(CCLayerDelegate *delegate) { return adoptRef(new ContentLayerChromiumWithUpdateTracking(delegate)); }
     936    static PassRefPtr<ContentLayerChromiumWithUpdateTracking> create(ContentLayerDelegate *delegate) { return adoptRef(new ContentLayerChromiumWithUpdateTracking(delegate)); }
    937937
    938938    int paintContentsCount() { return m_paintContentsCount; }
     
    962962
    963963private:
    964     explicit ContentLayerChromiumWithUpdateTracking(CCLayerDelegate *delegate)
     964    explicit ContentLayerChromiumWithUpdateTracking(ContentLayerDelegate* delegate)
    965965        : ContentLayerChromium(delegate)
    966966        , m_paintContentsCount(0)
  • trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp

    r104248 r105460  
    136136    void createSimpleTestTree()
    137137    {
    138         m_parent = LayerChromium::create(0);
    139         m_child1 = LayerChromium::create(0);
    140         m_child2 = LayerChromium::create(0);
    141         m_child3 = LayerChromium::create(0);
    142         m_grandChild1 = LayerChromium::create(0);
    143         m_grandChild2 = LayerChromium::create(0);
    144         m_grandChild3 = LayerChromium::create(0);
     138        m_parent = LayerChromium::create();
     139        m_child1 = LayerChromium::create();
     140        m_child2 = LayerChromium::create();
     141        m_child3 = LayerChromium::create();
     142        m_grandChild1 = LayerChromium::create();
     143        m_grandChild2 = LayerChromium::create();
     144        m_grandChild3 = LayerChromium::create();
    145145
    146146        EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber());
     
    165165TEST_F(LayerChromiumTest, basicCreateAndDestroy)
    166166{
    167     RefPtr<LayerChromium> testLayer = LayerChromium::create(0);
     167    RefPtr<LayerChromium> testLayer = LayerChromium::create();
    168168    ASSERT_TRUE(testLayer);
    169169
     
    174174TEST_F(LayerChromiumTest, addAndRemoveChild)
    175175{
    176     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    177     RefPtr<LayerChromium> child = LayerChromium::create(0);
     176    RefPtr<LayerChromium> parent = LayerChromium::create();
     177    RefPtr<LayerChromium> child = LayerChromium::create();
    178178
    179179    // Upon creation, layers should not have children or parent.
     
    195195TEST_F(LayerChromiumTest, insertChild)
    196196{
    197     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    198     RefPtr<LayerChromium> child1 = LayerChromium::create(0);
    199     RefPtr<LayerChromium> child2 = LayerChromium::create(0);
    200     RefPtr<LayerChromium> child3 = LayerChromium::create(0);
    201     RefPtr<LayerChromium> child4 = LayerChromium::create(0);
     197    RefPtr<LayerChromium> parent = LayerChromium::create();
     198    RefPtr<LayerChromium> child1 = LayerChromium::create();
     199    RefPtr<LayerChromium> child2 = LayerChromium::create();
     200    RefPtr<LayerChromium> child3 = LayerChromium::create();
     201    RefPtr<LayerChromium> child4 = LayerChromium::create();
    202202
    203203    parent->setLayerTreeHost(m_layerTreeHost.get());
     
    241241TEST_F(LayerChromiumTest, insertChildPastEndOfList)
    242242{
    243     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    244     RefPtr<LayerChromium> child1 = LayerChromium::create(0);
    245     RefPtr<LayerChromium> child2 = LayerChromium::create(0);
     243    RefPtr<LayerChromium> parent = LayerChromium::create();
     244    RefPtr<LayerChromium> child1 = LayerChromium::create();
     245    RefPtr<LayerChromium> child2 = LayerChromium::create();
    246246
    247247    ASSERT_EQ(static_cast<size_t>(0), parent->children().size());
     
    263263TEST_F(LayerChromiumTest, insertSameChildTwice)
    264264{
    265     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    266     RefPtr<LayerChromium> child1 = LayerChromium::create(0);
    267     RefPtr<LayerChromium> child2 = LayerChromium::create(0);
     265    RefPtr<LayerChromium> parent = LayerChromium::create();
     266    RefPtr<LayerChromium> child1 = LayerChromium::create();
     267    RefPtr<LayerChromium> child2 = LayerChromium::create();
    268268
    269269    parent->setLayerTreeHost(m_layerTreeHost.get());
     
    292292{
    293293    createSimpleTestTree();
    294     RefPtr<LayerChromium> child4 = LayerChromium::create(0);
     294    RefPtr<LayerChromium> child4 = LayerChromium::create();
    295295
    296296    EXPECT_FALSE(child4->parent());
     
    312312
    313313    // create another simple tree with testLayer and child4.
    314     RefPtr<LayerChromium> testLayer = LayerChromium::create(0);
    315     RefPtr<LayerChromium> child4 = LayerChromium::create(0);
     314    RefPtr<LayerChromium> testLayer = LayerChromium::create();
     315    RefPtr<LayerChromium> child4 = LayerChromium::create();
    316316    testLayer->addChild(child4);
    317317    ASSERT_EQ(static_cast<size_t>(1), testLayer->children().size());
     
    357357TEST_F(LayerChromiumTest, setChildren)
    358358{
    359     RefPtr<LayerChromium> oldParent = LayerChromium::create(0);
    360     RefPtr<LayerChromium> newParent = LayerChromium::create(0);
    361 
    362     RefPtr<LayerChromium> child1 = LayerChromium::create(0);
    363     RefPtr<LayerChromium> child2 = LayerChromium::create(0);
     359    RefPtr<LayerChromium> oldParent = LayerChromium::create();
     360    RefPtr<LayerChromium> newParent = LayerChromium::create();
     361
     362    RefPtr<LayerChromium> child1 = LayerChromium::create();
     363    RefPtr<LayerChromium> child2 = LayerChromium::create();
    364364
    365365    Vector<RefPtr<LayerChromium> > newChildren;
     
    391391    EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AtLeast(1));
    392392
    393     RefPtr<LayerChromium> child4 = LayerChromium::create(0);
     393    RefPtr<LayerChromium> child4 = LayerChromium::create();
    394394
    395395    EXPECT_EQ(m_parent.get(), m_parent->rootLayer());
     
    444444    //   2. indirectly calls setNeedsCommit, exactly once for each call to setNeedsDisplay.
    445445
    446     RefPtr<LayerChromium> testLayer = LayerChromium::create(0);
     446    RefPtr<LayerChromium> testLayer = LayerChromium::create();
    447447    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    448448
     
    459459    // This is just initialization, but setNeedsCommit behavior is verified anyway to avoid warnings.
    460460    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(testBounds));
    461     testLayer = LayerChromium::create(0);
     461    testLayer = LayerChromium::create();
    462462    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    463463    EXPECT_FALSE(testLayer->needsDisplay());
     
    478478
    479479    // Case 4: LayerChromium should accept dirty rects that go beyond its bounds.
    480     testLayer = LayerChromium::create(0);
     480    testLayer = LayerChromium::create();
    481481    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    482482    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(testBounds));
     
    485485
    486486    // Case 5: setNeedsDisplay() without the dirty rect arg.
    487     testLayer = LayerChromium::create(0);
     487    testLayer = LayerChromium::create();
    488488    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    489489    EXECUTE_AND_VERIFY_SET_NEEDS_COMMIT_BEHAVIOR(1, testLayer->setBounds(testBounds));
     
    492492}
    493493
    494 TEST_F(LayerChromiumTest, checkSetNeedsDisplayWithNullDelegate)
    495 {
    496     RefPtr<LayerChromium> testLayer = LayerChromium::create(0);
    497     IntSize testBounds = IntSize(501, 508);
    498 
    499     FloatRect dirty = FloatRect(10.0f, 15.0f, 1.0f, 2.0f);
    500 
    501     testLayer->setBounds(testBounds);
    502     EXPECT_TRUE(testLayer->needsDisplay());
    503 
    504     testLayer = LayerChromium::create(0);
    505     EXPECT_FALSE(testLayer->needsDisplay());
    506 
    507     testLayer->setNeedsDisplayRect(dirty);
    508     EXPECT_TRUE(testLayer->needsDisplay());
    509 }
    510 
    511494TEST_F(LayerChromiumTest, checkPropertyChangeCausesCorrectBehavior)
    512495{
    513     RefPtr<LayerChromium> testLayer = LayerChromium::create(0);
     496    RefPtr<LayerChromium> testLayer = LayerChromium::create();
    514497    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    515498
    516     RefPtr<LayerChromium> dummyLayer = LayerChromium::create(0); // just a dummy layer for this test case.
     499    RefPtr<LayerChromium> dummyLayer = LayerChromium::create(); // just a dummy layer for this test case.
    517500
    518501    // sanity check of initial test condition
     
    559542class LayerChromiumWithContentScaling : public LayerChromium {
    560543public:
    561     explicit LayerChromiumWithContentScaling(CCLayerDelegate* delegate)
    562         : LayerChromium(delegate)
     544    explicit LayerChromiumWithContentScaling()
     545        : LayerChromium()
    563546    {
    564547    }
     
    577560TEST_F(LayerChromiumTest, checkContentsScaleChangeTriggersNeedsDisplay)
    578561{
    579     RefPtr<LayerChromiumWithContentScaling> testLayer = adoptRef(new LayerChromiumWithContentScaling(0));
     562    RefPtr<LayerChromiumWithContentScaling> testLayer = adoptRef(new LayerChromiumWithContentScaling());
    580563    testLayer->setLayerTreeHost(m_layerTreeHost.get());
    581564
     
    627610{
    628611    WebKit::WebCompositor::initialize(0);
    629     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    630     RefPtr<LayerChromium> child = LayerChromium::create(0);
    631     RefPtr<LayerChromium> mask = LayerChromium::create(0);
    632     RefPtr<LayerChromium> replica = LayerChromium::create(0);
    633     RefPtr<LayerChromium> replicaMask = LayerChromium::create(0);
     612    RefPtr<LayerChromium> parent = LayerChromium::create();
     613    RefPtr<LayerChromium> child = LayerChromium::create();
     614    RefPtr<LayerChromium> mask = LayerChromium::create();
     615    RefPtr<LayerChromium> replica = LayerChromium::create();
     616    RefPtr<LayerChromium> replicaMask = LayerChromium::create();
    634617
    635618    // Set up a detached tree of layers. The host pointer should be nil for these layers.
     
    659642{
    660643    WebKit::WebCompositor::initialize(0);
    661     RefPtr<LayerChromium> parent = LayerChromium::create(0);
     644    RefPtr<LayerChromium> parent = LayerChromium::create();
    662645    RefPtr<FakeCCLayerTreeHost> layerTreeHost = FakeCCLayerTreeHost::create();
    663646
     
    667650
    668651    // Adding a subtree to a layer already associated with a host should set the host pointer on all layers in that subtree.
    669     RefPtr<LayerChromium> child = LayerChromium::create(0);
    670     RefPtr<LayerChromium> grandChild = LayerChromium::create(0);
     652    RefPtr<LayerChromium> child = LayerChromium::create();
     653    RefPtr<LayerChromium> grandChild = LayerChromium::create();
    671654    child->addChild(grandChild);
    672655
    673656    // Masks, replicas, and replica masks should pick up the new host too.
    674     RefPtr<LayerChromium> childMask = LayerChromium::create(0);
     657    RefPtr<LayerChromium> childMask = LayerChromium::create();
    675658    child->setMaskLayer(childMask.get());
    676     RefPtr<LayerChromium> childReplica = LayerChromium::create(0);
     659    RefPtr<LayerChromium> childReplica = LayerChromium::create();
    677660    child->setReplicaLayer(childReplica.get());
    678     RefPtr<LayerChromium> childReplicaMask = LayerChromium::create(0);
     661    RefPtr<LayerChromium> childReplicaMask = LayerChromium::create();
    679662    childReplica->setMaskLayer(childReplicaMask.get());
    680663
     
    690673{
    691674    WebKit::WebCompositor::initialize(0);
    692     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    693     RefPtr<LayerChromium> child = LayerChromium::create(0);
    694     RefPtr<LayerChromium> mask = LayerChromium::create(0);
    695     RefPtr<LayerChromium> replica = LayerChromium::create(0);
    696     RefPtr<LayerChromium> replicaMask = LayerChromium::create(0);
     675    RefPtr<LayerChromium> parent = LayerChromium::create();
     676    RefPtr<LayerChromium> child = LayerChromium::create();
     677    RefPtr<LayerChromium> mask = LayerChromium::create();
     678    RefPtr<LayerChromium> replica = LayerChromium::create();
     679    RefPtr<LayerChromium> replicaMask = LayerChromium::create();
    697680
    698681    // Same setup as the previous test.
     
    723706{
    724707    WebKit::WebCompositor::initialize(0);
    725     RefPtr<LayerChromium> firstParent = LayerChromium::create(0);
    726     RefPtr<LayerChromium> firstChild = LayerChromium::create(0);
    727     RefPtr<LayerChromium> secondParent = LayerChromium::create(0);
    728     RefPtr<LayerChromium> secondChild = LayerChromium::create(0);
    729     RefPtr<LayerChromium> secondGrandChild = LayerChromium::create(0);
     708    RefPtr<LayerChromium> firstParent = LayerChromium::create();
     709    RefPtr<LayerChromium> firstChild = LayerChromium::create();
     710    RefPtr<LayerChromium> secondParent = LayerChromium::create();
     711    RefPtr<LayerChromium> secondChild = LayerChromium::create();
     712    RefPtr<LayerChromium> secondGrandChild = LayerChromium::create();
    730713
    731714    // First put all children under the first parent and set the first host.
     
    760743{
    761744    WebKit::WebCompositor::initialize(0);
    762     RefPtr<LayerChromium> parent = LayerChromium::create(0);
    763     RefPtr<LayerChromium> mask = LayerChromium::create(0);
    764     RefPtr<LayerChromium> replica = LayerChromium::create(0);
    765     RefPtr<LayerChromium> maskChild = LayerChromium::create(0);
    766     RefPtr<LayerChromium> replicaChild = LayerChromium::create(0);
    767     RefPtr<LayerChromium> maskReplacement = LayerChromium::create(0);
    768     RefPtr<LayerChromium> replicaReplacement = LayerChromium::create(0);
     745    RefPtr<LayerChromium> parent = LayerChromium::create();
     746    RefPtr<LayerChromium> mask = LayerChromium::create();
     747    RefPtr<LayerChromium> replica = LayerChromium::create();
     748    RefPtr<LayerChromium> maskChild = LayerChromium::create();
     749    RefPtr<LayerChromium> replicaChild = LayerChromium::create();
     750    RefPtr<LayerChromium> maskReplacement = LayerChromium::create();
     751    RefPtr<LayerChromium> replicaReplacement = LayerChromium::create();
    769752
    770753    parent->setMaskLayer(mask.get());
  • trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

    r105314 r105460  
    9797public:
    9898    explicit FakeTiledLayerChromium(TextureManager* textureManager)
    99         : TiledLayerChromium(0)
     99        : TiledLayerChromium()
    100100        , m_fakeTextureUpdater(adoptRef(new FakeLayerTextureUpdater))
    101101        , m_textureManager(textureManager)
  • trunk/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp

    r96454 r105460  
    8484private:
    8585    MockLayerChromium(Vector<int>* ccLayerDestructionList)
    86         : LayerChromium(0)
     86        : LayerChromium()
    8787        , m_ccLayerDestructionList(ccLayerDestructionList)
    8888    {
     
    120120{
    121121    DebugScopedSetImplThread impl;
    122     RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create(0);
    123     layerTreeRoot->addChild(LayerChromium::create(0));
    124     layerTreeRoot->addChild(LayerChromium::create(0));
     122    RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
     123    layerTreeRoot->addChild(LayerChromium::create());
     124    layerTreeRoot->addChild(LayerChromium::create());
    125125
    126126    RefPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), 0);
     
    159159{
    160160    DebugScopedSetImplThread impl;
    161     RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create(0);
    162     layerTreeRoot->addChild(LayerChromium::create(0));
    163     layerTreeRoot->addChild(LayerChromium::create(0));
     161    RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
     162    layerTreeRoot->addChild(LayerChromium::create());
     163    layerTreeRoot->addChild(LayerChromium::create());
    164164
    165165    // Pick some random properties to set. The values are not important, we're just testing that at least some properties are making it through.
     
    255255
    256256    // Synchronize again. After the sync all CCLayerImpls from the old tree should be deleted.
    257     RefPtr<LayerChromium> newLayerTreeRoot = LayerChromium::create(0);
     257    RefPtr<LayerChromium> newLayerTreeRoot = LayerChromium::create();
    258258    ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(newLayerTreeRoot.get(), ccLayerTreeRoot.release());
    259259    expectTreesAreIdentical(newLayerTreeRoot.get(), ccLayerTreeRoot.get());
     
    269269{
    270270    DebugScopedSetImplThread impl;
    271     RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create(0);
    272     layerTreeRoot->addChild(LayerChromium::create(0));
    273     layerTreeRoot->addChild(LayerChromium::create(0));
    274     layerTreeRoot->addChild(LayerChromium::create(0));
     271    RefPtr<LayerChromium> layerTreeRoot = LayerChromium::create();
     272    layerTreeRoot->addChild(LayerChromium::create());
     273    layerTreeRoot->addChild(LayerChromium::create());
     274    layerTreeRoot->addChild(LayerChromium::create());
    275275
    276276    // First child gets a mask layer.
    277     RefPtr<LayerChromium> maskLayer = LayerChromium::create(0);
     277    RefPtr<LayerChromium> maskLayer = LayerChromium::create();
    278278    layerTreeRoot->children()[0]->setMaskLayer(maskLayer.get());
    279279
    280280    // Second child gets a replica layer.
    281     RefPtr<LayerChromium> replicaLayer = LayerChromium::create(0);
     281    RefPtr<LayerChromium> replicaLayer = LayerChromium::create();
    282282    layerTreeRoot->children()[1]->setReplicaLayer(replicaLayer.get());
    283283
    284284    // Third child gets a replica layer with a mask layer.
    285     RefPtr<LayerChromium> replicaLayerWithMask = LayerChromium::create(0);
    286     RefPtr<LayerChromium> replicaMaskLayer = LayerChromium::create(0);
     285    RefPtr<LayerChromium> replicaLayerWithMask = LayerChromium::create();
     286    RefPtr<LayerChromium> replicaMaskLayer = LayerChromium::create();
    287287    replicaLayerWithMask->setMaskLayer(replicaMaskLayer.get());
    288288    layerTreeRoot->children()[2]->setReplicaLayer(replicaLayerWithMask.get());
Note: See TracChangeset for help on using the changeset viewer.