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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 286953008: cc: Allow DeferredInitialize to use DelegatingRenderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bring back force_software_renderer Created 6 years, 7 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/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index d1b518b44c8b1e250437f3be03c9eea062728c81..a1714cedb96e94724113f8b0e6889969b4538089 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -20,6 +20,7 @@
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/video_layer.h"
#include "cc/output/begin_frame_args.h"
+#include "cc/output/compositor_frame_ack.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
#include "cc/output/output_surface.h"
@@ -2762,7 +2763,8 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
TestWebGraphicsContext3D::Create());
return FakeOutputSurface::CreateDeferredGL(
- scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice));
+ scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice),
+ delegating_renderer());
}
virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
@@ -2821,6 +2823,24 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
did_release_gl_ = true;
}
+ virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
+ bool result) OVERRIDE {
+ ASSERT_TRUE(result);
+ DelegatedFrameData* delegated_frame_data =
+ output_surface()->last_sent_frame().delegated_frame_data.get();
+ if (!delegated_frame_data)
+ return;
+
+ // Return all resources immediately.
+ TransferableResourceArray resources_to_return =
+ output_surface()->resources_held_by_parent();
+
+ CompositorFrameAck ack;
+ for (size_t i = 0; i < resources_to_return.size(); ++i)
+ output_surface()->ReturnResource(resources_to_return[i].id, &ack);
+ host_impl->ReclaimResources(&ack);
+ }
+
virtual void AfterTest() OVERRIDE {
EXPECT_TRUE(did_initialize_gl_);
EXPECT_TRUE(did_release_gl_);
@@ -2834,7 +2854,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
int last_source_frame_number_drawn_;
};
-MULTI_THREAD_DIRECT_RENDERER_TEST_F(LayerTreeHostTestDeferredInitialize);
+MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
// Test for UI Resource management.
class LayerTreeHostTestUIResource : public LayerTreeHostTest {
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698