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

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

Issue 2537943002: Getting rid of CompositorFrameMetadata::satisfies_sequences (Closed)
Patch Set: x 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>
11 12
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "cc/output/compositor_frame.h" 15 #include "cc/output/compositor_frame.h"
15 #include "cc/output/copy_output_request.h" 16 #include "cc/output/copy_output_request.h"
16 #include "cc/output/copy_output_result.h" 17 #include "cc/output/copy_output_result.h"
17 #include "cc/resources/resource_provider.h" 18 #include "cc/resources/resource_provider.h"
18 #include "cc/surfaces/surface.h" 19 #include "cc/surfaces/surface.h"
19 #include "cc/surfaces/surface_factory_client.h" 20 #include "cc/surfaces/surface_factory_client.h"
20 #include "cc/surfaces/surface_manager.h" 21 #include "cc/surfaces/surface_manager.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 SurfaceFactory::DrawCallback()); 519 SurfaceFactory::DrawCallback());
519 520
520 manager_.RegisterFrameSinkId(kArbitraryFrameSinkId); 521 manager_.RegisterFrameSinkId(kArbitraryFrameSinkId);
521 522
522 // Check that waiting before the sequence is satisfied works. 523 // Check that waiting before the sequence is satisfied works.
523 manager_.GetSurfaceForId(id2)->AddDestructionDependency( 524 manager_.GetSurfaceForId(id2)->AddDestructionDependency(
524 SurfaceSequence(kArbitraryFrameSinkId, 4)); 525 SurfaceSequence(kArbitraryFrameSinkId, 4));
525 factory2->EvictSurface(); 526 factory2->EvictSurface();
526 527
527 CompositorFrame frame; 528 CompositorFrame frame;
528 frame.metadata.satisfies_sequences.push_back(6);
529 frame.metadata.satisfies_sequences.push_back(4);
530 DCHECK(manager_.GetSurfaceForId(id2)); 529 DCHECK(manager_.GetSurfaceForId(id2));
531 factory_->SubmitCompositorFrame(local_frame_id_, std::move(frame), 530 std::vector<uint32_t> sequences = {4, 6};
532 SurfaceFactory::DrawCallback()); 531 manager_.DidSatisfySequences(kArbitraryFrameSinkId, &sequences);
533 DCHECK(!manager_.GetSurfaceForId(id2)); 532 DCHECK(!manager_.GetSurfaceForId(id2));
534 533
535 // Check that waiting after the sequence is satisfied works. 534 // Check that waiting after the sequence is satisfied works.
536 factory2->SubmitCompositorFrame(local_frame_id2, CompositorFrame(), 535 factory2->SubmitCompositorFrame(local_frame_id2, CompositorFrame(),
537 SurfaceFactory::DrawCallback()); 536 SurfaceFactory::DrawCallback());
538 DCHECK(manager_.GetSurfaceForId(id2)); 537 DCHECK(manager_.GetSurfaceForId(id2));
539 manager_.GetSurfaceForId(id2)->AddDestructionDependency( 538 manager_.GetSurfaceForId(id2)->AddDestructionDependency(
540 SurfaceSequence(kAnotherArbitraryFrameSinkId, 6)); 539 SurfaceSequence(kAnotherArbitraryFrameSinkId, 6));
541 factory2->EvictSurface(); 540 factory2->EvictSurface();
542 DCHECK(!manager_.GetSurfaceForId(id2)); 541 DCHECK(!manager_.GetSurfaceForId(id2));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 667
669 factory_->EvictSurface(); 668 factory_->EvictSurface();
670 local_frame_id_ = LocalFrameId(); 669 local_frame_id_ = LocalFrameId();
671 EXPECT_TRUE(called1); 670 EXPECT_TRUE(called1);
672 EXPECT_TRUE(called2); 671 EXPECT_TRUE(called2);
673 EXPECT_TRUE(called3); 672 EXPECT_TRUE(called3);
674 } 673 }
675 674
676 } // namespace 675 } // namespace
677 } // namespace cc 676 } // 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