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

Unified Diff: cc/test/fake_layer_tree_host_client.cc

Issue 348093004: Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android compile fixes Created 6 years, 3 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
Index: cc/test/fake_layer_tree_host_client.cc
diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc
index 975f6878cc5dff1ffa499b4271aec19359222f78..087cbb150e239f5f4b00a66e692eb33295edc843 100644
--- a/cc/test/fake_layer_tree_host_client.cc
+++ b/cc/test/fake_layer_tree_host_client.cc
@@ -7,6 +7,7 @@
#include "cc/output/context_provider.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/test_web_graphics_context_3d.h"
+#include "cc/trees/layer_tree_host.h"
namespace cc {
@@ -14,25 +15,31 @@ FakeLayerTreeHostClient::FakeLayerTreeHostClient(RendererOptions options)
: use_software_rendering_(options == DIRECT_SOFTWARE ||
options == DELEGATED_SOFTWARE),
use_delegating_renderer_(options == DELEGATED_3D ||
- options == DELEGATED_SOFTWARE) {}
+ options == DELEGATED_SOFTWARE),
+ host_(NULL) {
+}
FakeLayerTreeHostClient::~FakeLayerTreeHostClient() {}
-scoped_ptr<OutputSurface> FakeLayerTreeHostClient::CreateOutputSurface(
- bool fallback) {
+void FakeLayerTreeHostClient::RequestNewOutputSurface(bool fallback) {
+ DCHECK(host_);
+ scoped_ptr<OutputSurface> surface;
if (use_software_rendering_) {
if (use_delegating_renderer_) {
- return FakeOutputSurface::CreateDelegatingSoftware(
- make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>();
+ surface = FakeOutputSurface::CreateDelegatingSoftware(
+ make_scoped_ptr(new SoftwareOutputDevice))
+ .PassAs<OutputSurface>();
+ } else {
+ surface = FakeOutputSurface::CreateSoftware(
+ make_scoped_ptr(new SoftwareOutputDevice))
+ .PassAs<OutputSurface>();
}
-
- return FakeOutputSurface::CreateSoftware(
- make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>();
+ } else if (use_delegating_renderer_) {
+ surface = FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>();
+ } else {
+ surface = FakeOutputSurface::Create3d().PassAs<OutputSurface>();
}
-
- if (use_delegating_renderer_)
- return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>();
- return FakeOutputSurface::Create3d().PassAs<OutputSurface>();
+ host_->SetOutputSurface(surface.Pass());
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698