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

Side by Side Diff: cc/surfaces/surface_factory_unittest.cc

Issue 2585543003: Revert of Getting rid of CompositorFrameMetadata::satisfies_sequences (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/surfaces/surface_factory.h" 5 #include "cc/surfaces/surface_factory.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
11 #include <vector>
12 11
13 #include "base/bind.h" 12 #include "base/bind.h"
14 #include "base/macros.h" 13 #include "base/macros.h"
15 #include "cc/output/compositor_frame.h" 14 #include "cc/output/compositor_frame.h"
16 #include "cc/output/copy_output_request.h" 15 #include "cc/output/copy_output_request.h"
17 #include "cc/output/copy_output_result.h" 16 #include "cc/output/copy_output_result.h"
18 #include "cc/resources/resource_provider.h" 17 #include "cc/resources/resource_provider.h"
19 #include "cc/surfaces/surface.h" 18 #include "cc/surfaces/surface.h"
20 #include "cc/surfaces/surface_factory_client.h" 19 #include "cc/surfaces/surface_factory_client.h"
21 #include "cc/surfaces/surface_manager.h" 20 #include "cc/surfaces/surface_manager.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 SurfaceFactory::DrawCallback()); 518 SurfaceFactory::DrawCallback());
520 519
521 manager_.RegisterFrameSinkId(kArbitraryFrameSinkId); 520 manager_.RegisterFrameSinkId(kArbitraryFrameSinkId);
522 521
523 // Check that waiting before the sequence is satisfied works. 522 // Check that waiting before the sequence is satisfied works.
524 manager_.GetSurfaceForId(id2)->AddDestructionDependency( 523 manager_.GetSurfaceForId(id2)->AddDestructionDependency(
525 SurfaceSequence(kArbitraryFrameSinkId, 4)); 524 SurfaceSequence(kArbitraryFrameSinkId, 4));
526 factory2->EvictSurface(); 525 factory2->EvictSurface();
527 526
528 CompositorFrame frame; 527 CompositorFrame frame;
528 frame.metadata.satisfies_sequences.push_back(6);
529 frame.metadata.satisfies_sequences.push_back(4);
529 DCHECK(manager_.GetSurfaceForId(id2)); 530 DCHECK(manager_.GetSurfaceForId(id2));
530 std::vector<uint32_t> sequences = {4, 6}; 531 factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame),
531 manager_.DidSatisfySequences(kArbitraryFrameSinkId, &sequences); 532 SurfaceFactory::DrawCallback());
532 DCHECK(!manager_.GetSurfaceForId(id2)); 533 DCHECK(!manager_.GetSurfaceForId(id2));
533 534
534 // Check that waiting after the sequence is satisfied works. 535 // Check that waiting after the sequence is satisfied works.
535 factory2->SubmitCompositorFrame(local_frame_id2, CompositorFrame(), 536 factory2->SubmitCompositorFrame(local_frame_id2, CompositorFrame(),
536 SurfaceFactory::DrawCallback()); 537 SurfaceFactory::DrawCallback());
537 DCHECK(manager_.GetSurfaceForId(id2)); 538 DCHECK(manager_.GetSurfaceForId(id2));
538 manager_.GetSurfaceForId(id2)->AddDestructionDependency( 539 manager_.GetSurfaceForId(id2)->AddDestructionDependency(
539 SurfaceSequence(kAnotherArbitraryFrameSinkId, 6)); 540 SurfaceSequence(kAnotherArbitraryFrameSinkId, 6));
540 factory2->EvictSurface(); 541 factory2->EvictSurface();
541 DCHECK(!manager_.GetSurfaceForId(id2)); 542 DCHECK(!manager_.GetSurfaceForId(id2));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 668
668 factory_->EvictSurface(); 669 factory_->EvictSurface();
669 local_frame_id_ = LocalFrameId(); 670 local_frame_id_ = LocalFrameId();
670 EXPECT_TRUE(called1); 671 EXPECT_TRUE(called1);
671 EXPECT_TRUE(called2); 672 EXPECT_TRUE(called2);
672 EXPECT_TRUE(called3); 673 EXPECT_TRUE(called3);
673 } 674 }
674 675
675 } // namespace 676 } // namespace
676 } // namespace cc 677 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698