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

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

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/surface_aggregator_unittest.cc ('k') | cc/test/animation_test_common.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 "base/bind.h" 5 #include "base/bind.h"
6 #include "cc/output/compositor_frame.h" 6 #include "cc/output/compositor_frame.h"
7 #include "cc/output/delegated_frame_data.h" 7 #include "cc/output/delegated_frame_data.h"
8 #include "cc/surfaces/surface.h" 8 #include "cc/surfaces/surface.h"
9 #include "cc/surfaces/surface_factory.h" 9 #include "cc/surfaces/surface_factory.h"
10 #include "cc/surfaces/surface_factory_client.h" 10 #include "cc/surfaces/surface_factory_client.h"
(...skipping 25 matching lines...) Expand all
36 36
37 DISALLOW_COPY_AND_ASSIGN(TestSurfaceFactoryClient); 37 DISALLOW_COPY_AND_ASSIGN(TestSurfaceFactoryClient);
38 }; 38 };
39 39
40 class SurfaceFactoryTest : public testing::Test { 40 class SurfaceFactoryTest : public testing::Test {
41 public: 41 public:
42 SurfaceFactoryTest() : factory_(&manager_, &client_), surface_id_(3) { 42 SurfaceFactoryTest() : factory_(&manager_, &client_), surface_id_(3) {
43 factory_.Create(surface_id_); 43 factory_.Create(surface_id_);
44 } 44 }
45 45
46 virtual ~SurfaceFactoryTest() { 46 ~SurfaceFactoryTest() override {
47 if (!surface_id_.is_null()) 47 if (!surface_id_.is_null())
48 factory_.Destroy(surface_id_); 48 factory_.Destroy(surface_id_);
49 } 49 }
50 50
51 void SubmitFrameWithResources(ResourceProvider::ResourceId* resource_ids, 51 void SubmitFrameWithResources(ResourceProvider::ResourceId* resource_ids,
52 size_t num_resource_ids) { 52 size_t num_resource_ids) {
53 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); 53 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
54 for (size_t i = 0u; i < num_resource_ids; ++i) { 54 for (size_t i = 0u; i < num_resource_ids; ++i) {
55 TransferableResource resource; 55 TransferableResource resource;
56 resource.id = resource_ids[i]; 56 resource.id = resource_ids[i];
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 factory_.Create(id2); 413 factory_.Create(id2);
414 DCHECK(manager_.GetSurfaceForId(id2)); 414 DCHECK(manager_.GetSurfaceForId(id2));
415 manager_.GetSurfaceForId(id2) 415 manager_.GetSurfaceForId(id2)
416 ->AddDestructionDependency(SurfaceSequence(0, 6)); 416 ->AddDestructionDependency(SurfaceSequence(0, 6));
417 factory_.Destroy(id2); 417 factory_.Destroy(id2);
418 DCHECK(!manager_.GetSurfaceForId(id2)); 418 DCHECK(!manager_.GetSurfaceForId(id2));
419 } 419 }
420 420
421 } // namespace 421 } // namespace
422 } // namespace cc 422 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator_unittest.cc ('k') | cc/test/animation_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698