| 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/raster_buffer_provider.h" | 5 #include "cc/raster/raster_buffer_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> |
| 11 #include <limits> | 11 #include <limits> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
| 15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
| 19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
| 20 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "cc/base/scale_translate2d.h" |
| 22 #include "cc/base/unique_notifier.h" | 23 #include "cc/base/unique_notifier.h" |
| 23 #include "cc/raster/bitmap_raster_buffer_provider.h" | 24 #include "cc/raster/bitmap_raster_buffer_provider.h" |
| 24 #include "cc/raster/gpu_raster_buffer_provider.h" | 25 #include "cc/raster/gpu_raster_buffer_provider.h" |
| 25 #include "cc/raster/one_copy_raster_buffer_provider.h" | 26 #include "cc/raster/one_copy_raster_buffer_provider.h" |
| 26 #include "cc/raster/synchronous_task_graph_runner.h" | 27 #include "cc/raster/synchronous_task_graph_runner.h" |
| 27 #include "cc/raster/zero_copy_raster_buffer_provider.h" | 28 #include "cc/raster/zero_copy_raster_buffer_provider.h" |
| 28 #include "cc/resources/platform_color.h" | 29 #include "cc/resources/platform_color.h" |
| 29 #include "cc/resources/resource_pool.h" | 30 #include "cc/resources/resource_pool.h" |
| 30 #include "cc/resources/resource_provider.h" | 31 #include "cc/resources/resource_provider.h" |
| 31 #include "cc/resources/scoped_resource.h" | 32 #include "cc/resources/scoped_resource.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 77 |
| 77 // Overridden from Task: | 78 // Overridden from Task: |
| 78 void RunOnWorkerThread() override { | 79 void RunOnWorkerThread() override { |
| 79 // Don't use the image hijack canvas for these tests, as they have no image | 80 // Don't use the image hijack canvas for these tests, as they have no image |
| 80 // decode controller. | 81 // decode controller. |
| 81 RasterSource::PlaybackSettings settings; | 82 RasterSource::PlaybackSettings settings; |
| 82 settings.use_image_hijack_canvas = false; | 83 settings.use_image_hijack_canvas = false; |
| 83 | 84 |
| 84 uint64_t new_content_id = 0; | 85 uint64_t new_content_id = 0; |
| 85 raster_buffer_->Playback(raster_source_.get(), gfx::Rect(1, 1), | 86 raster_buffer_->Playback(raster_source_.get(), gfx::Rect(1, 1), |
| 86 gfx::Rect(1, 1), new_content_id, 1.f, settings); | 87 gfx::Rect(1, 1), new_content_id, |
| 88 ScaleTranslate2d(), settings); |
| 87 } | 89 } |
| 88 | 90 |
| 89 // Overridden from TileTask: | 91 // Overridden from TileTask: |
| 90 void OnTaskCompleted() override { | 92 void OnTaskCompleted() override { |
| 91 completion_handler_->OnRasterTaskCompleted(std::move(raster_buffer_), id_, | 93 completion_handler_->OnRasterTaskCompleted(std::move(raster_buffer_), id_, |
| 92 state().IsCanceled()); | 94 state().IsCanceled()); |
| 93 } | 95 } |
| 94 | 96 |
| 95 protected: | 97 protected: |
| 96 ~TestRasterTaskImpl() override {} | 98 ~TestRasterTaskImpl() override {} |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 RasterBufferProviderTest, | 455 RasterBufferProviderTest, |
| 454 ::testing::Values(RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY, | 456 ::testing::Values(RASTER_BUFFER_PROVIDER_TYPE_ZERO_COPY, |
| 455 RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY, | 457 RASTER_BUFFER_PROVIDER_TYPE_ONE_COPY, |
| 456 RASTER_BUFFER_PROVIDER_TYPE_ASYNC_ONE_COPY, | 458 RASTER_BUFFER_PROVIDER_TYPE_ASYNC_ONE_COPY, |
| 457 RASTER_BUFFER_PROVIDER_TYPE_GPU, | 459 RASTER_BUFFER_PROVIDER_TYPE_GPU, |
| 458 RASTER_BUFFER_PROVIDER_TYPE_ASYNC_GPU, | 460 RASTER_BUFFER_PROVIDER_TYPE_ASYNC_GPU, |
| 459 RASTER_BUFFER_PROVIDER_TYPE_BITMAP)); | 461 RASTER_BUFFER_PROVIDER_TYPE_BITMAP)); |
| 460 | 462 |
| 461 } // namespace | 463 } // namespace |
| 462 } // namespace cc | 464 } // namespace cc |
| OLD | NEW |