| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/raster/tile_task_worker_pool.h" | 5 #include "cc/raster/tile_task_worker_pool.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 TEST_P(TileTaskWorkerPoolTest, LargeResources) { | 400 TEST_P(TileTaskWorkerPoolTest, LargeResources) { |
| 401 gfx::Size size(kLargeResourceDimension, kLargeResourceDimension); | 401 gfx::Size size(kLargeResourceDimension, kLargeResourceDimension); |
| 402 | 402 |
| 403 { | 403 { |
| 404 // Verify a resource of this size is larger than the transfer buffer. | 404 // Verify a resource of this size is larger than the transfer buffer. |
| 405 scoped_ptr<ScopedResource> resource( | 405 scoped_ptr<ScopedResource> resource( |
| 406 ScopedResource::Create(resource_provider_.get())); | 406 ScopedResource::Create(resource_provider_.get())); |
| 407 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, | 407 resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, |
| 408 RGBA_8888); | 408 RGBA_8888); |
| 409 EXPECT_GE(Resource::UncheckedMemorySizeBytes(resource->size(), | 409 EXPECT_GE(ResourceUtil::UncheckedSizeInBytes<size_t>(resource->size(), |
| 410 resource->format()), | 410 resource->format()), |
| 411 kMaxTransferBufferUsageBytes); | 411 kMaxTransferBufferUsageBytes); |
| 412 } | 412 } |
| 413 | 413 |
| 414 AppendTask(0u, size); | 414 AppendTask(0u, size); |
| 415 AppendTask(1u, size); | 415 AppendTask(1u, size); |
| 416 AppendTask(2u, size); | 416 AppendTask(2u, size); |
| 417 ScheduleTasks(); | 417 ScheduleTasks(); |
| 418 | 418 |
| 419 // This will time out if a resource that is larger than the throttle limit | 419 // This will time out if a resource that is larger than the throttle limit |
| 420 // never gets scheduled. | 420 // never gets scheduled. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 TileTaskWorkerPoolTests, | 455 TileTaskWorkerPoolTests, |
| 456 TileTaskWorkerPoolTest, | 456 TileTaskWorkerPoolTest, |
| 457 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, | 457 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, |
| 458 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 458 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
| 459 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 459 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
| 460 TILE_TASK_WORKER_POOL_TYPE_GPU, | 460 TILE_TASK_WORKER_POOL_TYPE_GPU, |
| 461 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 461 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
| 462 | 462 |
| 463 } // namespace | 463 } // namespace |
| 464 } // namespace cc | 464 } // namespace cc |
| OLD | NEW |