Skip to content

Commit

Permalink
cc: Remove wtf includes for scrollbar layer classes
Browse files Browse the repository at this point in the history
R=jamesr@chromium.org
BUG=154451


Review URL: https://chromiumcodereview.appspot.com/11144034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162244 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
enne@chromium.org committed Oct 16, 2012
1 parent 1cec652 commit 3116158
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 37 deletions.
10 changes: 5 additions & 5 deletions cc/scrollbar_geometry_fixed_thumb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ using WebKit::WebScrollbarThemeGeometry;

namespace cc {

PassOwnPtr<CCScrollbarGeometryFixedThumb> CCScrollbarGeometryFixedThumb::create(PassOwnPtr<WebScrollbarThemeGeometry> geometry)
scoped_ptr<CCScrollbarGeometryFixedThumb> CCScrollbarGeometryFixedThumb::create(scoped_ptr<WebScrollbarThemeGeometry> geometry)
{
return adoptPtr(new CCScrollbarGeometryFixedThumb(geometry));
return make_scoped_ptr(new CCScrollbarGeometryFixedThumb(geometry.Pass()));
}

CCScrollbarGeometryFixedThumb::~CCScrollbarGeometryFixedThumb()
Expand All @@ -37,7 +37,7 @@ void CCScrollbarGeometryFixedThumb::update(WebScrollbar* scrollbar)

WebScrollbarThemeGeometry* CCScrollbarGeometryFixedThumb::clone() const
{
CCScrollbarGeometryFixedThumb* geometry = new CCScrollbarGeometryFixedThumb(adoptPtr(CCScrollbarGeometryStub::clone()));
CCScrollbarGeometryFixedThumb* geometry = new CCScrollbarGeometryFixedThumb(make_scoped_ptr(CCScrollbarGeometryStub::clone()));
geometry->m_thumbSize = m_thumbSize;
return geometry;
}
Expand Down Expand Up @@ -86,8 +86,8 @@ void CCScrollbarGeometryFixedThumb::splitTrack(WebScrollbar* scrollbar, const We
}
}

CCScrollbarGeometryFixedThumb::CCScrollbarGeometryFixedThumb(PassOwnPtr<WebScrollbarThemeGeometry> geometry)
: CCScrollbarGeometryStub(geometry)
CCScrollbarGeometryFixedThumb::CCScrollbarGeometryFixedThumb(scoped_ptr<WebScrollbarThemeGeometry> geometry)
: CCScrollbarGeometryStub(geometry.Pass())
{
}

Expand Down
4 changes: 2 additions & 2 deletions cc/scrollbar_geometry_fixed_thumb.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cc {
// requiring the thumb resource to be repainted.
class CCScrollbarGeometryFixedThumb : public CCScrollbarGeometryStub {
public:
static PassOwnPtr<CCScrollbarGeometryFixedThumb> create(PassOwnPtr<WebKit::WebScrollbarThemeGeometry>);
static scoped_ptr<CCScrollbarGeometryFixedThumb> create(scoped_ptr<WebKit::WebScrollbarThemeGeometry>);
virtual ~CCScrollbarGeometryFixedThumb();

// Update thumb length from scrollbar
Expand All @@ -29,7 +29,7 @@ class CCScrollbarGeometryFixedThumb : public CCScrollbarGeometryStub {
virtual void splitTrack(WebKit::WebScrollbar*, const WebKit::WebRect& track, WebKit::WebRect& startTrack, WebKit::WebRect& thumb, WebKit::WebRect& endTrack) OVERRIDE;

private:
explicit CCScrollbarGeometryFixedThumb(PassOwnPtr<WebKit::WebScrollbarThemeGeometry>);
explicit CCScrollbarGeometryFixedThumb(scoped_ptr<WebKit::WebScrollbarThemeGeometry>);

IntSize m_thumbSize;
};
Expand Down
4 changes: 2 additions & 2 deletions cc/scrollbar_geometry_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ using WebKit::WebScrollbarThemeGeometry;

namespace cc {

CCScrollbarGeometryStub::CCScrollbarGeometryStub(PassOwnPtr<WebScrollbarThemeGeometry> geometry)
: m_geometry(geometry)
CCScrollbarGeometryStub::CCScrollbarGeometryStub(scoped_ptr<WebScrollbarThemeGeometry> geometry)
: m_geometry(geometry.Pass())
{
}

Expand Down
7 changes: 3 additions & 4 deletions cc/scrollbar_geometry_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
#ifndef CCScrollbarGeometryStub_h
#define CCScrollbarGeometryStub_h

#include "base/memory/scoped_ptr.h"
#include <public/WebScrollbarThemeGeometry.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>

namespace cc {

Expand Down Expand Up @@ -41,10 +40,10 @@ class CCScrollbarGeometryStub : public WebKit::WebScrollbarThemeGeometry {
virtual void splitTrack(WebKit::WebScrollbar*, const WebKit::WebRect& track, WebKit::WebRect& startTrack, WebKit::WebRect& thumb, WebKit::WebRect& endTrack) OVERRIDE;

protected:
explicit CCScrollbarGeometryStub(PassOwnPtr<WebKit::WebScrollbarThemeGeometry>);
explicit CCScrollbarGeometryStub(scoped_ptr<WebKit::WebScrollbarThemeGeometry>);

private:
OwnPtr<WebKit::WebScrollbarThemeGeometry> m_geometry;
scoped_ptr<WebKit::WebScrollbarThemeGeometry> m_geometry;
};

}
Expand Down
12 changes: 6 additions & 6 deletions cc/scrollbar_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ scoped_ptr<CCLayerImpl> ScrollbarLayerChromium::createCCLayerImpl()
return CCScrollbarLayerImpl::create(id()).PassAs<CCLayerImpl>();
}

scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(PassOwnPtr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId)
scoped_refptr<ScrollbarLayerChromium> ScrollbarLayerChromium::create(scoped_ptr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, scoped_ptr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId)
{
return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar, painter, geometry, scrollLayerId));
return make_scoped_refptr(new ScrollbarLayerChromium(scrollbar.Pass(), painter, geometry.Pass(), scrollLayerId));
}

ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId)
: m_scrollbar(scrollbar)
ScrollbarLayerChromium::ScrollbarLayerChromium(scoped_ptr<WebKit::WebScrollbar> scrollbar, WebKit::WebScrollbarThemePainter painter, scoped_ptr<WebKit::WebScrollbarThemeGeometry> geometry, int scrollLayerId)
: m_scrollbar(scrollbar.Pass())
, m_painter(painter)
, m_geometry(geometry)
, m_geometry(geometry.Pass())
, m_scrollLayerId(scrollLayerId)
, m_textureFormat(GraphicsContext3D::INVALID_ENUM)
{
Expand All @@ -48,7 +48,7 @@ void ScrollbarLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
CCScrollbarLayerImpl* scrollbarLayer = static_cast<CCScrollbarLayerImpl*>(layer);

if (!scrollbarLayer->scrollbarGeometry())
scrollbarLayer->setScrollbarGeometry(CCScrollbarGeometryFixedThumb::create(adoptPtr(m_geometry->clone())));
scrollbarLayer->setScrollbarGeometry(CCScrollbarGeometryFixedThumb::create(make_scoped_ptr(m_geometry->clone())));

scrollbarLayer->setScrollbarData(m_scrollbar.get());

Expand Down
8 changes: 4 additions & 4 deletions cc/scrollbar_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ScrollbarLayerChromium : public LayerChromium {
public:
virtual scoped_ptr<CCLayerImpl> createCCLayerImpl() OVERRIDE;

static scoped_refptr<ScrollbarLayerChromium> create(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId);
static scoped_refptr<ScrollbarLayerChromium> create(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId);

// LayerChromium interface
virtual bool needsContentsScale() const OVERRIDE;
Expand All @@ -38,16 +38,16 @@ class ScrollbarLayerChromium : public LayerChromium {
virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE;

protected:
ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId);
ScrollbarLayerChromium(scoped_ptr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, scoped_ptr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId);
virtual ~ScrollbarLayerChromium();

private:
void updatePart(CachingBitmapCanvasLayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdateQueue&, CCRenderingStats&);
void createTextureUpdaterIfNeeded();

OwnPtr<WebKit::WebScrollbar> m_scrollbar;
scoped_ptr<WebKit::WebScrollbar> m_scrollbar;
WebKit::WebScrollbarThemePainter m_painter;
OwnPtr<WebKit::WebScrollbarThemeGeometry> m_geometry;
scoped_ptr<WebKit::WebScrollbarThemeGeometry> m_geometry;
int m_scrollLayerId;

GC3Denum m_textureFormat;
Expand Down
4 changes: 2 additions & 2 deletions cc/scrollbar_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ CCScrollbarLayerImpl::~CCScrollbarLayerImpl()
{
}

void CCScrollbarLayerImpl::setScrollbarGeometry(PassOwnPtr<CCScrollbarGeometryFixedThumb> geometry)
void CCScrollbarLayerImpl::setScrollbarGeometry(scoped_ptr<CCScrollbarGeometryFixedThumb> geometry)
{
m_geometry = geometry;
m_geometry = geometry.Pass();
}

void CCScrollbarLayerImpl::setScrollbarData(WebScrollbar* scrollbar)
Expand Down
4 changes: 2 additions & 2 deletions cc/scrollbar_layer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CCScrollbarLayerImpl : public CCLayerImpl {
virtual ~CCScrollbarLayerImpl();

CCScrollbarGeometryFixedThumb* scrollbarGeometry() const { return m_geometry.get(); }
void setScrollbarGeometry(PassOwnPtr<CCScrollbarGeometryFixedThumb>);
void setScrollbarGeometry(scoped_ptr<CCScrollbarGeometryFixedThumb>);
void setScrollbarData(WebKit::WebScrollbar*);

void setBackTrackResourceId(CCResourceProvider::ResourceId id) { m_backTrackResourceId = id; }
Expand Down Expand Up @@ -83,7 +83,7 @@ class CCScrollbarLayerImpl : public CCLayerImpl {
CCResourceProvider::ResourceId m_foreTrackResourceId;
CCResourceProvider::ResourceId m_thumbResourceId;

OwnPtr<CCScrollbarGeometryFixedThumb> m_geometry;
scoped_ptr<CCScrollbarGeometryFixedThumb> m_geometry;

// Data to implement CCScrollbar
WebKit::WebScrollbar::ScrollbarOverlayStyle m_scrollbarOverlayStyle;
Expand Down
14 changes: 7 additions & 7 deletions cc/scrollbar_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace {

class FakeWebScrollbar : public WebKit::WebScrollbar {
public:
static PassOwnPtr<FakeWebScrollbar> create() { return adoptPtr(new FakeWebScrollbar()); }
static scoped_ptr<FakeWebScrollbar> create() { return make_scoped_ptr(new FakeWebScrollbar()); }

// WebScrollbar implementation
virtual bool isOverlay() const OVERRIDE { return false; }
Expand Down Expand Up @@ -50,10 +50,10 @@ TEST(ScrollbarLayerChromiumTest, resolveScrollLayerPointer)
WebKit::WebScrollbarThemePainter painter;

{
OwnPtr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_refptr<LayerChromium> layerTreeRoot = LayerChromium::create();
scoped_refptr<LayerChromium> child1 = LayerChromium::create();
scoped_refptr<LayerChromium> child2 = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child1->id());
scoped_refptr<LayerChromium> child2 = ScrollbarLayerChromium::create(scrollbar.Pass(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child1->id());
layerTreeRoot->addChild(child1);
layerTreeRoot->addChild(child2);

Expand All @@ -67,10 +67,10 @@ TEST(ScrollbarLayerChromiumTest, resolveScrollLayerPointer)
}

{ // another traverse order
OwnPtr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_refptr<LayerChromium> layerTreeRoot = LayerChromium::create();
scoped_refptr<LayerChromium> child2 = LayerChromium::create();
scoped_refptr<LayerChromium> child1 = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child2->id());
scoped_refptr<LayerChromium> child1 = ScrollbarLayerChromium::create(scrollbar.Pass(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), child2->id());
layerTreeRoot->addChild(child1);
layerTreeRoot->addChild(child2);

Expand All @@ -90,10 +90,10 @@ TEST(ScrollbarLayerChromiumTest, scrollOffsetSynchronization)

WebKit::WebScrollbarThemePainter painter;

OwnPtr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create());
scoped_refptr<LayerChromium> layerTreeRoot = LayerChromium::create();
scoped_refptr<LayerChromium> contentLayer = LayerChromium::create();
scoped_refptr<LayerChromium> scrollbarLayer = ScrollbarLayerChromium::create(scrollbar.release(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), layerTreeRoot->id());
scoped_refptr<LayerChromium> scrollbarLayer = ScrollbarLayerChromium::create(scrollbar.Pass(), painter, WebKit::FakeWebScrollbarThemeGeometry::create(), layerTreeRoot->id());
layerTreeRoot->addChild(contentLayer);
layerTreeRoot->addChild(scrollbarLayer);

Expand Down
3 changes: 1 addition & 2 deletions cc/test/fake_web_scrollbar_theme_geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
#define FakeWebScrollbarThemeGeometry_h

#include <public/WebScrollbarThemeGeometry.h>
#include <wtf/PassOwnPtr.h>

namespace WebKit {

class FakeWebScrollbarThemeGeometry : public WebKit::WebScrollbarThemeGeometry {
public:
static PassOwnPtr<WebKit::WebScrollbarThemeGeometry> create() { return adoptPtr(new WebKit::FakeWebScrollbarThemeGeometry()); }
static scoped_ptr<WebKit::WebScrollbarThemeGeometry> create() { return scoped_ptr<WebKit::WebScrollbarThemeGeometry>(new WebKit::FakeWebScrollbarThemeGeometry()); }

virtual WebKit::WebScrollbarThemeGeometry* clone() const OVERRIDE
{
Expand Down
2 changes: 1 addition & 1 deletion webkit/compositor_bindings/WebScrollbarLayerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WebScrollbarLayer* WebScrollbarLayer::create(WebScrollbar* scrollbar, WebScrollb


WebScrollbarLayerImpl::WebScrollbarLayerImpl(WebScrollbar* scrollbar, WebScrollbarThemePainter painter, WebScrollbarThemeGeometry* geometry)
: m_layer(new WebLayerImpl(ScrollbarLayerChromium::create(adoptPtr(scrollbar), painter, adoptPtr(geometry), 0)))
: m_layer(new WebLayerImpl(ScrollbarLayerChromium::create(make_scoped_ptr(scrollbar), painter, make_scoped_ptr(geometry), 0)))
{
}

Expand Down

0 comments on commit 3116158

Please sign in to comment.