diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 16:47:06 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 16:47:06 +0000 |
commit | 7648159bf98111b96ed13092d2af4f7670add8cc (patch) | |
tree | 5f62bff840291742384e0774fc319a4febc2b964 | |
parent | a26f9df3033d6874f57910bb07a83be92821e3ad (diff) | |
download | chromium_src-7648159bf98111b96ed13092d2af4f7670add8cc.zip chromium_src-7648159bf98111b96ed13092d2af4f7670add8cc.tar.gz chromium_src-7648159bf98111b96ed13092d2af4f7670add8cc.tar.bz2 |
Fix remaining cc files to compile with Clang
BUG=none
Review URL: https://codereview.chromium.org/10947047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158005 0039d316-1c4b-4281-b951-d872f2087c98
44 files changed, 462 insertions, 101 deletions
diff --git a/cc/CCAnimationCurve.cpp b/cc/CCAnimationCurve.cpp index ae5ccdf..7cd0158 100644 --- a/cc/CCAnimationCurve.cpp +++ b/cc/CCAnimationCurve.cpp @@ -14,10 +14,20 @@ const CCFloatAnimationCurve* CCAnimationCurve::toFloatAnimationCurve() const return static_cast<const CCFloatAnimationCurve*>(this); } +CCAnimationCurve::Type CCFloatAnimationCurve::type() const +{ + return Float; +} + const CCTransformAnimationCurve* CCAnimationCurve::toTransformAnimationCurve() const { ASSERT(type() == CCAnimationCurve::Transform); return static_cast<const CCTransformAnimationCurve*>(this); } +CCAnimationCurve::Type CCTransformAnimationCurve::type() const +{ + return Transform; +} + } // namespace cc diff --git a/cc/CCAnimationCurve.h b/cc/CCAnimationCurve.h index 46808f6..c177d23 100644 --- a/cc/CCAnimationCurve.h +++ b/cc/CCAnimationCurve.h @@ -38,7 +38,7 @@ public: virtual float getValue(double t) const = 0; // Partial CCAnimation implementation. - virtual Type type() const OVERRIDE { return Float; } + virtual Type type() const OVERRIDE; }; class CCTransformAnimationCurve : public CCAnimationCurve { @@ -48,7 +48,7 @@ public: virtual WebKit::WebTransformationMatrix getValue(double t) const = 0; // Partial CCAnimation implementation. - virtual Type type() const OVERRIDE { return Transform; } + virtual Type type() const OVERRIDE; }; } // namespace cc diff --git a/cc/CCDebugRectHistory.cpp b/cc/CCDebugRectHistory.cpp index 51fbef6..1043ced 100644 --- a/cc/CCDebugRectHistory.cpp +++ b/cc/CCDebugRectHistory.cpp @@ -18,6 +18,10 @@ CCDebugRectHistory::CCDebugRectHistory() { } +CCDebugRectHistory::~CCDebugRectHistory() +{ +} + void CCDebugRectHistory::saveDebugRectsForCurrentFrame(CCLayerImpl* rootLayer, const Vector<CCLayerImpl*>& renderSurfaceLayerList, const Vector<IntRect>& occludingScreenSpaceRects, const CCLayerTreeSettings& settings) { // For now, clear all rects from previous frames. In the future we may want to store diff --git a/cc/CCDebugRectHistory.h b/cc/CCDebugRectHistory.h index 3ae8fe9..6046fb3 100644 --- a/cc/CCDebugRectHistory.h +++ b/cc/CCDebugRectHistory.h @@ -59,6 +59,8 @@ public: return adoptPtr(new CCDebugRectHistory()); } + ~CCDebugRectHistory(); + // Note: Saving debug rects must happen before layers' change tracking is reset. void saveDebugRectsForCurrentFrame(CCLayerImpl* rootLayer, const Vector<CCLayerImpl*>& renderSurfaceLayerList, const Vector<IntRect>& occludingScreenSpaceRects, const CCLayerTreeSettings&); diff --git a/cc/CCDelayBasedTimeSource.cpp b/cc/CCDelayBasedTimeSource.cpp index 8b9d0f6..a441085 100644 --- a/cc/CCDelayBasedTimeSource.cpp +++ b/cc/CCDelayBasedTimeSource.cpp @@ -45,6 +45,10 @@ CCDelayBasedTimeSource::CCDelayBasedTimeSource(base::TimeDelta interval, CCThrea turnOffVerifier(); } +CCDelayBasedTimeSource::~CCDelayBasedTimeSource() +{ +} + void CCDelayBasedTimeSource::setActive(bool active) { TRACE_EVENT1("cc", "CCDelayBasedTimeSource::setActive", "active", active); @@ -71,6 +75,11 @@ void CCDelayBasedTimeSource::setActive(bool active) postNextTickTask(now()); } +bool CCDelayBasedTimeSource::active() const +{ + return m_state != STATE_INACTIVE; +} + base::TimeTicks CCDelayBasedTimeSource::lastTickTime() { return m_lastTickTime; @@ -100,6 +109,11 @@ void CCDelayBasedTimeSource::onTimerFired() m_client->onTimerTick(); } +void CCDelayBasedTimeSource::setClient(CCTimeSourceClient* client) +{ + m_client = client; +} + void CCDelayBasedTimeSource::setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) { m_nextParameters.interval = interval; diff --git a/cc/CCDelayBasedTimeSource.h b/cc/CCDelayBasedTimeSource.h index 51fd074..d3bbab1 100644 --- a/cc/CCDelayBasedTimeSource.h +++ b/cc/CCDelayBasedTimeSource.h @@ -19,15 +19,15 @@ class CCDelayBasedTimeSource : public CCTimeSource, CCTimerClient { public: static PassRefPtr<CCDelayBasedTimeSource> create(base::TimeDelta interval, CCThread*); - virtual ~CCDelayBasedTimeSource() { } + virtual ~CCDelayBasedTimeSource(); - virtual void setClient(CCTimeSourceClient* client) OVERRIDE { m_client = client; } + virtual void setClient(CCTimeSourceClient* client) OVERRIDE; // CCTimeSource implementation virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE; virtual void setActive(bool) OVERRIDE; - virtual bool active() const OVERRIDE { return m_state != STATE_INACTIVE; } + virtual bool active() const OVERRIDE; // Get the last and next tick times. virtual base::TimeTicks lastTickTime() OVERRIDE; diff --git a/cc/CCDelegatedRendererLayerImpl.cpp b/cc/CCDelegatedRendererLayerImpl.cpp index fafd3a8..d6574ec 100644 --- a/cc/CCDelegatedRendererLayerImpl.cpp +++ b/cc/CCDelegatedRendererLayerImpl.cpp @@ -174,4 +174,9 @@ void CCDelegatedRendererLayerImpl::appendRenderPassQuads(CCQuadSink& quadSink, C } } +const char* CCDelegatedRendererLayerImpl::layerTypeAsString() const +{ + return "DelegatedRendererLayer"; +} + } diff --git a/cc/CCDelegatedRendererLayerImpl.h b/cc/CCDelegatedRendererLayerImpl.h index 0e83342..9e197c8 100644 --- a/cc/CCDelegatedRendererLayerImpl.h +++ b/cc/CCDelegatedRendererLayerImpl.h @@ -38,7 +38,7 @@ private: PassOwnPtr<CCDrawQuad> createCopyOfQuad(const CCDrawQuad*); - virtual const char* layerTypeAsString() const OVERRIDE { return "DelegatedRendererLayer"; } + virtual const char* layerTypeAsString() const OVERRIDE; OwnPtrVector<CCRenderPass> m_renderPassesInDrawOrder; HashMap<CCRenderPass::Id, int> m_renderPassesIndexById; diff --git a/cc/CCHeadsUpDisplayLayerImpl.cpp b/cc/CCHeadsUpDisplayLayerImpl.cpp index 924219d..d668672 100644 --- a/cc/CCHeadsUpDisplayLayerImpl.cpp +++ b/cc/CCHeadsUpDisplayLayerImpl.cpp @@ -126,6 +126,11 @@ void CCHeadsUpDisplayLayerImpl::didLoseContext() m_hudTexture.clear(); } +bool CCHeadsUpDisplayLayerImpl::layerIsAlwaysDamaged() const +{ + return true; +} + void CCHeadsUpDisplayLayerImpl::drawHudContents(SkCanvas* canvas) { const CCLayerTreeSettings& settings = layerTreeHostImpl()->settings(); @@ -282,4 +287,9 @@ void CCHeadsUpDisplayLayerImpl::drawDebugRects(SkCanvas* canvas, CCDebugRectHist } } +const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const +{ + return "HeadsUpDisplayLayer"; +} + } diff --git a/cc/CCHeadsUpDisplayLayerImpl.h b/cc/CCHeadsUpDisplayLayerImpl.h index de8f95b..cc72100 100644 --- a/cc/CCHeadsUpDisplayLayerImpl.h +++ b/cc/CCHeadsUpDisplayLayerImpl.h @@ -34,12 +34,12 @@ public: virtual void didLoseContext() OVERRIDE; - virtual bool layerIsAlwaysDamaged() const OVERRIDE { return true; } + virtual bool layerIsAlwaysDamaged() const OVERRIDE; private: explicit CCHeadsUpDisplayLayerImpl(int); - virtual const char* layerTypeAsString() const OVERRIDE { return "HeadsUpDisplayLayer"; } + virtual const char* layerTypeAsString() const OVERRIDE; void drawHudContents(SkCanvas*); void drawFPSCounter(SkCanvas*, CCFrameRateCounter*, int top, int height); diff --git a/cc/CCLayerImpl.cpp b/cc/CCLayerImpl.cpp index a78453d..84597c5 100644 --- a/cc/CCLayerImpl.cpp +++ b/cc/CCLayerImpl.cpp @@ -153,6 +153,21 @@ void CCLayerImpl::appendDebugBorderQuad(CCQuadSink& quadList, const CCSharedQuad quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, contentRect, debugBorderColor(), debugBorderWidth()), appendQuadsData); } +bool CCLayerImpl::hasContributingDelegatedRenderPasses() const +{ + return false; +} + +CCRenderPass::Id CCLayerImpl::firstContributingRenderPassId() const +{ + return CCRenderPass::Id(0, 0); +} + +CCRenderPass::Id CCLayerImpl::nextContributingRenderPassId(CCRenderPass::Id) const +{ + return CCRenderPass::Id(0, 0); +} + CCResourceProvider::ResourceId CCLayerImpl::contentsResourceId() const { ASSERT_NOT_REACHED(); diff --git a/cc/CCLayerImpl.h b/cc/CCLayerImpl.h index ea6582e..d5c903b 100644 --- a/cc/CCLayerImpl.h +++ b/cc/CCLayerImpl.h @@ -82,9 +82,9 @@ public: virtual CCResourceProvider::ResourceId contentsResourceId() const; - virtual bool hasContributingDelegatedRenderPasses() const { return false; } - virtual CCRenderPass::Id firstContributingRenderPassId() const { return CCRenderPass::Id(0, 0); } - virtual CCRenderPass::Id nextContributingRenderPassId(CCRenderPass::Id) const { return CCRenderPass::Id(0, 0); } + virtual bool hasContributingDelegatedRenderPasses() const; + virtual CCRenderPass::Id firstContributingRenderPassId() const; + virtual CCRenderPass::Id nextContributingRenderPassId(CCRenderPass::Id) const; // Returns true if this layer has content to draw. void setDrawsContent(bool); diff --git a/cc/CCLayerTilingData.cpp b/cc/CCLayerTilingData.cpp index f650aa3..12c7aef 100644 --- a/cc/CCLayerTilingData.cpp +++ b/cc/CCLayerTilingData.cpp @@ -24,6 +24,10 @@ CCLayerTilingData::CCLayerTilingData(const IntSize& tileSize, BorderTexelOption setTileSize(tileSize); } +CCLayerTilingData::~CCLayerTilingData() +{ +} + void CCLayerTilingData::setTileSize(const IntSize& size) { if (tileSize() == size) diff --git a/cc/CCLayerTilingData.h b/cc/CCLayerTilingData.h index 6942050..695e39d 100644 --- a/cc/CCLayerTilingData.h +++ b/cc/CCLayerTilingData.h @@ -21,6 +21,8 @@ class CCLayerTilingData { public: enum BorderTexelOption { HasBorderTexels, NoBorderTexels }; + ~CCLayerTilingData(); + static PassOwnPtr<CCLayerTilingData> create(const IntSize& tileSize, BorderTexelOption); bool hasEmptyBounds() const { return m_tilingData.hasEmptyBounds(); } diff --git a/cc/CCScopedThreadProxy.cpp b/cc/CCScopedThreadProxy.cpp new file mode 100644 index 0000000..c2f1b13 --- /dev/null +++ b/cc/CCScopedThreadProxy.cpp @@ -0,0 +1,21 @@ +// Copyright 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "CCScopedThreadProxy.h" + +namespace cc { + +CCScopedThreadProxy::CCScopedThreadProxy(CCThread* targetThread) + : m_targetThread(targetThread) + , m_shutdown(false) +{ +} + +CCScopedThreadProxy::~CCScopedThreadProxy() +{ +} + +} diff --git a/cc/CCScopedThreadProxy.h b/cc/CCScopedThreadProxy.h index 645a2f6..802046d 100644 --- a/cc/CCScopedThreadProxy.h +++ b/cc/CCScopedThreadProxy.h @@ -7,6 +7,8 @@ #include "CCThreadTask.h" #include "base/threading/platform_thread.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> #include <wtf/ThreadSafeRefCounted.h> namespace cc { @@ -29,6 +31,8 @@ public: return adoptRef(new CCScopedThreadProxy(targetThread)); } + ~CCScopedThreadProxy(); + // Can be called from any thread. Posts a task to the target thread that runs unless // shutdown() is called before it runs. void postTask(PassOwnPtr<CCThread::Task> task) @@ -45,9 +49,7 @@ public: } private: - explicit CCScopedThreadProxy(CCThread* targetThread) - : m_targetThread(targetThread) - , m_shutdown(false) { } + explicit CCScopedThreadProxy(CCThread* targetThread); void runTaskIfNotShutdown(PassOwnPtr<CCThread::Task> popTask) { diff --git a/cc/CCSolidColorLayerImpl.cpp b/cc/CCSolidColorLayerImpl.cpp index e51930c..de21c52 100644 --- a/cc/CCSolidColorLayerImpl.cpp +++ b/cc/CCSolidColorLayerImpl.cpp @@ -44,5 +44,10 @@ void CCSolidColorLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData& } } +const char* CCSolidColorLayerImpl::layerTypeAsString() const +{ + return "SolidColorLayer"; +} + } // namespace cc #endif // USE(ACCELERATED_COMPOSITING) diff --git a/cc/CCSolidColorLayerImpl.h b/cc/CCSolidColorLayerImpl.h index 73f5787..f170714 100644 --- a/cc/CCSolidColorLayerImpl.h +++ b/cc/CCSolidColorLayerImpl.h @@ -24,7 +24,7 @@ protected: explicit CCSolidColorLayerImpl(int id); private: - virtual const char* layerTypeAsString() const OVERRIDE { return "SolidColorLayer"; } + virtual const char* layerTypeAsString() const OVERRIDE; const int m_tileSize; }; diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp index 57ea3d3..0c92fe7 100644 --- a/cc/CCThreadProxy.cpp +++ b/cc/CCThreadProxy.cpp @@ -936,4 +936,13 @@ void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple completion->signal(); } +CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() + : monotonicFrameBeginTime(0) +{ +} + +CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() +{ +} + } // namespace cc diff --git a/cc/CCThreadProxy.h b/cc/CCThreadProxy.h index 3744ef0..fc181a5 100644 --- a/cc/CCThreadProxy.h +++ b/cc/CCThreadProxy.h @@ -81,10 +81,8 @@ private: // Set on impl thread, read on main thread. struct BeginFrameAndCommitState { - BeginFrameAndCommitState() - : monotonicFrameBeginTime(0) - { - } + BeginFrameAndCommitState(); + ~BeginFrameAndCommitState(); double monotonicFrameBeginTime; OwnPtr<CCScrollAndScaleSet> scrollInfo; diff --git a/cc/CCThreadedTest.cpp b/cc/CCThreadedTest.cpp index b36ff33..44890d1 100644 --- a/cc/CCThreadedTest.cpp +++ b/cc/CCThreadedTest.cpp @@ -77,6 +77,15 @@ CompositorFakeWebGraphicsContext3DWithTextureTracking::CompositorFakeWebGraphics { } +CompositorFakeWebGraphicsContext3DWithTextureTracking::~CompositorFakeWebGraphicsContext3DWithTextureTracking() +{ +} + +bool TestHooks::prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*) +{ + return true; +} + PassOwnPtr<WebCompositorOutputSurface> TestHooks::createOutputSurface() { return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3DWithTextureTracking::create(WebGraphicsContext3D::Attributes())); @@ -296,7 +305,12 @@ CCThreadedTest::CCThreadedTest() , m_finished(false) , m_scheduled(false) , m_started(false) -{ } +{ +} + +CCThreadedTest::~CCThreadedTest() +{ +} void CCThreadedTest::endTest() { diff --git a/cc/CCThreadedTest.h b/cc/CCThreadedTest.h index d9e4391..53e6fe0 100644 --- a/cc/CCThreadedTest.h +++ b/cc/CCThreadedTest.h @@ -28,7 +28,7 @@ class TestHooks : public WebKit::WebAnimationDelegate { public: virtual void beginCommitOnCCThread(cc::CCLayerTreeHostImpl*) { } virtual void commitCompleteOnCCThread(cc::CCLayerTreeHostImpl*) { } - virtual bool prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*) { return true; } + virtual bool prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*); virtual void drawLayersOnCCThread(cc::CCLayerTreeHostImpl*) { } virtual void animateLayers(cc::CCLayerTreeHostImpl*, double monotonicTime) { } virtual void willAnimateLayers(cc::CCLayerTreeHostImpl*, double monotonicTime) { } @@ -66,6 +66,8 @@ class MockCCLayerTreeHostClient : public cc::CCLayerTreeHostClient { // ending the test is an asynchronous process. class CCThreadedTest : public testing::Test, public TestHooks { public: + virtual ~CCThreadedTest(); + virtual void afterTest() = 0; virtual void beginTest() = 0; @@ -94,7 +96,7 @@ protected: virtual void initializeSettings(cc::CCLayerTreeSettings&) { } - virtual void scheduleComposite(); + virtual void scheduleComposite() OVERRIDE; void realEndTest(); @@ -145,18 +147,18 @@ class MockLayerTreeHostImpl : public cc::CCLayerTreeHostImpl { public: static PassOwnPtr<MockLayerTreeHostImpl> create(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); - virtual void beginCommit(); - virtual void commitComplete(); - virtual bool prepareToDraw(FrameData&); - virtual void drawLayers(const FrameData&); + virtual void beginCommit() OVERRIDE; + virtual void commitComplete() OVERRIDE; + virtual bool prepareToDraw(FrameData&) OVERRIDE; + virtual void drawLayers(const FrameData&) OVERRIDE; // Make these public. typedef Vector<cc::CCLayerImpl*> CCLayerList; using CCLayerTreeHostImpl::calculateRenderSurfaceLayerList; protected: - virtual void animateLayers(double monotonicTime, double wallClockTime); - virtual base::TimeDelta lowFrequencyAnimationInterval() const; + virtual void animateLayers(double monotonicTime, double wallClockTime) OVERRIDE; + virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; private: MockLayerTreeHostImpl(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); @@ -167,6 +169,7 @@ private: class CompositorFakeWebGraphicsContext3DWithTextureTracking : public WebKit::CompositorFakeWebGraphicsContext3D { public: static PassOwnPtr<CompositorFakeWebGraphicsContext3DWithTextureTracking> create(Attributes); + virtual ~CompositorFakeWebGraphicsContext3DWithTextureTracking(); virtual WebKit::WebGLId createTexture(); diff --git a/cc/ContentLayerChromium.cpp b/cc/ContentLayerChromium.cpp index c662f69..8e5133e 100644 --- a/cc/ContentLayerChromium.cpp +++ b/cc/ContentLayerChromium.cpp @@ -80,6 +80,11 @@ bool ContentLayerChromium::needMoreUpdates() return needsIdlePaint(); } +LayerTextureUpdater* ContentLayerChromium::textureUpdater() const +{ + return m_textureUpdater.get(); +} + void ContentLayerChromium::createTextureUpdaterIfNeeded() { if (m_textureUpdater) diff --git a/cc/ContentLayerChromium.h b/cc/ContentLayerChromium.h index 2e824d4..00663d5 100644 --- a/cc/ContentLayerChromium.h +++ b/cc/ContentLayerChromium.h @@ -54,7 +54,7 @@ protected: private: - virtual LayerTextureUpdater* textureUpdater() const OVERRIDE { return m_textureUpdater.get(); } + virtual LayerTextureUpdater* textureUpdater() const OVERRIDE; virtual void createTextureUpdaterIfNeeded() OVERRIDE; ContentLayerChromiumClient* m_client; diff --git a/cc/HeadsUpDisplayLayerChromium.cpp b/cc/HeadsUpDisplayLayerChromium.cpp index fcd0b23..9a71c46 100644 --- a/cc/HeadsUpDisplayLayerChromium.cpp +++ b/cc/HeadsUpDisplayLayerChromium.cpp @@ -45,6 +45,11 @@ void HeadsUpDisplayLayerChromium::update(CCTextureUpdateQueue&, const CCOcclusio setBounds(bounds); } +bool HeadsUpDisplayLayerChromium::drawsContent() const +{ + return true; +} + void HeadsUpDisplayLayerChromium::setFontAtlas(PassOwnPtr<CCFontAtlas> fontAtlas) { m_fontAtlas = fontAtlas; diff --git a/cc/HeadsUpDisplayLayerChromium.h b/cc/HeadsUpDisplayLayerChromium.h index a28351b..518212c 100644 --- a/cc/HeadsUpDisplayLayerChromium.h +++ b/cc/HeadsUpDisplayLayerChromium.h @@ -18,7 +18,7 @@ public: virtual ~HeadsUpDisplayLayerChromium(); virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; - virtual bool drawsContent() const OVERRIDE { return true; } + virtual bool drawsContent() const OVERRIDE; void setFontAtlas(PassOwnPtr<CCFontAtlas>); diff --git a/cc/LayerChromium.cpp b/cc/LayerChromium.cpp index 59a63ef..b053403 100644 --- a/cc/LayerChromium.cpp +++ b/cc/LayerChromium.cpp @@ -262,6 +262,11 @@ void LayerChromium::setBackgroundColor(SkColor backgroundColor) setNeedsCommit(); } +IntSize LayerChromium::contentBounds() const +{ + return bounds(); +} + void LayerChromium::setMasksToBounds(bool masksToBounds) { if (m_masksToBounds == masksToBounds) @@ -316,6 +321,11 @@ void LayerChromium::setBackgroundFilters(const WebKit::WebFilterOperations& back CCLayerTreeHost::setNeedsFilterContext(true); } +bool LayerChromium::needsDisplay() const +{ + return m_needsDisplay; +} + void LayerChromium::setOpacity(float opacity) { if (m_opacity == opacity) @@ -568,6 +578,21 @@ PassOwnPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() return CCLayerImpl::create(m_layerId); } +bool LayerChromium::drawsContent() const +{ + return m_isDrawable; +} + +bool LayerChromium::needMoreUpdates() +{ + return false; +} + +bool LayerChromium::needsContentsScale() const +{ + return false; +} + void LayerChromium::setDebugBorderColor(SkColor color) { m_debugBorderColor = color; @@ -620,6 +645,16 @@ bool LayerChromium::descendantDrawsContent() return false; } +int LayerChromium::id() const +{ + return m_layerId; +} + +float LayerChromium::opacity() const +{ + return m_opacity; +} + void LayerChromium::setOpacityFromAnimation(float opacity) { // This is called due to an ongoing accelerated animation. Since this animation is @@ -628,6 +663,11 @@ void LayerChromium::setOpacityFromAnimation(float opacity) m_opacity = opacity; } +const WebKit::WebTransformationMatrix& LayerChromium::transform() const +{ + return m_transform; +} + void LayerChromium::setTransformFromAnimation(const WebTransformationMatrix& transform) { // This is called due to an ongoing accelerated animation. Since this animation is @@ -721,6 +761,11 @@ Region LayerChromium::visibleContentOpaqueRegion() const return Region(); } +ScrollbarLayerChromium* LayerChromium::toScrollbarLayerChromium() +{ + return 0; +} + void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChromium> >::iterator, void*) { // Currently we don't use z-order to decide what to paint, so there's no need to actually sort LayerChromiums. diff --git a/cc/LayerChromium.h b/cc/LayerChromium.h index 71ec0cc..0e02cfd 100644 --- a/cc/LayerChromium.h +++ b/cc/LayerChromium.h @@ -50,14 +50,14 @@ public: virtual ~LayerChromium(); // CCLayerAnimationControllerClient implementation - virtual int id() const OVERRIDE { return m_layerId; } + virtual int id() const OVERRIDE; virtual void setOpacityFromAnimation(float) OVERRIDE; - virtual float opacity() const OVERRIDE { return m_opacity; } + virtual float opacity() const OVERRIDE; virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix&) OVERRIDE; // A layer's transform operates layer space. That is, entirely in logical, // non-page-scaled pixels (that is, they have page zoom baked in, but not page scale). // The root layer is a special case -- it operates in physical pixels. - virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE { return m_transform; } + virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE; LayerChromium* rootLayer(); LayerChromium* parent() const; @@ -83,7 +83,7 @@ public: // root layer's bounds are in physical pixels). void setBounds(const IntSize&); const IntSize& bounds() const { return m_bounds; } - virtual IntSize contentBounds() const { return bounds(); } + virtual IntSize contentBounds() const; void setMasksToBounds(bool); bool masksToBounds() const { return m_masksToBounds; } @@ -93,7 +93,7 @@ public: virtual void setNeedsDisplayRect(const FloatRect& dirtyRect); void setNeedsDisplay() { setNeedsDisplayRect(FloatRect(FloatPoint(), bounds())); } - virtual bool needsDisplay() const { return m_needsDisplay; } + virtual bool needsDisplay() const; void setOpacity(float); bool opacityIsAnimating() const; @@ -184,12 +184,12 @@ public: bool replicaHasMask() const { return m_replicaLayer && (m_maskLayer || m_replicaLayer->m_maskLayer); } // These methods typically need to be overwritten by derived classes. - virtual bool drawsContent() const { return m_isDrawable; } + virtual bool drawsContent() const; virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) { } - virtual bool needMoreUpdates() { return false; } + virtual bool needMoreUpdates(); virtual void setIsMask(bool) { } virtual void bindContentsTexture() { } - virtual bool needsContentsScale() const { return false; } + virtual bool needsContentsScale() const; void setDebugBorderColor(SkColor); void setDebugBorderWidth(float); @@ -263,7 +263,7 @@ public: virtual Region visibleContentOpaqueRegion() const; - virtual ScrollbarLayerChromium* toScrollbarLayerChromium() { return 0; } + virtual ScrollbarLayerChromium* toScrollbarLayerChromium(); protected: friend class CCLayerImpl; diff --git a/cc/LayerTextureUpdater.cpp b/cc/LayerTextureUpdater.cpp new file mode 100644 index 0000000..ed61a35 --- /dev/null +++ b/cc/LayerTextureUpdater.cpp @@ -0,0 +1,25 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "LayerTextureUpdater.h" + +namespace cc { + +LayerTextureUpdater::Texture::Texture(PassOwnPtr<CCPrioritizedTexture> texture) + : m_texture(texture) +{ +} + +LayerTextureUpdater::Texture::~Texture() +{ +} + +bool LayerTextureUpdater::Texture::backingResourceWasEvicted() const +{ + return m_texture->backingResourceWasEvicted(); +} + +} diff --git a/cc/LayerTextureUpdater.h b/cc/LayerTextureUpdater.h index 7670fde..0426bc4 100644 --- a/cc/LayerTextureUpdater.h +++ b/cc/LayerTextureUpdater.h @@ -24,15 +24,15 @@ public: // Allows texture uploaders to store per-tile resources. class Texture { public: - virtual ~Texture() { } + virtual ~Texture(); CCPrioritizedTexture* texture() { return m_texture.get(); } void swapTextureWith(OwnPtr<CCPrioritizedTexture>& texture) { m_texture.swap(texture); } virtual void prepareRect(const IntRect& /* sourceRect */, CCRenderingStats&) { } virtual void updateRect(CCResourceProvider*, const IntRect& sourceRect, const IntSize& destOffset) = 0; - virtual bool backingResourceWasEvicted() const { return m_texture->backingResourceWasEvicted(); } + virtual bool backingResourceWasEvicted() const; protected: - explicit Texture(PassOwnPtr<CCPrioritizedTexture> texture) : m_texture(texture) { } + explicit Texture(PassOwnPtr<CCPrioritizedTexture> texture); private: OwnPtr<CCPrioritizedTexture> m_texture; diff --git a/cc/ScrollbarLayerChromium.cpp b/cc/ScrollbarLayerChromium.cpp index 85801e6..80e36fb 100644 --- a/cc/ScrollbarLayerChromium.cpp +++ b/cc/ScrollbarLayerChromium.cpp @@ -38,6 +38,10 @@ ScrollbarLayerChromium::ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar> { } +ScrollbarLayerChromium::~ScrollbarLayerChromium() +{ +} + void ScrollbarLayerChromium::pushPropertiesTo(CCLayerImpl* layer) { LayerChromium::pushPropertiesTo(layer); @@ -65,6 +69,11 @@ void ScrollbarLayerChromium::pushPropertiesTo(CCLayerImpl* layer) scrollbarLayer->setThumbResourceId(0); } +ScrollbarLayerChromium* ScrollbarLayerChromium::toScrollbarLayerChromium() +{ + return this; +} + class ScrollbarBackgroundPainter : public LayerPainterChromium { WTF_MAKE_NONCOPYABLE(ScrollbarBackgroundPainter); public: diff --git a/cc/ScrollbarLayerChromium.h b/cc/ScrollbarLayerChromium.h index b4b8b8b..62ace2d 100644 --- a/cc/ScrollbarLayerChromium.h +++ b/cc/ScrollbarLayerChromium.h @@ -23,8 +23,11 @@ class CCTextureUpdateQueue; class ScrollbarLayerChromium : public LayerChromium { public: virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE; + static PassRefPtr<ScrollbarLayerChromium> create(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId); + virtual ~ScrollbarLayerChromium(); + // LayerChromium interface virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; @@ -34,7 +37,7 @@ public: int scrollLayerId() const { return m_scrollLayerId; } void setScrollLayerId(int id) { m_scrollLayerId = id; } - virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE { return this; } + virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE; protected: ScrollbarLayerChromium(PassOwnPtr<WebKit::WebScrollbar>, WebKit::WebScrollbarThemePainter, PassOwnPtr<WebKit::WebScrollbarThemeGeometry>, int scrollLayerId); diff --git a/cc/UnthrottledTextureUploader.cpp b/cc/UnthrottledTextureUploader.cpp new file mode 100644 index 0000000..8582eb3 --- /dev/null +++ b/cc/UnthrottledTextureUploader.cpp @@ -0,0 +1,26 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "UnthrottledTextureUploader.h" + +namespace cc { + +bool UnthrottledTextureUploader::isBusy() +{ + return false; +} + +double UnthrottledTextureUploader::estimatedTexturesPerSecond() +{ + return std::numeric_limits<double>::max(); +} + +void UnthrottledTextureUploader::uploadTexture(CCResourceProvider* resourceProvider, Parameters upload) +{ + upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); +} + +} diff --git a/cc/UnthrottledTextureUploader.h b/cc/UnthrottledTextureUploader.h index 4f97baf..a44d4ff 100644 --- a/cc/UnthrottledTextureUploader.h +++ b/cc/UnthrottledTextureUploader.h @@ -19,11 +19,11 @@ public: } virtual ~UnthrottledTextureUploader() { } - virtual bool isBusy() OVERRIDE { return false; } - virtual double estimatedTexturesPerSecond() { return std::numeric_limits<double>::max(); } + virtual bool isBusy() OVERRIDE; + virtual double estimatedTexturesPerSecond() OVERRIDE; virtual void beginUploads() OVERRIDE { } virtual void endUploads() OVERRIDE { } - virtual void uploadTexture(CCResourceProvider* resourceProvider, Parameters upload) OVERRIDE { upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); } + virtual void uploadTexture(CCResourceProvider* resourceProvider, Parameters upload) OVERRIDE; protected: UnthrottledTextureUploader() { } @@ -110,6 +110,7 @@ 'CCSchedulerStateMachine.h', 'CCScopedTexture.cpp', 'CCScopedTexture.h', + 'CCScopedThreadProxy.cpp', 'CCScopedThreadProxy.h', 'CCScrollbarAnimationController.cpp', 'CCScrollbarAnimationController.h', @@ -182,6 +183,7 @@ 'LayerPainterChromium.h', 'LayerTextureSubImage.cpp', 'LayerTextureSubImage.h', + 'LayerTextureUpdater.cpp', 'LayerTextureUpdater.h', 'PlatformColor.h', 'ProgramBinding.cpp', @@ -206,6 +208,7 @@ 'TextureUploader.h', 'ThrottledTextureUploader.cpp', 'ThrottledTextureUploader.h', + 'UnthrottledTextureUploader.cpp', 'UnthrottledTextureUploader.h', 'TiledLayerChromium.cpp', 'TiledLayerChromium.h', diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index 8201254..9df85b9 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -61,6 +61,7 @@ 'test/CCLayerTestCommon.cpp', 'test/CCLayerTestCommon.h', 'test/CCOcclusionTrackerTestCommon.h', + 'test/CCSchedulerTestCommon.cpp', 'test/CCSchedulerTestCommon.h', 'test/CCRenderPassTestCommon.h', 'test/CCTestCommon.h', @@ -68,11 +69,13 @@ 'test/CCTiledLayerTestCommon.h', 'test/CompositorFakeWebGraphicsContext3D.h', 'test/FakeCCGraphicsContext.h', + 'test/FakeCCLayerTreeHostClient.cpp', 'test/FakeCCLayerTreeHostClient.h', 'test/FakeGraphicsContext3DTest.cpp', 'test/FakeWebCompositorOutputSurface.h', 'test/FakeWebGraphicsContext3D.h', 'test/FakeWebScrollbarThemeGeometry.h', + 'test/MockCCQuadCuller.cpp', 'test/MockCCQuadCuller.h', 'test/WebCompositorInitializer.h', ], diff --git a/cc/test/CCSchedulerTestCommon.cpp b/cc/test/CCSchedulerTestCommon.cpp new file mode 100644 index 0000000..e4f2a6c --- /dev/null +++ b/cc/test/CCSchedulerTestCommon.cpp @@ -0,0 +1,75 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "CCSchedulerTestCommon.h" + +namespace WebKitTests { + +void FakeCCTimeSourceClient::onTimerTick() +{ + m_tickCalled = true; +} + +FakeCCThread::FakeCCThread() +{ + reset(); +} + +FakeCCThread::~FakeCCThread() +{ +} + +void FakeCCThread::postTask(PassOwnPtr<Task>) +{ + ASSERT_NOT_REACHED(); +} + +void FakeCCThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) +{ + if (m_runPendingTaskOnOverwrite && hasPendingTask()) + runPendingTask(); + + EXPECT_TRUE(!hasPendingTask()); + m_pendingTask = task; + m_pendingTaskDelay = delay; +} + +base::PlatformThreadId FakeCCThread::threadID() const +{ + return 0; +} + +void FakeCCTimeSource::setClient(cc::CCTimeSourceClient* client) +{ + m_client = client; +} + +void FakeCCTimeSource::setActive(bool b) +{ + m_active = b; +} + +bool FakeCCTimeSource::active() const +{ + return m_active; +} + +base::TimeTicks FakeCCTimeSource::lastTickTime() +{ + return base::TimeTicks(); +} + +base::TimeTicks FakeCCTimeSource::nextTickTimeIfActivated() +{ + return base::TimeTicks(); +} + +base::TimeTicks FakeCCDelayBasedTimeSource::now() const +{ + return m_now; +} + +} diff --git a/cc/test/CCSchedulerTestCommon.h b/cc/test/CCSchedulerTestCommon.h index 770d41e..1eb3b02 100644 --- a/cc/test/CCSchedulerTestCommon.h +++ b/cc/test/CCSchedulerTestCommon.h @@ -20,7 +20,7 @@ public: void reset() { m_tickCalled = false; } bool tickCalled() const { return m_tickCalled; } - virtual void onTimerTick() OVERRIDE { m_tickCalled = true; } + virtual void onTimerTick() OVERRIDE; protected: bool m_tickCalled; @@ -28,7 +28,9 @@ protected: class FakeCCThread : public cc::CCThread { public: - FakeCCThread() { reset(); } + FakeCCThread(); + virtual ~FakeCCThread(); + void reset() { m_pendingTaskDelay = 0; @@ -55,17 +57,9 @@ public: return m_pendingTaskDelay; } - virtual void postTask(PassOwnPtr<Task>) { ASSERT_NOT_REACHED(); } - virtual void postDelayedTask(PassOwnPtr<Task> task, long long delay) - { - if (m_runPendingTaskOnOverwrite && hasPendingTask()) - runPendingTask(); - - EXPECT_TRUE(!hasPendingTask()); - m_pendingTask = task; - m_pendingTaskDelay = delay; - } - virtual base::PlatformThreadId threadID() const { return 0; } + virtual void postTask(PassOwnPtr<Task>) OVERRIDE; + virtual void postDelayedTask(PassOwnPtr<Task> task, long long delay) OVERRIDE; + virtual base::PlatformThreadId threadID() const OVERRIDE; protected: OwnPtr<Task> m_pendingTask; @@ -84,12 +78,12 @@ public: virtual ~FakeCCTimeSource() { } - virtual void setClient(cc::CCTimeSourceClient* client) OVERRIDE { m_client = client; } - virtual void setActive(bool b) OVERRIDE { m_active = b; } - virtual bool active() const OVERRIDE { return m_active; } + virtual void setClient(cc::CCTimeSourceClient* client) OVERRIDE; + virtual void setActive(bool b) OVERRIDE; + virtual bool active() const OVERRIDE; virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE { } - virtual base::TimeTicks lastTickTime() OVERRIDE { return base::TimeTicks(); } - virtual base::TimeTicks nextTickTimeIfActivated() OVERRIDE { return base::TimeTicks(); } + virtual base::TimeTicks lastTickTime() OVERRIDE; + virtual base::TimeTicks nextTickTimeIfActivated() OVERRIDE; void tick() { @@ -114,7 +108,7 @@ public: } void setNow(base::TimeTicks time) { m_now = time; } - virtual base::TimeTicks now() const OVERRIDE { return m_now; } + virtual base::TimeTicks now() const OVERRIDE; protected: FakeCCDelayBasedTimeSource(base::TimeDelta interval, cc::CCThread* thread) diff --git a/cc/test/CCTiledLayerTestCommon.cpp b/cc/test/CCTiledLayerTestCommon.cpp index 519f426..a2fa9d2 100644 --- a/cc/test/CCTiledLayerTestCommon.cpp +++ b/cc/test/CCTiledLayerTestCommon.cpp @@ -147,4 +147,9 @@ void FakeTextureUploader::uploadTexture(cc::CCResourceProvider* resourceProvider upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destOffset); } +double FakeTextureUploader::estimatedTexturesPerSecond() +{ + return std::numeric_limits<double>::max(); +} + } // namespace diff --git a/cc/test/CCTiledLayerTestCommon.h b/cc/test/CCTiledLayerTestCommon.h index 39bbe81..0eebeb0 100644 --- a/cc/test/CCTiledLayerTestCommon.h +++ b/cc/test/CCTiledLayerTestCommon.h @@ -131,7 +131,7 @@ protected: class FakeTextureUploader : public cc::TextureUploader { public: virtual bool isBusy() OVERRIDE; - virtual double estimatedTexturesPerSecond() OVERRIDE { return std::numeric_limits<double>::max(); } + virtual double estimatedTexturesPerSecond() OVERRIDE; virtual void beginUploads() OVERRIDE { } virtual void endUploads() OVERRIDE { } virtual void uploadTexture(cc::CCResourceProvider*, Parameters upload) OVERRIDE; diff --git a/cc/test/FakeCCLayerTreeHostClient.cpp b/cc/test/FakeCCLayerTreeHostClient.cpp new file mode 100644 index 0000000..0c081a5 --- /dev/null +++ b/cc/test/FakeCCLayerTreeHostClient.cpp @@ -0,0 +1,22 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "FakeCCLayerTreeHostClient.h" + +namespace cc { + +PassOwnPtr<WebKit::WebCompositorOutputSurface> FakeCCLayerTreeHostClient::createOutputSurface() +{ + WebKit::WebGraphicsContext3D::Attributes attrs; + return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(attrs)); +} + +PassOwnPtr<CCInputHandler> FakeCCLayerTreeHostClient::createInputHandler() +{ + return nullptr; +} + +} diff --git a/cc/test/FakeCCLayerTreeHostClient.h b/cc/test/FakeCCLayerTreeHostClient.h index 06b3348..2813113 100644 --- a/cc/test/FakeCCLayerTreeHostClient.h +++ b/cc/test/FakeCCLayerTreeHostClient.h @@ -21,13 +21,9 @@ public: virtual void layout() OVERRIDE { } virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) OVERRIDE { } - virtual PassOwnPtr<WebKit::WebCompositorOutputSurface> createOutputSurface() OVERRIDE - { - WebKit::WebGraphicsContext3D::Attributes attrs; - return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(attrs)); - } + virtual PassOwnPtr<WebKit::WebCompositorOutputSurface> createOutputSurface() OVERRIDE; virtual void didRecreateOutputSurface(bool success) OVERRIDE { } - virtual PassOwnPtr<CCInputHandler> createInputHandler() OVERRIDE { return nullptr; } + virtual PassOwnPtr<CCInputHandler> createInputHandler() OVERRIDE; virtual void willCommit() OVERRIDE { } virtual void didCommit() OVERRIDE { } virtual void didCommitAndDrawFrame() OVERRIDE { } diff --git a/cc/test/MockCCQuadCuller.cpp b/cc/test/MockCCQuadCuller.cpp new file mode 100644 index 0000000..5d01c96 --- /dev/null +++ b/cc/test/MockCCQuadCuller.cpp @@ -0,0 +1,47 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" + +#include "MockCCQuadCuller.h" + +namespace cc { + +MockCCQuadCuller::MockCCQuadCuller() + : m_activeQuadList(m_quadListStorage) + , m_activeSharedQuadStateList(m_sharedQuadStateStorage) +{ +} + +MockCCQuadCuller::MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList) + : m_activeQuadList(externalQuadList) + , m_activeSharedQuadStateList(externalSharedQuadStateList) +{ +} + +MockCCQuadCuller::~MockCCQuadCuller() +{ +} + +bool MockCCQuadCuller::append(PassOwnPtr<CCDrawQuad> newQuad, CCAppendQuadsData&) +{ + OwnPtr<CCDrawQuad> drawQuad = newQuad; + if (!drawQuad->quadRect().isEmpty()) { + m_activeQuadList.append(drawQuad.release()); + return true; + } + return false; +} + +CCSharedQuadState* MockCCQuadCuller::useSharedQuadState(PassOwnPtr<CCSharedQuadState> passSharedQuadState) +{ + OwnPtr<CCSharedQuadState> sharedQuadState(passSharedQuadState); + sharedQuadState->id = m_activeSharedQuadStateList.size(); + + CCSharedQuadState* rawPtr = sharedQuadState.get(); + m_activeSharedQuadStateList.append(sharedQuadState.release()); + return rawPtr; +} + +} // namespace cc diff --git a/cc/test/MockCCQuadCuller.h b/cc/test/MockCCQuadCuller.h index 6edfe08..54e6425 100644 --- a/cc/test/MockCCQuadCuller.h +++ b/cc/test/MockCCQuadCuller.h @@ -7,6 +7,7 @@ #include "CCDrawQuad.h" #include "CCQuadSink.h" +#include "CCRenderPass.h" #include "IntRect.h" #include <wtf/PassOwnPtr.h> @@ -14,35 +15,14 @@ namespace cc { class MockCCQuadCuller : public CCQuadSink { public: - MockCCQuadCuller() - : m_activeQuadList(m_quadListStorage) - , m_activeSharedQuadStateList(m_sharedQuadStateStorage) - { } - - explicit MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList) - : m_activeQuadList(externalQuadList) - , m_activeSharedQuadStateList(externalSharedQuadStateList) - { } - - virtual bool append(PassOwnPtr<CCDrawQuad> newQuad, CCAppendQuadsData&) OVERRIDE - { - OwnPtr<CCDrawQuad> drawQuad = newQuad; - if (!drawQuad->quadRect().isEmpty()) { - m_activeQuadList.append(drawQuad.release()); - return true; - } - return false; - } - - virtual CCSharedQuadState* useSharedQuadState(PassOwnPtr<CCSharedQuadState> passSharedQuadState) OVERRIDE - { - OwnPtr<CCSharedQuadState> sharedQuadState(passSharedQuadState); - sharedQuadState->id = m_activeSharedQuadStateList.size(); - - CCSharedQuadState* rawPtr = sharedQuadState.get(); - m_activeSharedQuadStateList.append(sharedQuadState.release()); - return rawPtr; - } + MockCCQuadCuller(); + virtual ~MockCCQuadCuller(); + + MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList); + + virtual bool append(PassOwnPtr<CCDrawQuad> newQuad, CCAppendQuadsData&) OVERRIDE; + + virtual CCSharedQuadState* useSharedQuadState(PassOwnPtr<CCSharedQuadState> passSharedQuadState) OVERRIDE; const CCQuadList& quadList() const { return m_activeQuadList; }; const CCSharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; |