Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2991)

Unified Diff: cc/test/layer_tree_test.cc

Issue 132163004: Remove WebGraphicsContext3D getter from cc::ContextProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/test/test_context_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test.cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 8e2906bfa673241123cb8f8ba7baaf53f209fe88..36621d01dec5f59a1af8d0a4faa3ce853915d02a 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -53,12 +53,8 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
LayerTreeHostImplClient* host_impl_client,
Proxy* proxy,
RenderingStatsInstrumentation* stats_instrumentation) {
- return make_scoped_ptr(
- new LayerTreeHostImplForTesting(test_hooks,
- settings,
- host_impl_client,
- proxy,
- stats_instrumentation));
+ return make_scoped_ptr(new LayerTreeHostImplForTesting(
+ test_hooks, settings, host_impl_client, proxy, stats_instrumentation));
}
protected:
@@ -226,9 +222,7 @@ class LayerTreeHostClientForTesting : public LayerTreeHostClient,
monotonic_time * base::Time::kMicrosecondsPerSecond));
}
- virtual void Layout() OVERRIDE {
- test_hooks_->Layout();
- }
+ virtual void Layout() OVERRIDE { test_hooks_->Layout(); }
virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
float scale) OVERRIDE {
@@ -250,9 +244,7 @@ class LayerTreeHostClientForTesting : public LayerTreeHostClient,
virtual void WillCommit() OVERRIDE { test_hooks_->WillCommit(); }
- virtual void DidCommit() OVERRIDE {
- test_hooks_->DidCommit();
- }
+ virtual void DidCommit() OVERRIDE { test_hooks_->DidCommit(); }
virtual void DidCommitAndDrawFrame() OVERRIDE {
test_hooks_->DidCommitAndDrawFrame();
@@ -319,9 +311,7 @@ class LayerTreeHostForTesting : public LayerTreeHost {
void set_test_started(bool started) { test_started_ = started; }
- virtual void DidDeferCommit() OVERRIDE {
- test_hooks_->DidDeferCommit();
- }
+ virtual void DidDeferCommit() OVERRIDE { test_hooks_->DidDeferCommit(); }
private:
LayerTreeHostForTesting(TestHooks* test_hooks,
@@ -490,8 +480,8 @@ void LayerTreeTest::DoBeginTest() {
// Allow commits to happen once BeginTest() has had a chance to post tasks
// so that those tasks will happen before the first commit.
if (layer_tree_host_) {
- static_cast<LayerTreeHostForTesting*>(layer_tree_host_.get())->
- set_test_started(true);
+ static_cast<LayerTreeHostForTesting*>(layer_tree_host_.get())
+ ->set_test_started(true);
}
}
@@ -540,11 +530,8 @@ void LayerTreeTest::DispatchAddAnimation(Layer* layer_to_receive_animation,
DCHECK(!proxy() || proxy()->IsMainThread());
if (layer_to_receive_animation) {
- AddOpacityTransitionToLayer(layer_to_receive_animation,
- animation_duration,
- 0,
- 0.5,
- true);
+ AddOpacityTransitionToLayer(
+ layer_to_receive_animation, animation_duration, 0, 0.5, true);
}
}
@@ -647,8 +634,8 @@ void LayerTreeTest::RunTest(bool threaded,
// mocked out.
settings_.refresh_rate = 200.0;
if (impl_side_painting) {
- DCHECK(threaded) <<
- "Don't run single thread + impl side painting, it doesn't exist.";
+ DCHECK(threaded)
+ << "Don't run single thread + impl side painting, it doesn't exist.";
settings_.impl_side_painting = true;
}
InitializeSettings(&settings_);
@@ -686,15 +673,21 @@ void LayerTreeTest::RunTestWithImplSidePainting() {
}
scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface(bool fallback) {
- scoped_ptr<FakeOutputSurface> output_surface;
- if (delegating_renderer_)
- output_surface = FakeOutputSurface::CreateDelegating3d();
- else
- output_surface = FakeOutputSurface::Create3d();
+ scoped_ptr<FakeOutputSurface> output_surface =
+ CreateFakeOutputSurfaceForTest(fallback);
+
output_surface_ = output_surface.get();
return output_surface.PassAs<OutputSurface>();
}
+scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurfaceForTest(
+ bool fallback) {
+ if (delegating_renderer_)
+ return FakeOutputSurface::CreateDelegating3d();
+ else
+ return FakeOutputSurface::Create3d();
+}
+
scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() {
if (!compositor_contexts_.get() ||
compositor_contexts_->DestroyedOnMainThread())
@@ -702,4 +695,9 @@ scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() {
return compositor_contexts_;
}
+TestWebGraphicsContext3D* LayerTreeTest::TestContext() {
+ return static_cast<TestContextProvider*>(
+ output_surface_->context_provider().get())->TestContext3d();
+}
+
} // namespace cc
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/test/test_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698