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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: IsEmpty + rebase Created 4 years, 2 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/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index be74ec3beb149b74bcea9d22d407cbc8b0f96c7f..ff801d8f86a9625eb6d131bdb9413c80812b1155 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -14,7 +14,6 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
-#include "cc/output/delegated_frame_data.h"
#include "cc/resources/resource_provider.h"
#include "cc/surfaces/surface.h"
#include "cc/surfaces/surface_factory_client.h"
@@ -100,16 +99,14 @@ class SurfaceFactoryTest : public testing::Test, public SurfaceObserver {
void SubmitCompositorFrameWithResources(ResourceId* resource_ids,
size_t num_resource_ids) {
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
+ CompositorFrame frame;
for (size_t i = 0u; i < num_resource_ids; ++i) {
TransferableResource resource;
resource.id = resource_ids[i];
resource.mailbox_holder.texture_target = GL_TEXTURE_2D;
resource.mailbox_holder.sync_token = frame_sync_token_;
- frame_data->resource_list.push_back(resource);
+ frame.resource_list.push_back(resource);
}
- CompositorFrame frame;
- frame.delegated_frame_data = std::move(frame_data);
factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
SurfaceFactory::DrawCallback());
EXPECT_EQ(last_created_surface_id_.local_frame_id(), local_frame_id_);
@@ -148,8 +145,7 @@ class SurfaceFactoryTest : public testing::Test, public SurfaceObserver {
void RefCurrentFrameResources() {
Surface* surface = manager_.GetSurfaceForId(
SurfaceId(factory_->frame_sink_id(), local_frame_id_));
- factory_->RefResources(
- surface->GetEligibleFrame().delegated_frame_data->resource_list);
+ factory_->RefResources(surface->GetEligibleFrame().resource_list);
}
protected:
@@ -443,7 +439,6 @@ TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
ASSERT_NE(nullptr, surface);
EXPECT_EQ(2, surface->frame_index());
CompositorFrame frame;
- frame.delegated_frame_data.reset(new DelegatedFrameData);
factory_->SubmitCompositorFrame(local_frame_id, std::move(frame),
danakj 2016/10/27 23:06:56 just pass a CompositorFrame(), no need for the fra
Saman Sami 2016/10/28 16:47:35 Done.
SurfaceFactory::DrawCallback());
@@ -464,7 +459,6 @@ TEST_F(SurfaceFactoryTest, AddDuringDestroy) {
LocalFrameId local_frame_id(6, 0);
factory_->Create(local_frame_id);
CompositorFrame frame;
- frame.delegated_frame_data.reset(new DelegatedFrameData);
uint32_t execute_count = 0;
factory_->SubmitCompositorFrame(
@@ -485,13 +479,11 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
LocalFrameId id(7, 0);
factory_->Create(id);
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
TransferableResource resource;
resource.id = 1;
resource.mailbox_holder.texture_target = GL_TEXTURE_2D;
- frame_data->resource_list.push_back(resource);
CompositorFrame frame;
- frame.delegated_frame_data = std::move(frame_data);
+ frame.resource_list.push_back(resource);
uint32_t execute_count = 0;
factory_->SubmitCompositorFrame(id, std::move(frame),
base::Bind(&DrawCallback, &execute_count));
@@ -513,11 +505,9 @@ TEST_F(SurfaceFactoryTest, DestroySequence) {
SurfaceSequence(kArbitraryFrameSinkId, 4));
factory_->Destroy(local_frame_id2);
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
CompositorFrame frame;
frame.metadata.satisfies_sequences.push_back(6);
frame.metadata.satisfies_sequences.push_back(4);
- frame.delegated_frame_data = std::move(frame_data);
DCHECK(manager_.GetSurfaceForId(id2));
factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
SurfaceFactory::DrawCallback());
@@ -570,12 +560,10 @@ TEST_F(SurfaceFactoryTest, DestroyCycle) {
// Give id2 a frame that references local_frame_id_.
{
std::unique_ptr<RenderPass> render_pass(RenderPass::Create());
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
- frame_data->render_pass_list.push_back(std::move(render_pass));
CompositorFrame frame;
+ frame.render_pass_list.push_back(std::move(render_pass));
frame.metadata.referenced_surfaces.push_back(
SurfaceId(factory_->frame_sink_id(), local_frame_id_));
- frame.delegated_frame_data = std::move(frame_data);
factory_->SubmitCompositorFrame(local_frame_id2, std::move(frame),
SurfaceFactory::DrawCallback());
EXPECT_EQ(last_created_surface_id().local_frame_id(), local_frame_id2);
@@ -585,11 +573,9 @@ TEST_F(SurfaceFactoryTest, DestroyCycle) {
// Give local_frame_id_ a frame that references id2.
{
std::unique_ptr<RenderPass> render_pass(RenderPass::Create());
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
- frame_data->render_pass_list.push_back(std::move(render_pass));
CompositorFrame frame;
+ frame.render_pass_list.push_back(std::move(render_pass));
frame.metadata.referenced_surfaces.push_back(id2);
- frame.delegated_frame_data = std::move(frame_data);
factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
SurfaceFactory::DrawCallback());
EXPECT_EQ(last_created_surface_id().local_frame_id(), local_frame_id_);
@@ -622,12 +608,10 @@ void CopyRequestTestCallback(bool* called,
TEST_F(SurfaceFactoryTest, DuplicateCopyRequest) {
{
std::unique_ptr<RenderPass> render_pass(RenderPass::Create());
- std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
- frame_data->render_pass_list.push_back(std::move(render_pass));
CompositorFrame frame;
+ frame.render_pass_list.push_back(std::move(render_pass));
frame.metadata.referenced_surfaces.push_back(
SurfaceId(factory_->frame_sink_id(), local_frame_id_));
- frame.delegated_frame_data = std::move(frame_data);
factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
SurfaceFactory::DrawCallback());
EXPECT_EQ(last_created_surface_id().local_frame_id(), local_frame_id_);

Powered by Google App Engine
This is Rietveld 408576698