| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |