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->bytes(), kMaxTransferBufferUsageBytes); | 409 EXPECT_GE(Resource::UncheckedMemorySizeBytes(resource->size(), |
| 410 resource->format()), |
| 411 kMaxTransferBufferUsageBytes); |
410 } | 412 } |
411 | 413 |
412 AppendTask(0u, size); | 414 AppendTask(0u, size); |
413 AppendTask(1u, size); | 415 AppendTask(1u, size); |
414 AppendTask(2u, size); | 416 AppendTask(2u, size); |
415 ScheduleTasks(); | 417 ScheduleTasks(); |
416 | 418 |
417 // 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 |
418 // never gets scheduled. | 420 // never gets scheduled. |
419 RunMessageLoopUntilAllTasksHaveCompleted(); | 421 RunMessageLoopUntilAllTasksHaveCompleted(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 TileTaskWorkerPoolTests, | 455 TileTaskWorkerPoolTests, |
454 TileTaskWorkerPoolTest, | 456 TileTaskWorkerPoolTest, |
455 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, | 457 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_PIXEL_BUFFER, |
456 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, | 458 TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, |
457 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, | 459 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, |
458 TILE_TASK_WORKER_POOL_TYPE_GPU, | 460 TILE_TASK_WORKER_POOL_TYPE_GPU, |
459 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); | 461 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); |
460 | 462 |
461 } // namespace | 463 } // namespace |
462 } // namespace cc | 464 } // namespace cc |
OLD | NEW |