| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2495 TransferableResourceArray list; | 2495 TransferableResourceArray list; |
| 2496 child_resource_provider_->PrepareSendToParent(resource_ids_to_transfer, | 2496 child_resource_provider_->PrepareSendToParent(resource_ids_to_transfer, |
| 2497 &list); | 2497 &list); |
| 2498 | 2498 |
| 2499 EXPECT_FALSE(release_sync_token.HasData()); | 2499 EXPECT_FALSE(release_sync_token.HasData()); |
| 2500 EXPECT_FALSE(lost_resource); | 2500 EXPECT_FALSE(lost_resource); |
| 2501 | 2501 |
| 2502 child_resource_provider_ = nullptr; | 2502 child_resource_provider_ = nullptr; |
| 2503 | 2503 |
| 2504 // Since the resource is in the parent, the child considers it lost. | 2504 // Since the resource is in the parent, the child considers it lost. |
| 2505 EXPECT_FALSE(release_sync_token.HasData()); | |
| 2506 EXPECT_TRUE(lost_resource); | 2505 EXPECT_TRUE(lost_resource); |
| 2507 } | 2506 } |
| 2508 | 2507 |
| 2509 TEST_P(ResourceProviderTest, LostContext) { | 2508 TEST_P(ResourceProviderTest, LostContext) { |
| 2510 // TextureMailbox callbacks only exist for GL textures for now. | 2509 // TextureMailbox callbacks only exist for GL textures for now. |
| 2511 if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE) | 2510 if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE) |
| 2512 return; | 2511 return; |
| 2513 unsigned texture = context()->createTexture(); | 2512 unsigned texture = context()->createTexture(); |
| 2514 context()->bindTexture(GL_TEXTURE_2D, texture); | 2513 context()->bindTexture(GL_TEXTURE_2D, texture); |
| 2515 gpu::Mailbox mailbox; | 2514 gpu::Mailbox mailbox; |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3613 EXPECT_TRUE(resource_provider_->CanLockForWrite(id)); | 3612 EXPECT_TRUE(resource_provider_->CanLockForWrite(id)); |
| 3614 EXPECT_FALSE(resource_provider_->InUseByConsumer(id)); | 3613 EXPECT_FALSE(resource_provider_->InUseByConsumer(id)); |
| 3615 gpu_memory_buffer_manager_->SetGpuMemoryBufferIsInUseByMacOSWindowServer( | 3614 gpu_memory_buffer_manager_->SetGpuMemoryBufferIsInUseByMacOSWindowServer( |
| 3616 gpu_memory_buffer, true); | 3615 gpu_memory_buffer, true); |
| 3617 EXPECT_FALSE(resource_provider_->CanLockForWrite(id)); | 3616 EXPECT_FALSE(resource_provider_->CanLockForWrite(id)); |
| 3618 EXPECT_TRUE(resource_provider_->InUseByConsumer(id)); | 3617 EXPECT_TRUE(resource_provider_->InUseByConsumer(id)); |
| 3619 } | 3618 } |
| 3620 | 3619 |
| 3621 } // namespace | 3620 } // namespace |
| 3622 } // namespace cc | 3621 } // namespace cc |
| OLD | NEW |