diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 21:22:42 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-19 21:22:42 +0000 |
commit | c753e25a8b4366c44134a8c21b9ed3392bf48608 (patch) | |
tree | f378c8a762caccf60856a1670ae33dfd638b9453 /cc/test | |
parent | 503160f80568f024fa712e280bb1a4e1e6ca1ec3 (diff) | |
download | chromium_src-c753e25a8b4366c44134a8c21b9ed3392bf48608.zip chromium_src-c753e25a8b4366c44134a8c21b9ed3392bf48608.tar.gz chromium_src-c753e25a8b4366c44134a8c21b9ed3392bf48608.tar.bz2 |
Revert "cc: Rename cc classes and members to match filenames"
This reverts commit 184fac5add06d5f4670fa6be4a4d3b39232d51bb.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163059 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 | 178 | ||||
-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, 283 insertions, 283 deletions
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc index 0cfb794..7ceaf3f 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<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create()); + scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create()); - scoped_ptr<TimingFunction> func; + scoped_ptr<CCTimingFunction> func; if (!useTimingFunction) - func = EaseTimingFunction::create(); + func = CCEaseTimingFunction::create(); if (duration > 0) - curve->addKeyframe(FloatKeyframe::create(0, startOpacity, func.Pass())); - curve->addKeyframe(FloatKeyframe::create(duration, endOpacity, scoped_ptr<cc::TimingFunction>())); + curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, func.Pass())); + curve->addKeyframe(CCFloatKeyframe::create(duration, endOpacity, scoped_ptr<cc::CCTimingFunction>())); - scoped_ptr<ActiveAnimation> animation(ActiveAnimation::create(curve.PassAs<AnimationCurve>(), 0, 0, ActiveAnimation::Opacity)); + scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), 0, 0, CCActiveAnimation::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<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create()); + scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create()); if (duration > 0) { WebKit::WebTransformOperations startOperations; startOperations.appendTranslate(deltaX, deltaY, 0); - curve->addKeyframe(TransformKeyframe::create(0, startOperations, scoped_ptr<cc::TimingFunction>())); + curve->addKeyframe(CCTransformKeyframe::create(0, startOperations, scoped_ptr<cc::CCTimingFunction>())); } WebKit::WebTransformOperations operations; operations.appendTranslate(deltaX, deltaY, 0); - curve->addKeyframe(TransformKeyframe::create(duration, operations, scoped_ptr<cc::TimingFunction>())); + curve->addKeyframe(CCTransformKeyframe::create(duration, operations, scoped_ptr<cc::CCTimingFunction>())); - scoped_ptr<ActiveAnimation> animation(ActiveAnimation::create(curve.PassAs<AnimationCurve>(), id++, 0, ActiveAnimation::Transform)); + scoped_ptr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.PassAs<CCAnimationCurve>(), id++, 0, CCActiveAnimation::Transform)); animation->setNeedsSynchronizedStartTime(true); target.addAnimation(animation.Pass()); @@ -84,9 +84,9 @@ float FakeFloatAnimationCurve::getValue(double now) const return 0; } -scoped_ptr<cc::AnimationCurve> FakeFloatAnimationCurve::clone() const +scoped_ptr<cc::CCAnimationCurve> FakeFloatAnimationCurve::clone() const { - return make_scoped_ptr(new FakeFloatAnimationCurve).PassAs<cc::AnimationCurve>(); + return make_scoped_ptr(new FakeFloatAnimationCurve).PassAs<cc::CCAnimationCurve>(); } FakeTransformTransition::FakeTransformTransition(double duration) @@ -108,9 +108,9 @@ WebKit::WebTransformationMatrix FakeTransformTransition::getValue(double time) c return WebKit::WebTransformationMatrix(); } -scoped_ptr<cc::AnimationCurve> FakeTransformTransition::clone() const +scoped_ptr<cc::CCAnimationCurve> FakeTransformTransition::clone() const { - return make_scoped_ptr(new FakeTransformTransition(*this)).PassAs<cc::AnimationCurve>(); + return make_scoped_ptr(new FakeTransformTransition(*this)).PassAs<cc::CCAnimationCurve>(); } @@ -172,37 +172,37 @@ const WebKit::WebTransformationMatrix& FakeLayerAnimationControllerClient::trans return m_transform; } -scoped_ptr<cc::AnimationCurve> FakeFloatTransition::clone() const +scoped_ptr<cc::CCAnimationCurve> FakeFloatTransition::clone() const { - return make_scoped_ptr(new FakeFloatTransition(*this)).PassAs<cc::AnimationCurve>(); + return make_scoped_ptr(new FakeFloatTransition(*this)).PassAs<cc::CCAnimationCurve>(); } -void addOpacityTransitionToController(cc::LayerAnimationController& controller, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToController(cc::CCLayerAnimationController& controller, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(controller, duration, startOpacity, endOpacity, useTimingFunction); } -void addAnimatedTransformToController(cc::LayerAnimationController& controller, double duration, int deltaX, int deltaY) +void addAnimatedTransformToController(cc::CCLayerAnimationController& controller, double duration, int deltaX, int deltaY) { addAnimatedTransform(controller, duration, deltaX, deltaY); } -void addOpacityTransitionToLayer(cc::Layer& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToLayer(cc::LayerChromium& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(layer, duration, startOpacity, endOpacity, useTimingFunction); } -void addOpacityTransitionToLayer(cc::LayerImpl& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) +void addOpacityTransitionToLayer(cc::CCLayerImpl& layer, double duration, float startOpacity, float endOpacity, bool useTimingFunction) { addOpacityTransition(*layer.layerAnimationController(), duration, startOpacity, endOpacity, useTimingFunction); } -void addAnimatedTransformToLayer(cc::Layer& layer, double duration, int deltaX, int deltaY) +void addAnimatedTransformToLayer(cc::LayerChromium& layer, double duration, int deltaX, int deltaY) { addAnimatedTransform(layer, duration, deltaX, deltaY); } -void addAnimatedTransformToLayer(cc::LayerImpl& layer, double duration, int deltaX, int deltaY) +void addAnimatedTransformToLayer(cc::CCLayerImpl& 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 8c00efb..a768930 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 LayerImpl; -class Layer; +class CCLayerImpl; +class LayerChromium; } namespace WebKitTests { -class FakeFloatAnimationCurve : public cc::FloatAnimationCurve { +class FakeFloatAnimationCurve : public cc::CCFloatAnimationCurve { 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::AnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; private: double m_duration; }; -class FakeTransformTransition : public cc::TransformAnimationCurve { +class FakeTransformTransition : public cc::CCTransformAnimationCurve { 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::AnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; private: double m_duration; }; -class FakeFloatTransition : public cc::FloatAnimationCurve { +class FakeFloatTransition : public cc::CCFloatAnimationCurve { 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::AnimationCurve> clone() const OVERRIDE; + virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE; private: double m_duration; @@ -61,12 +61,12 @@ private: float m_to; }; -class FakeLayerAnimationControllerClient : public cc::LayerAnimationControllerClient { +class FakeLayerAnimationControllerClient : public cc::CCLayerAnimationControllerClient { public: FakeLayerAnimationControllerClient(); virtual ~FakeLayerAnimationControllerClient(); - // LayerAnimationControllerClient implementation + // CCLayerAnimationControllerClient 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::LayerAnimationController&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); -void addAnimatedTransformToController(cc::LayerAnimationController&, double duration, int deltaX, int deltaY); +void addOpacityTransitionToController(cc::CCLayerAnimationController&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); +void addAnimatedTransformToController(cc::CCLayerAnimationController&, double duration, int deltaX, int deltaY); -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 addOpacityTransitionToLayer(cc::LayerChromium&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); +void addOpacityTransitionToLayer(cc::CCLayerImpl&, double duration, float startOpacity, float endOpacity, bool useTimingFunction); -void addAnimatedTransformToLayer(cc::Layer&, double duration, int deltaX, int deltaY); -void addAnimatedTransformToLayer(cc::LayerImpl&, double duration, int deltaX, int deltaY); +void addAnimatedTransformToLayer(cc::LayerChromium&, double duration, int deltaX, int deltaY); +void addAnimatedTransformToLayer(cc::CCLayerImpl&, 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 aaeb964..276e978 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::GraphicsContext> createFakeGraphicsContext() +static inline scoped_ptr<cc::CCGraphicsContext> createFakeCCGraphicsContext() { - return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::GraphicsContext>(); + return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::CCGraphicsContext>(); } } // namespace WebKit diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc index 542f4bc..fecbb82 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> FakeLayerImplTreeHostClient::createOutputSurface() +scoped_ptr<WebKit::WebCompositorOutputSurface> FakeCCLayerTreeHostClient::createOutputSurface() { WebKit::WebGraphicsContext3D::Attributes attrs; return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(attrs).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<WebKit::WebCompositorOutputSurface>(); } -scoped_ptr<InputHandler> FakeLayerImplTreeHostClient::createInputHandler() +scoped_ptr<CCInputHandler> FakeCCLayerTreeHostClient::createInputHandler() { - return scoped_ptr<InputHandler>(); + return scoped_ptr<CCInputHandler>(); } } diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h index 328ec76..e4e335f 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 FakeLayerImplTreeHostClient : public LayerTreeHostClient { +class FakeCCLayerTreeHostClient : public CCLayerTreeHostClient { 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<InputHandler> createInputHandler() OVERRIDE; + virtual scoped_ptr<CCInputHandler> 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 30037b6..fda251c 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 LayerTestCommon { +namespace CCLayerTestCommon { // Align with expected and actual output const char* quadString = " Quad: "; -void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, +void verifyQuadsExactlyCoverRect(const cc::CCQuadList& quads, const cc::IntRect& rect) { cc::Region remaining(rect); for (size_t i = 0; i < quads.size(); ++i) { - cc::DrawQuad* quad = quads[i]; + cc::CCDrawQuad* quad = quads[i]; cc::IntRect quadRect = quad->quadRect(); EXPECT_TRUE(rect.contains(quadRect)) << quadString << i; @@ -30,4 +30,4 @@ void verifyQuadsExactlyCoverRect(const cc::QuadList& quads, EXPECT_TRUE(remaining.isEmpty()); } -} // namespace LayerTestCommon +} // namespace CCLayerTestCommon diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h index b67ca8f..9627ba1 100644 --- a/cc/test/layer_test_common.h +++ b/cc/test/layer_test_common.h @@ -9,11 +9,11 @@ #include "IntRect.h" #include "Region.h" -namespace LayerTestCommon { +namespace CCLayerTestCommon { extern const char* quadString; -void verifyQuadsExactlyCoverRect(const cc::QuadList&, const cc::IntRect&); +void verifyQuadsExactlyCoverRect(const cc::CCQuadList&, const cc::IntRect&); -} // namespace LayerTestCommon +} // namespace CCLayerTestCommon #endif // CCLayerTestCommon_h diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc index f86fe36..a151b4e 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::prepareToDrawOnThread(cc::LayerTreeHostImpl*) +bool TestHooks::prepareToDrawOnCCThread(cc::CCLayerTreeHostImpl*) { 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 LayerTreeSettings& settings, LayerTreeHostImplClient* client) +scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testHooks, const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client) { return make_scoped_ptr(new MockLayerTreeHostImpl(testHooks, settings, client)); } void MockLayerTreeHostImpl::beginCommit() { - LayerTreeHostImpl::beginCommit(); - m_testHooks->beginCommitOnThread(this); + CCLayerTreeHostImpl::beginCommit(); + m_testHooks->beginCommitOnCCThread(this); } void MockLayerTreeHostImpl::commitComplete() { - LayerTreeHostImpl::commitComplete(); - m_testHooks->commitCompleteOnThread(this); + CCLayerTreeHostImpl::commitComplete(); + m_testHooks->commitCompleteOnCCThread(this); } bool MockLayerTreeHostImpl::prepareToDraw(FrameData& frame) { - bool result = LayerTreeHostImpl::prepareToDraw(frame); - if (!m_testHooks->prepareToDrawOnThread(this)) + bool result = CCLayerTreeHostImpl::prepareToDraw(frame); + if (!m_testHooks->prepareToDrawOnCCThread(this)) result = false; return result; } void MockLayerTreeHostImpl::drawLayers(const FrameData& frame) { - LayerTreeHostImpl::drawLayers(frame); - m_testHooks->drawLayersOnThread(this); + CCLayerTreeHostImpl::drawLayers(frame); + m_testHooks->drawLayersOnCCThread(this); } void MockLayerTreeHostImpl::animateLayers(double monotonicTime, double wallClockTime) { m_testHooks->willAnimateLayers(this, monotonicTime); - LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); + CCLayerTreeHostImpl::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 LayerTreeSettings& settings, LayerTreeHostImplClient* client) - : LayerTreeHostImpl(settings, client) +MockLayerTreeHostImpl::MockLayerTreeHostImpl(TestHooks* testHooks, const CCLayerTreeSettings& settings, CCLayerTreeHostImplClient* client) + : CCLayerTreeHostImpl(settings, client) , m_testHooks(testHooks) { } -// Adapts LayerTreeHost for test. Injects MockLayerTreeHostImpl. -class MockLayerTreeHost : public cc::LayerTreeHost { +// Adapts CCLayerTreeHost for test. Injects MockLayerTreeHostImpl. +class MockLayerTreeHost : public cc::CCLayerTreeHost { public: - static scoped_ptr<MockLayerTreeHost> create(TestHooks* testHooks, cc::LayerTreeHostClient* client, scoped_refptr<cc::Layer> rootLayer, const cc::LayerTreeSettings& settings) + static scoped_ptr<MockLayerTreeHost> create(TestHooks* testHooks, cc::CCLayerTreeHostClient* client, scoped_refptr<cc::LayerChromium> rootLayer, const cc::CCLayerTreeSettings& settings) { scoped_ptr<MockLayerTreeHost> layerTreeHost(new MockLayerTreeHost(testHooks, client, settings)); bool success = layerTreeHost->initialize(); @@ -161,20 +161,20 @@ public: return layerTreeHost.Pass(); } - virtual scoped_ptr<cc::LayerTreeHostImpl> createLayerTreeHostImpl(cc::LayerTreeHostImplClient* client) + virtual scoped_ptr<cc::CCLayerTreeHostImpl> createLayerTreeHostImpl(cc::CCLayerTreeHostImplClient* client) { - return MockLayerTreeHostImpl::create(m_testHooks, settings(), client).PassAs<cc::LayerTreeHostImpl>(); + return MockLayerTreeHostImpl::create(m_testHooks, settings(), client).PassAs<cc::CCLayerTreeHostImpl>(); } virtual void didAddAnimation() OVERRIDE { - LayerTreeHost::didAddAnimation(); + CCLayerTreeHost::didAddAnimation(); m_testHooks->didAddAnimation(); } private: - MockLayerTreeHost(TestHooks* testHooks, cc::LayerTreeHostClient* client, const cc::LayerTreeSettings& settings) - : LayerTreeHost(client, settings) + MockLayerTreeHost(TestHooks* testHooks, cc::CCLayerTreeHostClient* client, const cc::CCLayerTreeSettings& settings) + : CCLayerTreeHost(client, settings) , m_testHooks(testHooks) { } @@ -182,12 +182,12 @@ private: TestHooks* m_testHooks; }; -// Implementation of LayerTreeHost callback interface. -class ThreadedMockLayerTreeHostClient : public MockLayerImplTreeHostClient { +// Implementation of CCLayerTreeHost callback interface. +class MockLayerTreeHostClient : public MockCCLayerTreeHostClient { public: - static scoped_ptr<ThreadedMockLayerTreeHostClient> create(TestHooks* testHooks) + static scoped_ptr<MockLayerTreeHostClient> create(TestHooks* testHooks) { - return make_scoped_ptr(new ThreadedMockLayerTreeHostClient(testHooks)); + return make_scoped_ptr(new MockLayerTreeHostClient(testHooks)); } virtual void willBeginFrame() OVERRIDE @@ -223,9 +223,9 @@ public: m_testHooks->didRecreateOutputSurface(succeeded); } - virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE + virtual scoped_ptr<CCInputHandler> createInputHandler() OVERRIDE { - return scoped_ptr<InputHandler>(); + return scoped_ptr<CCInputHandler>(); } virtual void willCommit() OVERRIDE @@ -252,14 +252,14 @@ public: } private: - explicit ThreadedMockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { } + explicit MockLayerTreeHostClient(TestHooks* testHooks) : m_testHooks(testHooks) { } TestHooks* m_testHooks; }; class TimeoutTask : public WebThread::Task { public: - explicit TimeoutTask(ThreadedTest* test) + explicit TimeoutTask(CCThreadedTest* test) : m_test(test) { } @@ -282,12 +282,12 @@ public: } private: - ThreadedTest* m_test; + CCThreadedTest* m_test; }; class BeginTask : public WebThread::Task { public: - explicit BeginTask(ThreadedTest* test) + explicit BeginTask(CCThreadedTest* test) : m_test(test) { } @@ -298,10 +298,10 @@ public: m_test->doBeginTest(); } private: - ThreadedTest* m_test; + CCThreadedTest* m_test; }; -ThreadedTest::ThreadedTest() +CCThreadedTest::CCThreadedTest() : m_beginning(false) , m_endWhenBeginReturns(false) , m_timedOut(false) @@ -311,11 +311,11 @@ ThreadedTest::ThreadedTest() { } -ThreadedTest::~ThreadedTest() +CCThreadedTest::~CCThreadedTest() { } -void ThreadedTest::endTest() +void CCThreadedTest::endTest() { m_finished = true; @@ -324,65 +324,65 @@ void ThreadedTest::endTest() if (m_beginning) m_endWhenBeginReturns = true; else - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::realEndTest)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::realEndTest)); } -void ThreadedTest::endTestAfterDelay(int delayMilliseconds) +void CCThreadedTest::endTestAfterDelay(int delayMilliseconds) { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::endTest)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::endTest)); } -void ThreadedTest::postSetNeedsAnimateToMainThread() +void CCThreadedTest::postSetNeedsAnimateToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsAnimate)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsAnimate)); } -void ThreadedTest::postAddAnimationToMainThread() +void CCThreadedTest::postAddAnimationToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAddAnimation)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAddAnimation)); } -void ThreadedTest::postAddInstantAnimationToMainThread() +void CCThreadedTest::postAddInstantAnimationToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAddInstantAnimation)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAddInstantAnimation)); } -void ThreadedTest::postSetNeedsCommitToMainThread() +void CCThreadedTest::postSetNeedsCommitToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsCommit)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsCommit)); } -void ThreadedTest::postAcquireLayerTextures() +void CCThreadedTest::postAcquireLayerTextures() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAcquireLayerTextures)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchAcquireLayerTextures)); } -void ThreadedTest::postSetNeedsRedrawToMainThread() +void CCThreadedTest::postSetNeedsRedrawToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsRedraw)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsRedraw)); } -void ThreadedTest::postSetNeedsAnimateAndCommitToMainThread() +void CCThreadedTest::postSetNeedsAnimateAndCommitToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetNeedsAnimateAndCommit)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetNeedsAnimateAndCommit)); } -void ThreadedTest::postSetVisibleToMainThread(bool visible) +void CCThreadedTest::postSetVisibleToMainThread(bool visible) { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSetVisible, visible)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchSetVisible, visible)); } -void ThreadedTest::postDidAddAnimationToMainThread() +void CCThreadedTest::postDidAddAnimationToMainThread() { - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchDidAddAnimation)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchDidAddAnimation)); } -void ThreadedTest::doBeginTest() +void CCThreadedTest::doBeginTest() { - DCHECK(Proxy::isMainThread()); - m_client = ThreadedMockLayerTreeHostClient::create(this); + DCHECK(CCProxy::isMainThread()); + m_client = MockLayerTreeHostClient::create(this); - scoped_refptr<Layer> rootLayer = Layer::create(); + scoped_refptr<LayerChromium> rootLayer = LayerChromium::create(); m_layerTreeHost = MockLayerTreeHost::create(this, m_client.get(), rootLayer, m_settings); ASSERT_TRUE(m_layerTreeHost.get()); rootLayer->setLayerTreeHost(m_layerTreeHost.get()); @@ -396,29 +396,29 @@ void ThreadedTest::doBeginTest() realEndTest(); } -void ThreadedTest::timeout() +void CCThreadedTest::timeout() { m_timedOut = true; endTest(); } -void ThreadedTest::scheduleComposite() +void CCThreadedTest::scheduleComposite() { if (!m_started || m_scheduled || m_finished) return; m_scheduled = true; - m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchComposite)); + m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadedTest::dispatchComposite)); } -void ThreadedTest::realEndTest() +void CCThreadedTest::realEndTest() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); WebKit::Platform::current()->currentThread()->exitRunLoop(); } -void ThreadedTest::dispatchSetNeedsAnimate() +void CCThreadedTest::dispatchSetNeedsAnimate() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -427,9 +427,9 @@ void ThreadedTest::dispatchSetNeedsAnimate() m_layerTreeHost->setNeedsAnimate(); } -void ThreadedTest::dispatchAddInstantAnimation() +void CCThreadedTest::dispatchAddInstantAnimation() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -438,9 +438,9 @@ void ThreadedTest::dispatchAddInstantAnimation() addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 0, 0, 0.5, false); } -void ThreadedTest::dispatchAddAnimation() +void CCThreadedTest::dispatchAddAnimation() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -449,9 +449,9 @@ void ThreadedTest::dispatchAddAnimation() addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 10, 0, 0.5, true); } -void ThreadedTest::dispatchSetNeedsAnimateAndCommit() +void CCThreadedTest::dispatchSetNeedsAnimateAndCommit() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -462,9 +462,9 @@ void ThreadedTest::dispatchSetNeedsAnimateAndCommit() } } -void ThreadedTest::dispatchSetNeedsCommit() +void CCThreadedTest::dispatchSetNeedsCommit() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -473,9 +473,9 @@ void ThreadedTest::dispatchSetNeedsCommit() m_layerTreeHost->setNeedsCommit(); } -void ThreadedTest::dispatchAcquireLayerTextures() +void CCThreadedTest::dispatchAcquireLayerTextures() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -484,9 +484,9 @@ void ThreadedTest::dispatchAcquireLayerTextures() m_layerTreeHost->acquireLayerTextures(); } -void ThreadedTest::dispatchSetNeedsRedraw() +void CCThreadedTest::dispatchSetNeedsRedraw() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -495,9 +495,9 @@ void ThreadedTest::dispatchSetNeedsRedraw() m_layerTreeHost->setNeedsRedraw(); } -void ThreadedTest::dispatchSetVisible(bool visible) +void CCThreadedTest::dispatchSetVisible(bool visible) { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -506,16 +506,16 @@ void ThreadedTest::dispatchSetVisible(bool visible) m_layerTreeHost->setVisible(visible); } -void ThreadedTest::dispatchComposite() +void CCThreadedTest::dispatchComposite() { m_scheduled = false; if (m_layerTreeHost.get() && !m_finished) m_layerTreeHost->composite(); } -void ThreadedTest::dispatchDidAddAnimation() +void CCThreadedTest::dispatchDidAddAnimation() { - DCHECK(Proxy::isMainThread()); + DCHECK(CCProxy::isMainThread()); if (m_finished) return; @@ -524,20 +524,20 @@ void ThreadedTest::dispatchDidAddAnimation() m_layerTreeHost->didAddAnimation(); } -void ThreadedTest::runTest(bool threaded) +void CCThreadedTest::runTest(bool threaded) { // For these tests, we will enable threaded animations. - ScopedSettings scopedSettings; + CCScopedSettings scopedSettings; Settings::setAcceleratedAnimationEnabled(true); if (threaded) { - m_webThread.reset(WebKit::Platform::current()->createThread("ThreadedTest")); + m_webThread.reset(WebKit::Platform::current()->createThread("CCThreadedTest")); Platform::current()->compositorSupport()->initialize(m_webThread.get()); } else Platform::current()->compositorSupport()->initialize(0); - DCHECK(Proxy::isMainThread()); - m_mainThreadProxy = ScopedThreadProxy::create(Proxy::mainThread()); + DCHECK(CCProxy::isMainThread()); + m_mainThreadProxy = CCScopedThreadProxy::create(CCProxy::mainThread()); initializeSettings(m_settings); diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h index 72d854c..abdcb9a 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 LayerImpl; -class LayerTreeHost; -class LayerTreeHostClient; -class LayerTreeHostImpl; +class CCLayerImpl; +class CCLayerTreeHost; +class CCLayerTreeHostClient; +class CCLayerTreeHostImpl; } 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 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 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 applyScrollAndScale(const cc::IntSize&, float) { } virtual void animate(double monotonicTime) { } virtual void layout() { } @@ -51,22 +51,22 @@ public: class TimeoutTask; class BeginTask; -class MockLayerImplTreeHostClient : public cc::LayerTreeHostClient { +class MockCCLayerTreeHostClient : public cc::CCLayerTreeHostClient { }; -// The ThreadedTests runs with the main loop running. It instantiates a single MockLayerTreeHost and associated -// MockLayerTreeHostImpl/ThreadedMockLayerTreeHostClient. +// The CCThreadedTests runs with the main loop running. It instantiates a single MockLayerTreeHost and associated +// MockLayerTreeHostImpl/MockLayerTreeHostClient. // // 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 ThreadedTest methods of similar names. +// Key stages of the drawing loop, e.g. drawing or commiting, redirect to CCThreadedTest 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 ThreadedTest : public testing::Test, public TestHooks { +class CCThreadedTest : public testing::Test, public TestHooks { public: - virtual ~ThreadedTest(); + virtual ~CCThreadedTest(); virtual void afterTest() = 0; virtual void beginTest() = 0; @@ -89,12 +89,12 @@ public: void clearTimeout() { m_timeoutTask = 0; } - cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } + cc::CCLayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } protected: - ThreadedTest(); + CCThreadedTest(); - virtual void initializeSettings(cc::LayerTreeSettings&) { } + virtual void initializeSettings(cc::CCLayerTreeSettings&) { } virtual void scheduleComposite() OVERRIDE; @@ -114,12 +114,12 @@ protected: virtual void runTest(bool threaded); WebKit::WebThread* webThread() const { return m_webThread.get(); } - cc::LayerTreeSettings m_settings; - scoped_ptr<MockLayerImplTreeHostClient> m_client; - scoped_ptr<cc::LayerTreeHost> m_layerTreeHost; + cc::CCLayerTreeSettings m_settings; + scoped_ptr<MockCCLayerTreeHostClient> m_client; + scoped_ptr<cc::CCLayerTreeHost> m_layerTreeHost; protected: - RefPtr<cc::ScopedThreadProxy> m_mainThreadProxy; + RefPtr<cc::CCScopedThreadProxy> m_mainThreadProxy; private: bool m_beginning; @@ -134,18 +134,18 @@ private: BeginTask* m_beginTask; }; -class ThreadedTestThreadOnly : public ThreadedTest { +class CCThreadedTestThreadOnly : public CCThreadedTest { public: void runTestThreaded() { - ThreadedTest::runTest(true); + CCThreadedTest::runTest(true); } }; -// Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. -class MockLayerTreeHostImpl : public cc::LayerTreeHostImpl { +// Adapts CCLayerTreeHostImpl for test. Runs real code, then invokes test hooks. +class MockLayerTreeHostImpl : public cc::CCLayerTreeHostImpl { public: - static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTreeHostImplClient*); + static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); 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::LayerImpl*> LayerList; - using LayerTreeHostImpl::calculateRenderSurfaceLayerList; + typedef std::vector<cc::CCLayerImpl*> CCLayerList; + using CCLayerTreeHostImpl::calculateRenderSurfaceLayerList; protected: virtual void animateLayers(double monotonicTime, double wallClockTime) OVERRIDE; virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; private: - MockLayerTreeHostImpl(TestHooks*, const cc::LayerTreeSettings&, cc::LayerTreeHostImplClient*); + MockLayerTreeHostImpl(TestHooks*, const cc::CCLayerTreeSettings&, cc::CCLayerTreeHostImplClient*); TestHooks* m_testHooks; }; diff --git a/cc/test/mock_quad_culler.cc b/cc/test/mock_quad_culler.cc index 08b8e3e..282dddc 100644 --- a/cc/test/mock_quad_culler.cc +++ b/cc/test/mock_quad_culler.cc @@ -8,23 +8,23 @@ namespace cc { -MockQuadCuller::MockQuadCuller() +MockCCQuadCuller::MockCCQuadCuller() : m_activeQuadList(m_quadListStorage) , m_activeSharedQuadStateList(m_sharedQuadStateStorage) { } -MockQuadCuller::MockQuadCuller(QuadList& externalQuadList, SharedQuadStateList& externalSharedQuadStateList) +MockCCQuadCuller::MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList) : m_activeQuadList(externalQuadList) , m_activeSharedQuadStateList(externalSharedQuadStateList) { } -MockQuadCuller::~MockQuadCuller() +MockCCQuadCuller::~MockCCQuadCuller() { } -bool MockQuadCuller::append(scoped_ptr<DrawQuad> drawQuad, AppendQuadsData&) +bool MockCCQuadCuller::append(scoped_ptr<CCDrawQuad> drawQuad, CCAppendQuadsData&) { if (!drawQuad->quadRect().isEmpty()) { m_activeQuadList.append(drawQuad.Pass()); @@ -33,11 +33,11 @@ bool MockQuadCuller::append(scoped_ptr<DrawQuad> drawQuad, AppendQuadsData&) return false; } -SharedQuadState* MockQuadCuller::useSharedQuadState(scoped_ptr<SharedQuadState> sharedQuadState) +CCSharedQuadState* MockCCQuadCuller::useSharedQuadState(scoped_ptr<CCSharedQuadState> sharedQuadState) { sharedQuadState->id = m_activeSharedQuadStateList.size(); - SharedQuadState* rawPtr = sharedQuadState.get(); + CCSharedQuadState* 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 39c0e31..d853b58 100644 --- a/cc/test/mock_quad_culler.h +++ b/cc/test/mock_quad_culler.h @@ -13,25 +13,25 @@ namespace cc { -class MockQuadCuller : public QuadSink { +class MockCCQuadCuller : public CCQuadSink { public: - MockQuadCuller(); - virtual ~MockQuadCuller(); + MockCCQuadCuller(); + virtual ~MockCCQuadCuller(); - MockQuadCuller(QuadList& externalQuadList, SharedQuadStateList& externalSharedQuadStateList); + MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList); - virtual bool append(scoped_ptr<DrawQuad> newQuad, AppendQuadsData&) OVERRIDE; + virtual bool append(scoped_ptr<CCDrawQuad> newQuad, CCAppendQuadsData&) OVERRIDE; - virtual SharedQuadState* useSharedQuadState(scoped_ptr<SharedQuadState> passSharedQuadState) OVERRIDE; + virtual CCSharedQuadState* useSharedQuadState(scoped_ptr<CCSharedQuadState> passSharedQuadState) OVERRIDE; - const QuadList& quadList() const { return m_activeQuadList; }; - const SharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; + const CCQuadList& quadList() const { return m_activeQuadList; }; + const CCSharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; private: - QuadList& m_activeQuadList; - QuadList m_quadListStorage; - SharedQuadStateList& m_activeSharedQuadStateList; - SharedQuadStateList m_sharedQuadStateStorage; + CCQuadList& m_activeQuadList; + CCQuadList m_quadListStorage; + CCSharedQuadStateList& m_activeSharedQuadStateList; + CCSharedQuadStateList m_sharedQuadStateStorage; }; } // namespace cc diff --git a/cc/test/occlusion_tracker_test_common.h b/cc/test/occlusion_tracker_test_common.h index a5086e8..0bc9a4c 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 TestOcclusionTrackerBase : public cc::OcclusionTrackerBase<LayerType, RenderSurfaceType> { +class TestCCOcclusionTrackerBase : public cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType> { public: - TestOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetricsForFrame = false) - : cc::OcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissorRect, recordMetricsForFrame) + TestCCOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetricsForFrame = false) + : cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissorRect, recordMetricsForFrame) { } - 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; } + 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; } - 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; } + 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; } }; -typedef TestOcclusionTrackerBase<cc::Layer, cc::RenderSurface> TestOcclusionTracker; -typedef TestOcclusionTrackerBase<cc::LayerImpl, cc::RenderSurfaceImpl> TestOcclusionTrackerImpl; +typedef TestCCOcclusionTrackerBase<cc::LayerChromium, cc::RenderSurfaceChromium> TestCCOcclusionTracker; +typedef TestCCOcclusionTrackerBase<cc::CCLayerImpl, cc::CCRenderSurface> TestCCOcclusionTrackerImpl; } diff --git a/cc/test/render_pass_test_common.h b/cc/test/render_pass_test_common.h index 53356cd..9f17781 100644 --- a/cc/test/render_pass_test_common.h +++ b/cc/test/render_pass_test_common.h @@ -9,13 +9,13 @@ namespace WebKitTests { -class TestRenderPass : public cc::RenderPass { +class CCTestRenderPass : public cc::CCRenderPass { public: - cc::QuadList& quadList() { return m_quadList; } - cc::SharedQuadStateList& sharedQuadStateList() { return m_sharedQuadStateList; } + cc::CCQuadList& quadList() { return m_quadList; } + cc::CCSharedQuadStateList& sharedQuadStateList() { return m_sharedQuadStateList; } - void appendQuad(scoped_ptr<cc::DrawQuad> quad) { m_quadList.append(quad.Pass()); } - void appendSharedQuadState(scoped_ptr<cc::SharedQuadState> state) { m_sharedQuadStateList.append(state.Pass()); } + void appendQuad(scoped_ptr<cc::CCDrawQuad> quad) { m_quadList.append(quad.Pass()); } + void appendSharedQuadState(scoped_ptr<cc::CCSharedQuadState> 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 b2bedd8..e956b5d 100644 --- a/cc/test/scheduler_test_common.cc +++ b/cc/test/scheduler_test_common.cc @@ -10,26 +10,26 @@ namespace WebKitTests { -void FakeTimeSourceClient::onTimerTick() +void FakeCCTimeSourceClient::onTimerTick() { m_tickCalled = true; } -FakeThread::FakeThread() +FakeCCThread::FakeCCThread() { reset(); } -FakeThread::~FakeThread() +FakeCCThread::~FakeCCThread() { } -void FakeThread::postTask(PassOwnPtr<Task>) +void FakeCCThread::postTask(PassOwnPtr<Task>) { NOTREACHED(); } -void FakeThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) +void FakeCCThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) { if (m_runPendingTaskOnOverwrite && hasPendingTask()) runPendingTask(); @@ -39,37 +39,37 @@ void FakeThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) m_pendingTaskDelay = delay; } -base::PlatformThreadId FakeThread::threadID() const +base::PlatformThreadId FakeCCThread::threadID() const { return 0; } -void FakeTimeSource::setClient(cc::TimeSourceClient* client) +void FakeCCTimeSource::setClient(cc::CCTimeSourceClient* client) { m_client = client; } -void FakeTimeSource::setActive(bool b) +void FakeCCTimeSource::setActive(bool b) { m_active = b; } -bool FakeTimeSource::active() const +bool FakeCCTimeSource::active() const { return m_active; } -base::TimeTicks FakeTimeSource::lastTickTime() +base::TimeTicks FakeCCTimeSource::lastTickTime() { return base::TimeTicks(); } -base::TimeTicks FakeTimeSource::nextTickTime() +base::TimeTicks FakeCCTimeSource::nextTickTime() { return base::TimeTicks(); } -base::TimeTicks FakeDelayBasedTimeSource::now() const +base::TimeTicks FakeCCDelayBasedTimeSource::now() const { return m_now; } diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h index 58f779b..aeb0d55 100644 --- a/cc/test/scheduler_test_common.h +++ b/cc/test/scheduler_test_common.h @@ -14,9 +14,9 @@ namespace WebKitTests { -class FakeTimeSourceClient : public cc::TimeSourceClient { +class FakeCCTimeSourceClient : public cc::CCTimeSourceClient { public: - FakeTimeSourceClient() { reset(); } + FakeCCTimeSourceClient() { reset(); } void reset() { m_tickCalled = false; } bool tickCalled() const { return m_tickCalled; } @@ -26,10 +26,10 @@ protected: bool m_tickCalled; }; -class FakeThread : public cc::Thread { +class FakeCCThread : public cc::CCThread { public: - FakeThread(); - virtual ~FakeThread(); + FakeCCThread(); + virtual ~FakeCCThread(); void reset() { @@ -67,15 +67,15 @@ protected: bool m_runPendingTaskOnOverwrite; }; -class FakeTimeSource : public cc::TimeSource { +class FakeCCTimeSource : public cc::CCTimeSource { public: - FakeTimeSource() + FakeCCTimeSource() : m_active(false) , m_client(0) { } - virtual void setClient(cc::TimeSourceClient* client) OVERRIDE; + 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 { } @@ -92,36 +92,36 @@ public: void setNextTickTime(base::TimeTicks nextTickTime) { m_nextTickTime = nextTickTime; } protected: - virtual ~FakeTimeSource() { } + virtual ~FakeCCTimeSource() { } bool m_active; base::TimeTicks m_nextTickTime; - cc::TimeSourceClient* m_client; + cc::CCTimeSourceClient* m_client; }; -class FakeDelayBasedTimeSource : public cc::DelayBasedTimeSource { +class FakeCCDelayBasedTimeSource : public cc::CCDelayBasedTimeSource { public: - static scoped_refptr<FakeDelayBasedTimeSource> create(base::TimeDelta interval, cc::Thread* thread) + static scoped_refptr<FakeCCDelayBasedTimeSource> create(base::TimeDelta interval, cc::CCThread* thread) { - return make_scoped_refptr(new FakeDelayBasedTimeSource(interval, thread)); + return make_scoped_refptr(new FakeCCDelayBasedTimeSource(interval, thread)); } void setNow(base::TimeTicks time) { m_now = time; } virtual base::TimeTicks now() const OVERRIDE; protected: - FakeDelayBasedTimeSource(base::TimeDelta interval, cc::Thread* thread) - : DelayBasedTimeSource(interval, thread) + FakeCCDelayBasedTimeSource(base::TimeDelta interval, cc::CCThread* thread) + : CCDelayBasedTimeSource(interval, thread) { } - virtual ~FakeDelayBasedTimeSource() { } + virtual ~FakeCCDelayBasedTimeSource() { } base::TimeTicks m_now; }; -class FakeFrameRateController : public cc::FrameRateController { +class FakeCCFrameRateController : public cc::CCFrameRateController { public: - FakeFrameRateController(scoped_refptr<cc::TimeSource> timer) : cc::FrameRateController(timer) { } + FakeCCFrameRateController(scoped_refptr<cc::CCTimeSource> timer) : cc::CCFrameRateController(timer) { } int numFramesPending() const { return m_numFramesPending; } }; diff --git a/cc/test/test_common.h b/cc/test/test_common.h index 9c6c0ce..572a5c9 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 ScopedSettings { +class CCScopedSettings { public: - ScopedSettings() { cc::Settings::resetForTest(); } - ~ScopedSettings() { cc::Settings::resetForTest(); } + CCScopedSettings() { cc::Settings::resetForTest(); } + ~CCScopedSettings() { cc::Settings::resetForTest(); } }; } // namespace WebKitTests diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc index ccc593b..7f42177 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<PrioritizedTexture> texture) +FakeLayerTextureUpdater::Texture::Texture(FakeLayerTextureUpdater* layer, scoped_ptr<CCPrioritizedTexture> texture) : LayerTextureUpdater::Texture(texture.Pass()) , m_layer(layer) { @@ -22,7 +22,7 @@ FakeLayerTextureUpdater::Texture::~Texture() { } -void FakeLayerTextureUpdater::Texture::update(TextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, RenderingStats&) +void FakeLayerTextureUpdater::Texture::update(CCTextureUpdateQueue& queue, const IntRect&, const IntSize&, bool partialUpdate, CCRenderingStats&) { 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, RenderingStats&) +void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const IntSize&, float, float, IntRect& resultingOpaqueRect, CCRenderingStats&) { m_prepareCount++; m_lastUpdateRect = contentRect; @@ -57,15 +57,15 @@ void FakeLayerTextureUpdater::prepareToUpdate(const IntRect& contentRect, const resultingOpaqueRect = m_opaquePaintRect; } -void FakeLayerTextureUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayer* layer) +void FakeLayerTextureUpdater::setRectToInvalidate(const IntRect& rect, FakeTiledLayerChromium* layer) { m_rectToInvalidate = rect; m_layer = layer; } -scoped_ptr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(PrioritizedTextureManager* manager) +scoped_ptr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(CCPrioritizedTextureManager* manager) { - return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, PrioritizedTexture::create(manager))); + return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, CCPrioritizedTexture::create(manager))); } LayerTextureUpdater::SampledTexelFormat FakeLayerTextureUpdater::sampledTexelFormat(GLenum) @@ -73,28 +73,28 @@ LayerTextureUpdater::SampledTexelFormat FakeLayerTextureUpdater::sampledTexelFor return SampledTexelFormatRGBA; } -FakeTiledLayerImpl::FakeTiledLayerImpl(int id) - : TiledLayerImpl(id) +FakeCCTiledLayerImpl::FakeCCTiledLayerImpl(int id) + : CCTiledLayerImpl(id) { } -FakeTiledLayerImpl::~FakeTiledLayerImpl() +FakeCCTiledLayerImpl::~FakeCCTiledLayerImpl() { } -FakeTiledLayer::FakeTiledLayer(PrioritizedTextureManager* textureManager) - : TiledLayer() +FakeTiledLayerChromium::FakeTiledLayerChromium(CCPrioritizedTextureManager* textureManager) + : TiledLayerChromium() , m_fakeTextureUpdater(make_scoped_refptr(new FakeLayerTextureUpdater)) , m_textureManager(textureManager) { setTileSize(tileSize()); setTextureFormat(GL_RGBA); - setBorderTexelOption(LayerTilingData::NoBorderTexels); + setBorderTexelOption(CCLayerTilingData::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(PrioritizedTextureManager* textureManager) - : FakeTiledLayer(textureManager) +FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedTextureManager* textureManager) + : FakeTiledLayerChromium(textureManager) { } @@ -102,17 +102,17 @@ FakeTiledLayerWithScaledBounds::~FakeTiledLayerWithScaledBounds() { } -FakeTiledLayer::~FakeTiledLayer() +FakeTiledLayerChromium::~FakeTiledLayerChromium() { } -void FakeTiledLayer::setNeedsDisplayRect(const FloatRect& rect) +void FakeTiledLayerChromium::setNeedsDisplayRect(const FloatRect& rect) { m_lastNeedsDisplayRect = rect; - TiledLayer::setNeedsDisplayRect(rect); + TiledLayerChromium::setNeedsDisplayRect(rect); } -void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) +void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& 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. @@ -121,7 +121,7 @@ void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) if (missingTargetRenderSurface) createRenderSurface(); - TiledLayer::setTexturePriorities(calculator); + TiledLayerChromium::setTexturePriorities(calculator); if (missingTargetRenderSurface) { clearRenderSurface(); @@ -129,12 +129,12 @@ void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) } } -cc::PrioritizedTextureManager* FakeTiledLayer::textureManager() const +cc::CCPrioritizedTextureManager* FakeTiledLayerChromium::textureManager() const { return m_textureManager; } -cc::LayerTextureUpdater* FakeTiledLayer::textureUpdater() const +cc::LayerTextureUpdater* FakeTiledLayerChromium::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 1c0f75d..844688e 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -20,16 +20,16 @@ namespace WebKitTests { -class FakeTiledLayer; +class FakeTiledLayerChromium; class FakeLayerTextureUpdater : public cc::LayerTextureUpdater { public: class Texture : public cc::LayerTextureUpdater::Texture { public: - Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::PrioritizedTexture>); + Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::CCPrioritizedTexture>); virtual ~Texture(); - virtual void update(cc::TextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::RenderingStats&) OVERRIDE; + virtual void update(cc::CCTextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::CCRenderingStats&) OVERRIDE; private: FakeLayerTextureUpdater* m_layer; @@ -38,13 +38,13 @@ public: FakeLayerTextureUpdater(); - virtual scoped_ptr<cc::LayerTextureUpdater::Texture> createTexture(cc::PrioritizedTextureManager*) OVERRIDE; + virtual scoped_ptr<cc::LayerTextureUpdater::Texture> createTexture(cc::CCPrioritizedTextureManager*) OVERRIDE; virtual SampledTexelFormat sampledTexelFormat(GLenum) OVERRIDE; - virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSize&, float, float, cc::IntRect& resultingOpaqueRect, cc::RenderingStats&) OVERRIDE; + virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSize&, float, float, cc::IntRect& resultingOpaqueRect, cc::CCRenderingStats&) 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&, FakeTiledLayer*); + void setRectToInvalidate(const cc::IntRect&, FakeTiledLayerChromium*); // Last rect passed to prepareToUpdate(). const cc::IntRect& lastUpdateRect() const { return m_lastUpdateRect; } @@ -68,53 +68,53 @@ private: cc::IntRect m_rectToInvalidate; cc::IntRect m_lastUpdateRect; cc::IntRect m_opaquePaintRect; - scoped_refptr<FakeTiledLayer> m_layer; + scoped_refptr<FakeTiledLayerChromium> m_layer; }; -class FakeTiledLayerImpl : public cc::TiledLayerImpl { +class FakeCCTiledLayerImpl : public cc::CCTiledLayerImpl { public: - explicit FakeTiledLayerImpl(int id); - virtual ~FakeTiledLayerImpl(); + explicit FakeCCTiledLayerImpl(int id); + virtual ~FakeCCTiledLayerImpl(); - using cc::TiledLayerImpl::hasTileAt; - using cc::TiledLayerImpl::hasResourceIdForTileAt; + using cc::CCTiledLayerImpl::hasTileAt; + using cc::CCTiledLayerImpl::hasResourceIdForTileAt; }; -class FakeTiledLayer : public cc::TiledLayer { +class FakeTiledLayerChromium : public cc::TiledLayerChromium { public: - explicit FakeTiledLayer(cc::PrioritizedTextureManager*); + explicit FakeTiledLayerChromium(cc::CCPrioritizedTextureManager*); static cc::IntSize tileSize() { return cc::IntSize(100, 100); } - using cc::TiledLayer::invalidateContentRect; - using cc::TiledLayer::needsIdlePaint; - using cc::TiledLayer::skipsDraw; - using cc::TiledLayer::numPaintedTiles; - using cc::TiledLayer::idlePaintRect; + using cc::TiledLayerChromium::invalidateContentRect; + using cc::TiledLayerChromium::needsIdlePaint; + using cc::TiledLayerChromium::skipsDraw; + using cc::TiledLayerChromium::numPaintedTiles; + using cc::TiledLayerChromium::idlePaintRect; virtual void setNeedsDisplayRect(const cc::FloatRect&) OVERRIDE; const cc::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRect; } - virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE; + virtual void setTexturePriorities(const cc::CCPriorityCalculator&) OVERRIDE; - virtual cc::PrioritizedTextureManager* textureManager() const OVERRIDE; + virtual cc::CCPrioritizedTextureManager* 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 ~FakeTiledLayer(); + virtual ~FakeTiledLayerChromium(); private: scoped_refptr<FakeLayerTextureUpdater> m_fakeTextureUpdater; - cc::PrioritizedTextureManager* m_textureManager; + cc::CCPrioritizedTextureManager* m_textureManager; cc::FloatRect m_lastNeedsDisplayRect; }; -class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { +class FakeTiledLayerWithScaledBounds : public FakeTiledLayerChromium { public: - explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedTextureManager*); + explicit FakeTiledLayerWithScaledBounds(cc::CCPrioritizedTextureManager*); void setContentBounds(const cc::IntSize& contentBounds) { m_forcedContentBounds = contentBounds; } virtual cc::IntSize contentBounds() const OVERRIDE; |