diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 23:09:55 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 23:09:55 +0000 |
commit | 96baf3e81b1df4b0836d70c3cded9795e63fa789 (patch) | |
tree | 4332d128a05777ae34641ca2f185b7b548330b8d /cc/test | |
parent | 1597399122fa6d8343dc6d5cdb771f95908c09b1 (diff) | |
download | chromium_src-96baf3e81b1df4b0836d70c3cded9795e63fa789.zip chromium_src-96baf3e81b1df4b0836d70c3cded9795e63fa789.tar.gz chromium_src-96baf3e81b1df4b0836d70c3cded9795e63fa789.tar.bz2 |
cc: Rename cc classes and members to match filenames
Fixed reland of https://chromiumcodereview.appspot.com/11189043/
TBR=jam@chromium.org,jamesr@chromium.org
BUG=155413
Review URL: https://codereview.chromium.org/11231054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/animation_test_common.cc | 44 | ||||
-rw-r--r-- | cc/test/animation_test_common.h | 32 | ||||
-rw-r--r-- | cc/test/fake_graphics_context.h | 4 | ||||
-rw-r--r-- | cc/test/fake_layer_tree_host_client.cc | 6 | ||||
-rw-r--r-- | cc/test/fake_layer_tree_host_client.h | 4 | ||||
-rw-r--r-- | cc/test/layer_test_common.cc | 8 | ||||
-rw-r--r-- | cc/test/layer_test_common.h | 6 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.cc | 180 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.h | 62 | ||||
-rw-r--r-- | cc/test/mock_quad_culler.cc | 12 | ||||
-rw-r--r-- | cc/test/mock_quad_culler.h | 24 | ||||
-rw-r--r-- | cc/test/occlusion_tracker_test_common.h | 18 | ||||
-rw-r--r-- | cc/test/render_pass_test_common.h | 10 | ||||
-rw-r--r-- | cc/test/scheduler_test_common.cc | 24 | ||||
-rw-r--r-- | cc/test/scheduler_test_common.h | 36 | ||||
-rw-r--r-- | cc/test/test_common.h | 6 | ||||
-rw-r--r-- | cc/test/tiled_layer_test_common.cc | 42 | ||||
-rw-r--r-- | cc/test/tiled_layer_test_common.h | 50 |
18 files changed, 284 insertions, 284 deletions
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc index 7ceaf3f..0cfb794 100644 --- a/cc/test/animation_test_common.cc +++ b/cc/test/animation_test_common.cc @@ -19,16 +19,16 @@ namespace { template <class Target> void addOpacityTransition(Target& target, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create()); + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create()); - scoped_ptr<CCTimingFunction> func; + scoped_ptr<TimingFunction> func; if (!useTimingFunction) - func = CCEaseTimingFunction::create(); + func = EaseTimingFunction::create(); if (duration > 0) - curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, func.Pass())); - curve->addKeyframe(CCFloatKeyframe::create(duration, endOpacity, scoped_ptr<cc::CCTimingFunction>())); + curve->addKeyframe(FloatKeyframe::create(0, startOpacity, func.Pass())); + curve->addKeyframe(FloatKeyframe::create(duration, endOpacity, scoped_ptr<cc::TimingFunction>())); - scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), 0, 0, CCActiveAnimation::Opacity)); + scoped_ptr<ActiveAnimation> animation(ActiveAnimation::create(curve.PassAs<AnimationCurve>(), 0, 0, ActiveAnimation::Opacity)); animation->setNeedsSynchronizedStartTime(true); target.addAnimation(animation.Pass()); @@ -38,19 +38,19 @@ template <class Target> void addAnimatedTransform(Target& target, double duration, int deltaX, int deltaY) { static int id = 0; - scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create()); + scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); if (duration > 0) { WebKit::WebTransformOperations startOperations; startOperations.appendTranslate(deltaX, deltaY, 0); - curve->addKeyframe(CCTransformKeyframe::create(0, startOperations, scoped_ptr<cc::CCTimingFunction>())); + curve->addKeyframe(TransformKeyframe::create(0, startOperations, scoped_ptr<cc::TimingFunction>())); } WebKit::WebTransformOperations operations; operations.appendTranslate(deltaX, deltaY, 0); - curve->addKeyframe(CCTransformKeyframe::create(duration, operations, scoped_ptr<cc::CCTimingFunction>())); + curve->addKeyframe(TransformKeyframe::create(duration, operations, scoped_ptr<cc::TimingFunction>())); - scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), id++, 0, CCActiveAnimation::Transform)); + scoped_ptr<ActiveAnimation> animation(ActiveAnimation::create(curve.PassAs<AnimationCurve>(), id++, 0, ActiveAnimation::Transform)); animation->setNeedsSynchronizedStartTime(true); target.addAnimation(animation.Pass()); @@ -84,9 +84,9 @@ float FakeFloatAnimationCurve::getValue(double now) const return 0; } -scoped_ptr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const +scoped_ptr<cc::AnimationCurve> FakeFloatAnimationCurve::clone() const { - return make_scoped_ptr(new FakeFloatAnimationCurve).PassAs<cc::CCAnimationCurve>(); + return make_scoped_ptr(new FakeFloatAnimationCurve).PassAs<cc::AnimationCurve>(); } FakeTransformTransition::FakeTransformTransition(double duration) @@ -108,9 +108,9 @@ WebKit::WebTransformationMatrix FakeTransformTransition::getValue(double time) c return WebKit::WebTransformationMatrix(); } -scoped_ptr<cc::CCAnimationCurve> FakeTransformTransition::clone() const +scoped_ptr<cc::AnimationCurve> FakeTransformTransition::clone() const { - return make_scoped_ptr(new FakeTransformTransition(*this)).PassAs<cc::CCAnimationCurve>(); + return make_scoped_ptr(new FakeTransformTransition(*this)).PassAs<cc::AnimationCurve>(); } @@ -172,37 +172,37 @@ const WebKit::WebTransformationMatrix& FakeLayerAnimationControllerClient::trans return m_transform; } -scoped_ptr<cc::CCAnimationCurve> FakeFloatTransition::clone() const +scoped_ptr<cc::AnimationCurve> FakeFloatTransition::clone() const { - return make_scoped_ptr(new FakeFloatTransition(*this)).PassAs<cc::CCAnimationCurve>(); + return make_scoped_ptr(new FakeFloatTransition(*this)).PassAs<cc::AnimationCurve>(); } -void addOpacityTransitionToController(cc::CCLayerAnimationController& controller, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToController(cc::LayerAnimationController& controller, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(controller, duration, startOpacity, endOpacity, useTimingFunction); } -void addAnimatedTransformToController(cc::CCLayerAnimationController& controller, double duration, int deltaX, int deltaY) +void addAnimatedTransformToController(cc::LayerAnimationController& controller, double duration, int deltaX, int deltaY) { addAnimatedTransform(controller, duration, deltaX, deltaY); } -void addOpacityTransitionToLayer(cc::LayerChromium& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToLayer(cc::Layer& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(layer, duration, startOpacity, endOpacity, useTimingFunction); } -void addOpacityTransitionToLayer(cc::CCLayerImpl& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToLayer(cc::LayerImpl& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(*layer.layerAnimationController(), duration, startOpacity, endOpacity, useTimingFunction); } -void addAnimatedTransformToLayer(cc::LayerChromium& layer, double duration, int deltaX, int deltaY) +void addAnimatedTransformToLayer(cc::Layer& layer, double duration, int deltaX, int deltaY) { addAnimatedTransform(layer, duration, deltaX, deltaY); } -void addAnimatedTransformToLayer(cc::CCLayerImpl& layer, double duration, int deltaX, int deltaY) +void addAnimatedTransformToLayer(cc::LayerImpl& layer, double duration, int deltaX, int deltaY) { addAnimatedTransform(*layer.layerAnimationController(), duration, deltaX, deltaY); } diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h index a768930..8c00efb 100644 --- a/cc/test/animation_test_common.h +++ b/cc/test/animation_test_common.h @@ -11,13 +11,13 @@ #include "IntSize.h" namespace cc { -class CCLayerImpl; -class LayerChromium; +class LayerImpl; +class Layer; } namespace WebKitTests { -class FakeFloatAnimationCurve : public cc::CCFloatAnimationCurve { +class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { public: FakeFloatAnimationCurve(); explicit FakeFloatAnimationCurve(double duration); @@ -25,13 +25,13 @@ public: virtual double duration() const OVERRIDE; virtual float getValue(double now) const OVERRIDE; - virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; private: double m_duration; }; -class FakeTransformTransition : public cc::CCTransformAnimationCurve { +class FakeTransformTransition : public cc::TransformAnimationCurve { public: FakeTransformTransition(double duration); virtual ~FakeTransformTransition(); @@ -39,13 +39,13 @@ public: virtual double duration() const OVERRIDE; virtual WebKit::WebTransformationMatrix getValue(double time) const OVERRIDE; - virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; private: double m_duration; }; -class FakeFloatTransition : public cc::CCFloatAnimationCurve { +class FakeFloatTransition : public cc::FloatAnimationCurve { public: FakeFloatTransition(double duration, float from, float to); virtual ~FakeFloatTransition(); @@ -53,7 +53,7 @@ public: virtual double duration() const OVERRIDE; virtual float getValue(double time) const OVERRIDE; - virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::AnimationCurve> clone() const OVERRIDE; private: double m_duration; @@ -61,12 +61,12 @@ private: float m_to; }; -class FakeLayerAnimationControllerClient : public cc::CCLayerAnimationControllerClient { +class FakeLayerAnimationControllerClient : public cc::LayerAnimationControllerClient { public: FakeLayerAnimationControllerClient(); virtual ~FakeLayerAnimationControllerClient(); - // CCLayerAnimationControllerClient implementation + // LayerAnimationControllerClient implementation virtual int id() const OVERRIDE; virtual void setOpacityFromAnimation(float) OVERRIDE; virtual float opacity() const OVERRIDE; @@ -78,14 +78,14 @@ private: WebKit::WebTransformationMatrix m_transform; }; -void addOpacityTransitionToController(cc::CCLayerAnimationController&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); -void addAnimatedTransformToController(cc::CCLayerAnimationController&, double duration, int deltaX, int deltaY); +void addOpacityTransitionToController(cc::LayerAnimationController&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); +void addAnimatedTransformToController(cc::LayerAnimationController&, double duration, int deltaX, int deltaY); -void addOpacityTransitionToLayer(cc::LayerChromium&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); -void addOpacityTransitionToLayer(cc::CCLayerImpl&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); +void addOpacityTransitionToLayer(cc::Layer&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); +void addOpacityTransitionToLayer(cc::LayerImpl&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); -void addAnimatedTransformToLayer(cc::LayerChromium&, double duration, int deltaX, int deltaY); -void addAnimatedTransformToLayer(cc::CCLayerImpl&, double duration, int deltaX, int deltaY); +void addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int deltaY); +void addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, int deltaY); } // namespace WebKitTests diff --git a/cc/test/fake_graphics_context.h b/cc/test/fake_graphics_context.h index 276e978..aaeb964 100644 --- a/cc/test/fake_graphics_context.h +++ b/cc/test/fake_graphics_context.h @@ -12,9 +12,9 @@ namespace WebKit { -static inline scoped_ptr<cc::CCGraphicsContext> createFakeCCGraphicsContext() +static inline scoped_ptr<cc::GraphicsContext> createFakeGraphicsContext() { - return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::CCGraphicsContext>(); + return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::GraphicsContext>(); } } // namespace WebKit diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc index fecbb82..542f4bc 100644 --- a/cc/test/fake_layer_tree_host_client.cc +++ b/cc/test/fake_layer_tree_host_client.cc @@ -8,15 +8,15 @@ namespace cc { -scoped_ptr<WebKit::WebCompositorOutputSurface> FakeCCLayerTreeHostClient::createOutputSurface() +scoped_ptr<WebKit::WebCompositorOutputSurface> FakeLayerImplTreeHostClient::createOutputSurface() { WebKit::WebGraphicsContext3D::Attributes attrs; return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(attrs).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<WebKit::WebCompositorOutputSurface>(); } -scoped_ptr<CCInputHandler> FakeCCLayerTreeHostClient::createInputHandler() +scoped_ptr<InputHandler> FakeLayerImplTreeHostClient::createInputHandler() { - return scoped_ptr<CCInputHandler>(); + return scoped_ptr<InputHandler>(); } } diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h index e4e335f..328ec76 100644 --- a/cc/test/fake_layer_tree_host_client.h +++ b/cc/test/fake_layer_tree_host_client.h @@ -14,7 +14,7 @@ namespace cc { -class FakeCCLayerTreeHostClient : public CCLayerTreeHostClient { +class FakeLayerImplTreeHostClient : public LayerTreeHostClient { public: virtual void willBeginFrame() OVERRIDE { } virtual void didBeginFrame() OVERRIDE { } @@ -24,7 +24,7 @@ public: virtual scoped_ptr<WebKit::WebCompositorOutputSurface> createOutputSurface() OVERRIDE; virtual void didRecreateOutputSurface(bool success) OVERRIDE { } - virtual scoped_ptr<CCInputHandler> createInputHandler() OVERRIDE; + virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE; virtual void willCommit() OVERRIDE { } virtual void didCommit() OVERRIDE { } virtual void didCommitAndDrawFrame() OVERRIDE { } diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc index f7ef384..d264d79 100644 --- a/cc/test/layer_test_common.cc +++ b/cc/test/layer_test_common.cc @@ -9,17 +9,17 @@ #include "CCDrawQuad.h" #include "testing/gtest/include/gtest/gtest.h" -namespace CCLayerTestCommon { +namespace LayerTestCommon { // Align with expected and actual output const char* quadString = " Quad: "; -void verifyQuadsExactlyCoverRect(const cc::CCQuadList& quads, +void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, const cc::IntRect& rect) { cc::Region remaining(rect); for (size_t i = 0; i < quads.size(); ++i) { - cc::CCDrawQuad* quad = quads[i]; + cc::DrawQuad* quad = quads[i]; cc::IntRect quadRect = cc::IntRect(quad->quadRect()); EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; @@ -30,4 +30,4 @@ void verifyQuadsExactlyCoverRect(const cc::CCQuadList& quads, EXPECT_TRUE(remaining.isEmpty()); } -} // namespace CCLayerTestCommon +} // namespace LayerTestCommon diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h index f237608..d3ed729 100644 --- a/cc/test/layer_test_common.h +++ b/cc/test/layer_test_common.h @@ -9,11 +9,11 @@ #include "Region.h" #include "cc/render_pass.h" -namespace CCLayerTestCommon { +namespace LayerTestCommon { extern const char* quadString; -void verifyQuadsExactlyCoverRect(const cc::CCQuadList&, const cc::IntRect&); +void verifyQuadsExactlyCoverRect(const cc::QuadList&, const cc::IntRect&); -} // namespace CCLayerTestCommon +} // namespace LayerTestCommon #endif // CCLayerTestCommon_h diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc index c8b33a4..61c6e13 100644 --- a/cc/test/layer_tree_test_common.cc +++ b/cc/test/layer_tree_test_common.cc @@ -84,7 +84,7 @@ CompositorFakeWebGraphicsContext3DWithTextureTracking::~CompositorFakeWebGraphic { } -bool TestHooks::prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*) +bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*) { return true; } @@ -94,41 +94,41 @@ scoped_ptr<WebCompositorOutputSurface> TestHooks::createOutputSurface() return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3DWithTextureTracking::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<WebKit::WebCompositorOutputSurface>(); } -scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testHooks, const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client) +scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testHooks, const LayerTreeSettings& settings, LayerTreeHostImplClient* client) { return make_scoped_ptr(new MockLayerTreeHostImpl(testHooks, settings, client)); } void MockLayerTreeHostImpl::beginCommit() { - CCLayerTreeHostImpl::beginCommit(); - m_testHooks->beginCommitOnCCThread(this); + LayerTreeHostImpl::beginCommit(); + m_testHooks->beginCommitOnThread(this); } void MockLayerTreeHostImpl::commitComplete() { - CCLayerTreeHostImpl::commitComplete(); - m_testHooks->commitCompleteOnCCThread(this); + LayerTreeHostImpl::commitComplete(); + m_testHooks->commitCompleteOnThread(this); } bool MockLayerTreeHostImpl::prepareToDraw(FrameData& frame) { - bool result = CCLayerTreeHostImpl::prepareToDraw(frame); - if (!m_testHooks->prepareToDrawOnCCThread(this)) + bool result = LayerTreeHostImpl::prepareToDraw(frame); + if (!m_testHooks->prepareToDrawOnThread(this)) result = false; return result; } void MockLayerTreeHostImpl::drawLayers(const FrameData& frame) { - CCLayerTreeHostImpl::drawLayers(frame); - m_testHooks->drawLayersOnCCThread(this); + LayerTreeHostImpl::drawLayers(frame); + m_testHooks->drawLayersOnThread(this); } void MockLayerTreeHostImpl::animateLayers(double monotonicTime, double wallClockTime) { m_testHooks->willAnimateLayers(this, monotonicTime); - CCLayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); + LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); m_testHooks->animateLayers(this, monotonicTime); } @@ -137,16 +137,16 @@ base::TimeDelta MockLayerTreeHostImpl::lowFrequencyAnimationInterval() const return base::TimeDelta::FromMilliseconds(16); } -MockLayerTreeHostImpl::MockLayerTreeHostImpl(TestHooks* testHooks, const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client) - : CCLayerTreeHostImpl(settings, client) +MockLayerTreeHostImpl::MockLayerTreeHostImpl(TestHooks* testHooks, const LayerTreeSettings& settings, LayerTreeHostImplClient* client) + : LayerTreeHostImpl(settings, client) , m_testHooks(testHooks) { } -// Adapts CCLayerTreeHost for test. Injects MockLayerTreeHostImpl. -class MockLayerTreeHost : public cc::CCLayerTreeHost { +// Adapts LayerTreeHost for test. Injects MockLayerTreeHostImpl. +class MockLayerTreeHost : public cc::LayerTreeHost { public: - static scoped_ptr<MockLayerTreeHost> create(TestHooks* testHooks, cc::CCLayerTreeHostClient* client, scoped_refptr<cc::LayerChromium> rootLayer, const cc::CCLayerTreeSettings& settings) + static scoped_ptr<MockLayerTreeHost> create(TestHooks* testHooks, cc::LayerTreeHostClient* client, scoped_refptr<cc::Layer> rootLayer, const cc::LayerTreeSettings& settings) { scoped_ptr<MockLayerTreeHost> layerTreeHost(new MockLayerTreeHost(testHooks, client, settings)); bool success = layerTreeHost->initialize(); @@ -161,14 +161,14 @@ public: return layerTreeHost.Pass(); } - virtual scoped_ptr<cc::CCLayerTreeHostImpl> createLayerTreeHostImpl(cc::CCLayerTreeHostImplClient* client) + virtual scoped_ptr<cc::LayerTreeHostImpl> createLayerTreeHostImpl(cc::LayerTreeHostImplClient* client) { - return MockLayerTreeHostImpl::create(m_testHooks, settings(), client).PassAs<cc::CCLayerTreeHostImpl>(); + return MockLayerTreeHostImpl::create(m_testHooks, settings(), client).PassAs<cc::LayerTreeHostImpl>(); } virtual void didAddAnimation() OVERRIDE { - CCLayerTreeHost::didAddAnimation(); + LayerTreeHost::didAddAnimation(); m_testHooks->didAddAnimation(); } @@ -176,14 +176,14 @@ public: { if (!m_testStarted) return; - CCLayerTreeHost::setNeedsCommit(); + LayerTreeHost::setNeedsCommit(); } void setTestStarted(bool started) { m_testStarted = started; } private: - MockLayerTreeHost(TestHooks* testHooks, cc::CCLayerTreeHostClient* client, const cc::CCLayerTreeSettings& settings) - : CCLayerTreeHost(client, settings) + MockLayerTreeHost(TestHooks* testHooks, cc::LayerTreeHostClient* client, const cc::LayerTreeSettings& settings) + : LayerTreeHost(client, settings) , m_testHooks(testHooks) , m_testStarted(false) { @@ -193,12 +193,12 @@ private: bool m_testStarted; }; -// Implementation of CCLayerTreeHost callback interface. -class MockLayerTreeHostClient : public MockCCLayerTreeHostClient { +// Implementation of LayerTreeHost callback interface. +class ThreadedMockLayerTreeHostClient : public MockLayerImplTreeHostClient { public: - static scoped_ptr<MockLayerTreeHostClient> create(TestHooks* testHooks) + static scoped_ptr<ThreadedMockLayerTreeHostClient> create(TestHooks* testHooks) { - return make_scoped_ptr(new MockLayerTreeHostClient(testHooks)); + return make_scoped_ptr(new ThreadedMockLayerTreeHostClient(testHooks)); } virtual void willBeginFrame() OVERRIDE @@ -234,9 +234,9 @@ public: m_testHooks->didRecreateOutputSurface(succeeded); } - virtual scoped_ptr<CCInputHandler> createInputHandler() OVERRIDE + virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE { - return scoped_ptr<CCInputHandler>(); + return scoped_ptr<InputHandler>(); } virtual void willCommit() OVERRIDE @@ -263,14 +263,14 @@ public: } private: - explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { } + explicit ThreadedMockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { } TestHooks* m_testHooks; }; class TimeoutTask : public WebThread::Task { public: - explicit TimeoutTask(CCThreadedTest* test) + explicit TimeoutTask(ThreadedTest* test) : m_test(test) { } @@ -293,12 +293,12 @@ public: } private: - CCThreadedTest* m_test; + ThreadedTest* m_test; }; class BeginTask : public WebThread::Task { public: - explicit BeginTask(CCThreadedTest* test) + explicit BeginTask(ThreadedTest* test) : m_test(test) { } @@ -309,10 +309,10 @@ public: m_test->doBeginTest(); } private: - CCThreadedTest* m_test; + ThreadedTest* m_test; }; -CCThreadedTest::CCThreadedTest() +ThreadedTest::ThreadedTest() : m_beginning(false) , m_endWhenBeginReturns(false) , m_timedOut(false) @@ -322,11 +322,11 @@ CCThreadedTest::CCThreadedTest() { } -CCThreadedTest::~CCThreadedTest() +ThreadedTest::~ThreadedTest() { } -void CCThreadedTest::endTest() +void ThreadedTest::endTest() { m_finished = true; @@ -335,65 +335,65 @@ void CCThreadedTest::endTest() if (m_beginning) m_endWhenBeginReturns = true; else - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::realEndTest)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::realEndTest)); } -void CCThreadedTest::endTestAfterDelay(int delayMilliseconds) +void ThreadedTest::endTestAfterDelay(int delayMilliseconds) { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::endTest)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::endTest)); } -void CCThreadedTest::postSetNeedsAnimateToMainThread() +void ThreadedTest::postSetNeedsAnimateToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsAnimate)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsAnimate)); } -void CCThreadedTest::postAddAnimationToMainThread() +void ThreadedTest::postAddAnimationToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAddAnimation)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAddAnimation)); } -void CCThreadedTest::postAddInstantAnimationToMainThread() +void ThreadedTest::postAddInstantAnimationToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAddInstantAnimation)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAddInstantAnimation)); } -void CCThreadedTest::postSetNeedsCommitToMainThread() +void ThreadedTest::postSetNeedsCommitToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsCommit)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsCommit)); } -void CCThreadedTest::postAcquireLayerTextures() +void ThreadedTest::postAcquireLayerTextures() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAcquireLayerTextures)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAcquireLayerTextures)); } -void CCThreadedTest::postSetNeedsRedrawToMainThread() +void ThreadedTest::postSetNeedsRedrawToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsRedraw)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsRedraw)); } -void CCThreadedTest::postSetNeedsAnimateAndCommitToMainThread() +void ThreadedTest::postSetNeedsAnimateAndCommitToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsAnimateAndCommit)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsAnimateAndCommit)); } -void CCThreadedTest::postSetVisibleToMainThread(bool visible) +void ThreadedTest::postSetVisibleToMainThread(bool visible) { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetVisible, visible)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetVisible, visible)); } -void CCThreadedTest::postDidAddAnimationToMainThread() +void ThreadedTest::postDidAddAnimationToMainThread() { - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchDidAddAnimation)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchDidAddAnimation)); } -void CCThreadedTest::doBeginTest() +void ThreadedTest::doBeginTest() { - DCHECK(CCProxy::isMainThread()); - m_client = MockLayerTreeHostClient::create(this); + DCHECK(Proxy::isMainThread()); + m_client = ThreadedMockLayerTreeHostClient::create(this); - scoped_refptr<LayerChromium> rootLayer = LayerChromium::create(); + scoped_refptr<Layer> rootLayer = Layer::create(); m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings); ASSERT_TRUE(m_layerTreeHost.get()); rootLayer->setLayerTreeHost(m_layerTreeHost.get()); @@ -412,29 +412,29 @@ void CCThreadedTest::doBeginTest() static_cast<MockLayerTreeHost*>(m_layerTreeHost.get())->setTestStarted(true); } -void CCThreadedTest::timeout() +void ThreadedTest::timeout() { m_timedOut = true; endTest(); } -void CCThreadedTest::scheduleComposite() +void ThreadedTest::scheduleComposite() { if (!m_started || m_scheduled || m_finished) return; m_scheduled = true; - m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchComposite)); + m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchComposite)); } -void CCThreadedTest::realEndTest() +void ThreadedTest::realEndTest() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); WebKit::Platform::current()->currentThread()->exitRunLoop(); } -void CCThreadedTest::dispatchSetNeedsAnimate() +void ThreadedTest::dispatchSetNeedsAnimate() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -443,9 +443,9 @@ void CCThreadedTest::dispatchSetNeedsAnimate() m_layerTreeHost->setNeedsAnimate(); } -void CCThreadedTest::dispatchAddInstantAnimation() +void ThreadedTest::dispatchAddInstantAnimation() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -454,9 +454,9 @@ void CCThreadedTest::dispatchAddInstantAnimation() addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 0, 0, 0.5, false); } -void CCThreadedTest::dispatchAddAnimation() +void ThreadedTest::dispatchAddAnimation() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -465,9 +465,9 @@ void CCThreadedTest::dispatchAddAnimation() addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 10, 0, 0.5, true); } -void CCThreadedTest::dispatchSetNeedsAnimateAndCommit() +void ThreadedTest::dispatchSetNeedsAnimateAndCommit() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -478,9 +478,9 @@ void CCThreadedTest::dispatchSetNeedsAnimateAndCommit() } } -void CCThreadedTest::dispatchSetNeedsCommit() +void ThreadedTest::dispatchSetNeedsCommit() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -489,9 +489,9 @@ void CCThreadedTest::dispatchSetNeedsCommit() m_layerTreeHost->setNeedsCommit(); } -void CCThreadedTest::dispatchAcquireLayerTextures() +void ThreadedTest::dispatchAcquireLayerTextures() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -500,9 +500,9 @@ void CCThreadedTest::dispatchAcquireLayerTextures() m_layerTreeHost->acquireLayerTextures(); } -void CCThreadedTest::dispatchSetNeedsRedraw() +void ThreadedTest::dispatchSetNeedsRedraw() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -511,9 +511,9 @@ void CCThreadedTest::dispatchSetNeedsRedraw() m_layerTreeHost->setNeedsRedraw(); } -void CCThreadedTest::dispatchSetVisible(bool visible) +void ThreadedTest::dispatchSetVisible(bool visible) { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -522,16 +522,16 @@ void CCThreadedTest::dispatchSetVisible(bool visible) m_layerTreeHost->setVisible(visible); } -void CCThreadedTest::dispatchComposite() +void ThreadedTest::dispatchComposite() { m_scheduled = false; if (m_layerTreeHost.get() && !m_finished) m_layerTreeHost->composite(); } -void CCThreadedTest::dispatchDidAddAnimation() +void ThreadedTest::dispatchDidAddAnimation() { - DCHECK(CCProxy::isMainThread()); + DCHECK(Proxy::isMainThread()); if (m_finished) return; @@ -540,20 +540,20 @@ void CCThreadedTest::dispatchDidAddAnimation() m_layerTreeHost->didAddAnimation(); } -void CCThreadedTest::runTest(bool threaded) +void ThreadedTest::runTest(bool threaded) { // For these tests, we will enable threaded animations. - CCScopedSettings scopedSettings; + ScopedSettings scopedSettings; Settings::setAcceleratedAnimationEnabled(true); if (threaded) { - m_webThread.reset(WebKit::Platform::current()->createThread("CCThreadedTest")); + m_webThread.reset(WebKit::Platform::current()->createThread("ThreadedTest")); Platform::current()->compositorSupport()->initialize(m_webThread.get()); } else Platform::current()->compositorSupport()->initialize(0); - DCHECK(CCProxy::isMainThread()); - m_mainThreadProxy = CCScopedThreadProxy::create(CCProxy::mainThread()); + DCHECK(Proxy::isMainThread()); + m_mainThreadProxy = ScopedThreadProxy::create(Proxy::mainThread()); initializeSettings(m_settings); diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h index a15378f..65c1c22 100644 --- a/cc/test/layer_tree_test_common.h +++ b/cc/test/layer_tree_test_common.h @@ -15,10 +15,10 @@ #include <public/WebThread.h> namespace cc { -class CCLayerImpl; -class CCLayerTreeHost; -class CCLayerTreeHostClient; -class CCLayerTreeHostImpl; +class LayerImpl; +class LayerTreeHost; +class LayerTreeHostClient; +class LayerTreeHostImpl; } namespace WebKitTests { @@ -26,12 +26,12 @@ namespace WebKitTests { // Used by test stubs to notify the test when something interesting happens. class TestHooks : public WebKit::WebAnimationDelegate { public: - virtual void beginCommitOnCCThread(cc::CCLayerTreeHostImpl*) { } - virtual void commitCompleteOnCCThread(cc::CCLayerTreeHostImpl*) { } - virtual bool prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*); - virtual void drawLayersOnCCThread(cc::CCLayerTreeHostImpl*) { } - virtual void animateLayers(cc::CCLayerTreeHostImpl*, double monotonicTime) { } - virtual void willAnimateLayers(cc::CCLayerTreeHostImpl*, double monotonicTime) { } + virtual void beginCommitOnThread(cc::LayerTreeHostImpl*) { } + virtual void commitCompleteOnThread(cc::LayerTreeHostImpl*) { } + virtual bool prepareToDrawOnThread(cc::LayerTreeHostImpl*); + virtual void drawLayersOnThread(cc::LayerTreeHostImpl*) { } + virtual void animateLayers(cc::LayerTreeHostImpl*, double monotonicTime) { } + virtual void willAnimateLayers(cc::LayerTreeHostImpl*, double monotonicTime) { } virtual void applyScrollAndScale(const cc::IntSize&, float) { } virtual void animate(double monotonicTime) { } virtual void layout() { } @@ -51,22 +51,22 @@ public: class TimeoutTask; class BeginTask; -class MockCCLayerTreeHostClient : public cc::CCLayerTreeHostClient { +class MockLayerImplTreeHostClient : public cc::LayerTreeHostClient { }; -// The CCThreadedTests runs with the main loop running. It instantiates a single MockLayerTreeHost and associated -// MockLayerTreeHostImpl/MockLayerTreeHostClient. +// The ThreadedTests runs with the main loop running. It instantiates a single MockLayerTreeHost and associated +// MockLayerTreeHostImpl/ThreadedMockLayerTreeHostClient. // // beginTest() is called once the main message loop is running and the layer tree host is initialized. // -// Key stages of the drawing loop, e.g. drawing or commiting, redirect to CCThreadedTest methods of similar names. +// Key stages of the drawing loop, e.g. drawing or commiting, redirect to ThreadedTest methods of similar names. // To track the commit process, override these functions. // // The test continues until someone calls endTest. endTest can be called on any thread, but be aware that // ending the test is an asynchronous process. -class CCThreadedTest : public testing::Test, public TestHooks { +class ThreadedTest : public testing::Test, public TestHooks { public: - virtual ~CCThreadedTest(); + virtual ~ThreadedTest(); virtual void afterTest() = 0; virtual void beginTest() = 0; @@ -89,12 +89,12 @@ public: void clearTimeout() { m_timeoutTask = 0; } - cc::CCLayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } + cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } protected: - CCThreadedTest(); + ThreadedTest(); - virtual void initializeSettings(cc::CCLayerTreeSettings&) { } + virtual void initializeSettings(cc::LayerTreeSettings&) { } virtual void scheduleComposite() OVERRIDE; @@ -114,12 +114,12 @@ protected: virtual void runTest(bool threaded); WebKit::WebThread* webThread() const { return m_webThread.get(); } - cc::CCLayerTreeSettings m_settings; - scoped_ptr<MockCCLayerTreeHostClient> m_client; - scoped_ptr<cc::CCLayerTreeHost> m_layerTreeHost; + cc::LayerTreeSettings m_settings; + scoped_ptr<MockLayerImplTreeHostClient> m_client; + scoped_ptr<cc::LayerTreeHost> m_layerTreeHost; protected: - RefPtr<cc::CCScopedThreadProxy> m_mainThreadProxy; + RefPtr<cc::ScopedThreadProxy> m_mainThreadProxy; private: bool m_beginning; @@ -134,18 +134,18 @@ private: BeginTask* m_beginTask; }; -class CCThreadedTestThreadOnly : public CCThreadedTest { +class ThreadedTestThreadOnly : public ThreadedTest { public: void runTestThreaded() { - CCThreadedTest::runTest(true); + ThreadedTest::runTest(true); } }; -// Adapts CCLayerTreeHostImpl for test. Runs real code, then invokes test hooks. -class MockLayerTreeHostImpl : public cc::CCLayerTreeHostImpl { +// Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. +class MockLayerTreeHostImpl : public cc::LayerTreeHostImpl { public: - static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); + static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTreeHostImplClient*); virtual void beginCommit() OVERRIDE; virtual void commitComplete() OVERRIDE; @@ -153,15 +153,15 @@ public: virtual void drawLayers(const FrameData&) OVERRIDE; // Make these public. - typedef std::vector<cc::CCLayerImpl*> CCLayerList; - using CCLayerTreeHostImpl::calculateRenderSurfaceLayerList; + typedef std::vector<cc::LayerImpl*> LayerList; + using LayerTreeHostImpl::calculateRenderSurfaceLayerList; protected: virtual void animateLayers(double monotonicTime, double wallClockTime) OVERRIDE; virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; private: - MockLayerTreeHostImpl(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); + MockLayerTreeHostImpl(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTreeHostImplClient*); TestHooks* m_testHooks; }; diff --git a/cc/test/mock_quad_culler.cc b/cc/test/mock_quad_culler.cc index d1ceae7..36c4071 100644 --- a/cc/test/mock_quad_culler.cc +++ b/cc/test/mock_quad_culler.cc @@ -8,23 +8,23 @@ namespace cc { -MockCCQuadCuller::MockCCQuadCuller() +MockQuadCuller::MockQuadCuller() : m_activeQuadList(m_quadListStorage) , m_activeSharedQuadStateList(m_sharedQuadStateStorage) { } -MockCCQuadCuller::MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList) +MockQuadCuller::MockQuadCuller(QuadList& externalQuadList, SharedQuadStateList& externalSharedQuadStateList) : m_activeQuadList(externalQuadList) , m_activeSharedQuadStateList(externalSharedQuadStateList) { } -MockCCQuadCuller::~MockCCQuadCuller() +MockQuadCuller::~MockQuadCuller() { } -bool MockCCQuadCuller::append(scoped_ptr<CCDrawQuad> drawQuad, CCAppendQuadsData&) +bool MockQuadCuller::append(scoped_ptr<DrawQuad> drawQuad, AppendQuadsData&) { if (!drawQuad->quadRect().IsEmpty()) { m_activeQuadList.append(drawQuad.Pass()); @@ -33,11 +33,11 @@ bool MockCCQuadCuller::append(scoped_ptr<CCDrawQuad> drawQuad, CCAppendQuadsData return false; } -CCSharedQuadState* MockCCQuadCuller::useSharedQuadState(scoped_ptr<CCSharedQuadState> sharedQuadState) +SharedQuadState* MockQuadCuller::useSharedQuadState(scoped_ptr<SharedQuadState> sharedQuadState) { sharedQuadState->id = m_activeSharedQuadStateList.size(); - CCSharedQuadState* rawPtr = sharedQuadState.get(); + SharedQuadState* rawPtr = sharedQuadState.get(); m_activeSharedQuadStateList.append(sharedQuadState.Pass()); return rawPtr; } diff --git a/cc/test/mock_quad_culler.h b/cc/test/mock_quad_culler.h index 354ee2d..06b7687 100644 --- a/cc/test/mock_quad_culler.h +++ b/cc/test/mock_quad_culler.h @@ -13,25 +13,25 @@ namespace cc { -class MockCCQuadCuller : public CCQuadSink { +class MockQuadCuller : public QuadSink { public: - MockCCQuadCuller(); - virtual ~MockCCQuadCuller(); + MockQuadCuller(); + virtual ~MockQuadCuller(); - MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList); + MockQuadCuller(QuadList& externalQuadList, SharedQuadStateList& externalSharedQuadStateList); - virtual bool append(scoped_ptr<CCDrawQuad> newQuad, CCAppendQuadsData&) OVERRIDE; + virtual bool append(scoped_ptr<DrawQuad> newQuad, AppendQuadsData&) OVERRIDE; - virtual CCSharedQuadState* useSharedQuadState(scoped_ptr<CCSharedQuadState> passSharedQuadState) OVERRIDE; + virtual SharedQuadState* useSharedQuadState(scoped_ptr<SharedQuadState> passSharedQuadState) OVERRIDE; - const CCQuadList& quadList() const { return m_activeQuadList; }; - const CCSharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; + const QuadList& quadList() const { return m_activeQuadList; }; + const SharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; private: - CCQuadList& m_activeQuadList; - CCQuadList m_quadListStorage; - CCSharedQuadStateList& m_activeSharedQuadStateList; - CCSharedQuadStateList m_sharedQuadStateStorage; + QuadList& m_activeQuadList; + QuadList m_quadListStorage; + SharedQuadStateList& m_activeSharedQuadStateList; + SharedQuadStateList m_sharedQuadStateStorage; }; } // namespace cc diff --git a/cc/test/occlusion_tracker_test_common.h b/cc/test/occlusion_tracker_test_common.h index 33ba4f6..37694f5 100644 --- a/cc/test/occlusion_tracker_test_common.h +++ b/cc/test/occlusion_tracker_test_common.h @@ -15,22 +15,22 @@ namespace WebKitTests { // A subclass to expose the total current occlusion. template<typename LayerType, typename RenderSurfaceType> -class TestCCOcclusionTrackerBase : public cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType> { +class TestOcclusionTrackerBase : public cc::OcclusionTrackerBase<LayerType, RenderSurfaceType> { public: - TestCCOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetricsForFrame = false) - : cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissorRect, recordMetricsForFrame) + TestOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetricsForFrame = false) + : cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissorRect, recordMetricsForFrame) { } - cc::Region occlusionInScreenSpace() const { return cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen; } - cc::Region occlusionInTargetSurface() const { return cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget; } + cc::Region occlusionInScreenSpace() const { return cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen; } + cc::Region occlusionInTargetSurface() const { return cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget; } - void setOcclusionInScreenSpace(const cc::Region& region) { cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen = region; } - void setOcclusionInTargetSurface(const cc::Region& region) { cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget = region; } + void setOcclusionInScreenSpace(const cc::Region& region) { cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen = region; } + void setOcclusionInTargetSurface(const cc::Region& region) { cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget = region; } }; -typedef TestCCOcclusionTrackerBase<cc::LayerChromium, cc::RenderSurfaceChromium> TestCCOcclusionTracker; -typedef TestCCOcclusionTrackerBase<cc::CCLayerImpl, cc::CCRenderSurface> TestCCOcclusionTrackerImpl; +typedef TestOcclusionTrackerBase<cc::Layer, cc::RenderSurface> TestOcclusionTracker; +typedef TestOcclusionTrackerBase<cc::LayerImpl, cc::RenderSurfaceImpl> TestOcclusionTrackerImpl; } diff --git a/cc/test/render_pass_test_common.h b/cc/test/render_pass_test_common.h index cb04a5f..b9802ad 100644 --- a/cc/test/render_pass_test_common.h +++ b/cc/test/render_pass_test_common.h @@ -9,13 +9,13 @@ namespace WebKitTests { -class CCTestRenderPass : public cc::CCRenderPass { +class TestRenderPass : public cc::RenderPass { public: - cc::CCQuadList& quadList() { return m_quadList; } - cc::CCSharedQuadStateList& sharedQuadStateList() { return m_sharedQuadStateList; } + cc::QuadList& quadList() { return m_quadList; } + cc::SharedQuadStateList& sharedQuadStateList() { return m_sharedQuadStateList; } - void appendQuad(scoped_ptr<cc::CCDrawQuad> quad) { m_quadList.append(quad.Pass()); } - void appendSharedQuadState(scoped_ptr<cc::CCSharedQuadState> state) { m_sharedQuadStateList.append(state.Pass()); } + void appendQuad(scoped_ptr<cc::DrawQuad> quad) { m_quadList.append(quad.Pass()); } + void appendSharedQuadState(scoped_ptr<cc::SharedQuadState> state) { m_sharedQuadStateList.append(state.Pass()); } }; } // namespace WebKitTests diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc index e956b5d..b2bedd8 100644 --- a/cc/test/scheduler_test_common.cc +++ b/cc/test/scheduler_test_common.cc @@ -10,26 +10,26 @@ namespace WebKitTests { -void FakeCCTimeSourceClient::onTimerTick() +void FakeTimeSourceClient::onTimerTick() { m_tickCalled = true; } -FakeCCThread::FakeCCThread() +FakeThread::FakeThread() { reset(); } -FakeCCThread::~FakeCCThread() +FakeThread::~FakeThread() { } -void FakeCCThread::postTask(PassOwnPtr<Task>) +void FakeThread::postTask(PassOwnPtr<Task>) { NOTREACHED(); } -void FakeCCThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) +void FakeThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) { if (m_runPendingTaskOnOverwrite && hasPendingTask()) runPendingTask(); @@ -39,37 +39,37 @@ void FakeCCThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) m_pendingTaskDelay = delay; } -base::PlatformThreadId FakeCCThread::threadID() const +base::PlatformThreadId FakeThread::threadID() const { return 0; } -void FakeCCTimeSource::setClient(cc::CCTimeSourceClient* client) +void FakeTimeSource::setClient(cc::TimeSourceClient* client) { m_client = client; } -void FakeCCTimeSource::setActive(bool b) +void FakeTimeSource::setActive(bool b) { m_active = b; } -bool FakeCCTimeSource::active() const +bool FakeTimeSource::active() const { return m_active; } -base::TimeTicks FakeCCTimeSource::lastTickTime() +base::TimeTicks FakeTimeSource::lastTickTime() { return base::TimeTicks(); } -base::TimeTicks FakeCCTimeSource::nextTickTime() +base::TimeTicks FakeTimeSource::nextTickTime() { return base::TimeTicks(); } -base::TimeTicks FakeCCDelayBasedTimeSource::now() const +base::TimeTicks FakeDelayBasedTimeSource::now() const { return m_now; } diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h index 2626d44..9a16c35 100644 --- a/cc/test/scheduler_test_common.h +++ b/cc/test/scheduler_test_common.h @@ -14,9 +14,9 @@ namespace WebKitTests { -class FakeCCTimeSourceClient : public cc::CCTimeSourceClient { +class FakeTimeSourceClient : public cc::TimeSourceClient { public: - FakeCCTimeSourceClient() { reset(); } + FakeTimeSourceClient() { reset(); } void reset() { m_tickCalled = false; } bool tickCalled() const { return m_tickCalled; } @@ -26,10 +26,10 @@ protected: bool m_tickCalled; }; -class FakeCCThread : public cc::CCThread { +class FakeThread : public cc::Thread { public: - FakeCCThread(); - virtual ~FakeCCThread(); + FakeThread(); + virtual ~FakeThread(); void reset() { @@ -67,15 +67,15 @@ protected: bool m_runPendingTaskOnOverwrite; }; -class FakeCCTimeSource : public cc::CCTimeSource { +class FakeTimeSource : public cc::TimeSource { public: - FakeCCTimeSource() + FakeTimeSource() : m_active(false) , m_client(0) { } - virtual void setClient(cc::CCTimeSourceClient* client) OVERRIDE; + virtual void setClient(cc::TimeSourceClient* client) OVERRIDE; virtual void setActive(bool b) OVERRIDE; virtual bool active() const OVERRIDE; virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE { } @@ -92,36 +92,36 @@ public: void setNextTickTime(base::TimeTicks nextTickTime) { m_nextTickTime = nextTickTime; } protected: - virtual ~FakeCCTimeSource() { } + virtual ~FakeTimeSource() { } bool m_active; base::TimeTicks m_nextTickTime; - cc::CCTimeSourceClient* m_client; + cc::TimeSourceClient* m_client; }; -class FakeCCDelayBasedTimeSource : public cc::CCDelayBasedTimeSource { +class FakeDelayBasedTimeSource : public cc::DelayBasedTimeSource { public: - static scoped_refptr<FakeCCDelayBasedTimeSource> create(base::TimeDelta interval, cc::CCThread* thread) + static scoped_refptr<FakeDelayBasedTimeSource> create(base::TimeDelta interval, cc::Thread* thread) { - return make_scoped_refptr(new FakeCCDelayBasedTimeSource(interval, thread)); + return make_scoped_refptr(new FakeDelayBasedTimeSource(interval, thread)); } void setNow(base::TimeTicks time) { m_now = time; } virtual base::TimeTicks now() const OVERRIDE; protected: - FakeCCDelayBasedTimeSource(base::TimeDelta interval, cc::CCThread* thread) - : CCDelayBasedTimeSource(interval, thread) + FakeDelayBasedTimeSource(base::TimeDelta interval, cc::Thread* thread) + : DelayBasedTimeSource(interval, thread) { } - virtual ~FakeCCDelayBasedTimeSource() { } + virtual ~FakeDelayBasedTimeSource() { } base::TimeTicks m_now; }; -class FakeCCFrameRateController : public cc::CCFrameRateController { +class FakeFrameRateController : public cc::FrameRateController { public: - FakeCCFrameRateController(scoped_refptr<cc::CCTimeSource> timer) : cc::CCFrameRateController(timer) { } + FakeFrameRateController(scoped_refptr<cc::TimeSource> timer) : cc::FrameRateController(timer) { } int numFramesPending() const { return m_numFramesPending; } }; diff --git a/cc/test/test_common.h b/cc/test/test_common.h index 572a5c9..9c6c0ce 100644 --- a/cc/test/test_common.h +++ b/cc/test/test_common.h @@ -11,10 +11,10 @@ namespace WebKitTests { // If you have a test that modifies or uses global settings, keep an instance // of this class to ensure that you start and end with a clean slate. -class CCScopedSettings { +class ScopedSettings { public: - CCScopedSettings() { cc::Settings::resetForTest(); } - ~CCScopedSettings() { cc::Settings::resetForTest(); } + ScopedSettings() { cc::Settings::resetForTest(); } + ~ScopedSettings() { cc::Settings::resetForTest(); } }; } // namespace WebKitTests diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc index d4dc65a..ad9ef2e 100644 --- a/cc/test/tiled_layer_test_common.cc +++ b/cc/test/tiled_layer_test_common.cc @@ -10,7 +10,7 @@ using namespace cc; namespace WebKitTests { -FakeLayerTextureUpdater::Texture::Texture(FakeLayerTextureUpdater* layer, scoped_ptr<CCPrioritizedTexture> texture) +FakeLayerTextureUpdater::Texture::Texture(FakeLayerTextureUpdater* layer, scoped_ptr<PrioritizedTexture> texture) : LayerTextureUpdater::Texture(texture.Pass()) , m_layer(layer) { @@ -22,7 +22,7 @@ FakeLayerTextureUpdater::Texture::~Texture() { } -void FakeLayerTextureUpdater::Texture::update(CCTextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, CCRenderingStats&) +void FakeLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, RenderingStats&) { const IntRect rect(0, 0, 10, 10); ResourceUpdate upload = ResourceUpdate::Create( @@ -45,7 +45,7 @@ FakeLayerTextureUpdater::~FakeLayerTextureUpdater() { } -void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, CCRenderingStats&) +void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, RenderingStats&) { m_prepareCount++; m_lastUpdateRect = contentRect; @@ -57,39 +57,39 @@ void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const resultingOpaqueRect = m_opaquePaintRect; } -void FakeLayerTextureUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayerChromium* layer) +void FakeLayerTextureUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayer* layer) { m_rectToInvalidate = rect; m_layer = layer; } -scoped_ptr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(CCPrioritizedTextureManager* manager) +scoped_ptr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager) { - return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, CCPrioritizedTexture::create(manager))); + return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager))); } -FakeCCTiledLayerImpl::FakeCCTiledLayerImpl(int id) - : CCTiledLayerImpl(id) +FakeTiledLayerImpl::FakeTiledLayerImpl(int id) + : TiledLayerImpl(id) { } -FakeCCTiledLayerImpl::~FakeCCTiledLayerImpl() +FakeTiledLayerImpl::~FakeTiledLayerImpl() { } -FakeTiledLayerChromium::FakeTiledLayerChromium(CCPrioritizedTextureManager* textureManager) - : TiledLayerChromium() +FakeTiledLayer::FakeTiledLayer(PrioritizedTextureManager* textureManager) + : TiledLayer() , m_fakeTextureUpdater(make_scoped_refptr(new FakeLayerTextureUpdater)) , m_textureManager(textureManager) { setTileSize(tileSize()); setTextureFormat(GL_RGBA); - setBorderTexelOption(CCLayerTilingData::NoBorderTexels); + setBorderTexelOption(LayerTilingData::NoBorderTexels); setIsDrawable(true); // So that we don't get false positives if any of these tests expect to return false from drawsContent() for other reasons. } -FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedTextureManager* textureManager) - : FakeTiledLayerChromium(textureManager) +FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(PrioritizedTextureManager* textureManager) + : FakeTiledLayer(textureManager) { } @@ -97,17 +97,17 @@ FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() { } -FakeTiledLayerChromium::~FakeTiledLayerChromium() +FakeTiledLayer::~FakeTiledLayer() { } -void FakeTiledLayerChromium::setNeedsDisplayRect(const FloatRect& rect) +void FakeTiledLayer::setNeedsDisplayRect(const FloatRect& rect) { m_lastNeedsDisplayRect = rect; - TiledLayerChromium::setNeedsDisplayRect(rect); + TiledLayer::setNeedsDisplayRect(rect); } -void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& calculator) +void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) { // Ensure there is always a target render surface available. If none has been // set (the layer is an orphan for the test), then just set a surface on itself. @@ -116,7 +116,7 @@ void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& ca if (missingTargetRenderSurface) createRenderSurface(); - TiledLayerChromium::setTexturePriorities(calculator); + TiledLayer::setTexturePriorities(calculator); if (missingTargetRenderSurface) { clearRenderSurface(); @@ -124,12 +124,12 @@ void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& ca } } -cc::CCPrioritizedTextureManager* FakeTiledLayerChromium::textureManager() const +cc::PrioritizedTextureManager* FakeTiledLayer::textureManager() const { return m_textureManager; } -cc::LayerTextureUpdater* FakeTiledLayerChromium::textureUpdater() const +cc::LayerTextureUpdater* FakeTiledLayer::textureUpdater() const { return m_fakeTextureUpdater.get(); } diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h index b8d7a5c..be52ca1 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -20,16 +20,16 @@ namespace WebKitTests { -class FakeTiledLayerChromium; +class FakeTiledLayer; class FakeLayerTextureUpdater : public cc::LayerTextureUpdater { public: class Texture : public cc::LayerTextureUpdater::Texture { public: - Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::CCPrioritizedTexture>); + Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::PrioritizedTexture>); virtual ~Texture(); - virtual void update(cc::CCTextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::CCRenderingStats&) OVERRIDE; + virtual void update(cc::TextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::RenderingStats&) OVERRIDE; private: FakeLayerTextureUpdater* m_layer; @@ -38,12 +38,12 @@ public: FakeLayerTextureUpdater(); - virtual scoped_ptr<cc::LayerTextureUpdater::Texture> createTexture(cc::CCPrioritizedTextureManager*) OVERRIDE; + virtual scoped_ptr<cc::LayerTextureUpdater::Texture> createTexture(cc::PrioritizedTextureManager*) OVERRIDE; - virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSize&, float, float, cc::IntRect& resultingOpaqueRect, cc::CCRenderingStats&) OVERRIDE; + virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSize&, float, float, cc::IntRect& resultingOpaqueRect, cc::RenderingStats&) OVERRIDE; // Sets the rect to invalidate during the next call to prepareToUpdate(). After the next // call to prepareToUpdate() the rect is reset. - void setRectToInvalidate(const cc::IntRect&, FakeTiledLayerChromium*); + void setRectToInvalidate(const cc::IntRect&, FakeTiledLayer*); // Last rect passed to prepareToUpdate(). const cc::IntRect& lastUpdateRect() const { return m_lastUpdateRect; } @@ -67,53 +67,53 @@ private: cc::IntRect m_rectToInvalidate; cc::IntRect m_lastUpdateRect; cc::IntRect m_opaquePaintRect; - scoped_refptr<FakeTiledLayerChromium> m_layer; + scoped_refptr<FakeTiledLayer> m_layer; }; -class FakeCCTiledLayerImpl : public cc::CCTiledLayerImpl { +class FakeTiledLayerImpl : public cc::TiledLayerImpl { public: - explicit FakeCCTiledLayerImpl(int id); - virtual ~FakeCCTiledLayerImpl(); + explicit FakeTiledLayerImpl(int id); + virtual ~FakeTiledLayerImpl(); - using cc::CCTiledLayerImpl::hasTileAt; - using cc::CCTiledLayerImpl::hasResourceIdForTileAt; + using cc::TiledLayerImpl::hasTileAt; + using cc::TiledLayerImpl::hasResourceIdForTileAt; }; -class FakeTiledLayerChromium : public cc::TiledLayerChromium { +class FakeTiledLayer : public cc::TiledLayer { public: - explicit FakeTiledLayerChromium(cc::CCPrioritizedTextureManager*); + explicit FakeTiledLayer(cc::PrioritizedTextureManager*); static cc::IntSize tileSize() { return cc::IntSize(100, 100); } - using cc::TiledLayerChromium::invalidateContentRect; - using cc::TiledLayerChromium::needsIdlePaint; - using cc::TiledLayerChromium::skipsDraw; - using cc::TiledLayerChromium::numPaintedTiles; - using cc::TiledLayerChromium::idlePaintRect; + using cc::TiledLayer::invalidateContentRect; + using cc::TiledLayer::needsIdlePaint; + using cc::TiledLayer::skipsDraw; + using cc::TiledLayer::numPaintedTiles; + using cc::TiledLayer::idlePaintRect; virtual void setNeedsDisplayRect(const cc::FloatRect&) OVERRIDE; const cc::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; } - virtual void setTexturePriorities(const cc::CCPriorityCalculator&) OVERRIDE; + virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE; - virtual cc::CCPrioritizedTextureManager* textureManager() const OVERRIDE; + virtual cc::PrioritizedTextureManager* textureManager() const OVERRIDE; FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpdater.get(); } cc::FloatRect updateRect() { return m_updateRect; } protected: virtual cc::LayerTextureUpdater* textureUpdater() const OVERRIDE; virtual void createTextureUpdaterIfNeeded() OVERRIDE { } - virtual ~FakeTiledLayerChromium(); + virtual ~FakeTiledLayer(); private: scoped_refptr<FakeLayerTextureUpdater> m_fakeTextureUpdater; - cc::CCPrioritizedTextureManager* m_textureManager; + cc::PrioritizedTextureManager* m_textureManager; cc::FloatRect m_lastNeedsDisplayRect; }; -class FakeTiledLayerWithScaledBounds : public FakeTiledLayerChromium { +class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { public: - explicit FakeTiledLayerWithScaledBounds(cc::CCPrioritizedTextureManager*); + explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedTextureManager*); void setContentBounds(const cc::IntSize& contentBounds) { m_forcedContentBounds = contentBounds; } virtual cc::IntSize contentBounds() const OVERRIDE; |