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/resources/raster_worker_pool.h" | 5 #include "cc/resources/raster_worker_pool.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/resources/image_raster_worker_pool.h" | 10 #include "cc/resources/image_raster_worker_pool.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 did_raster_(false) {} | 35 did_raster_(false) {} |
36 | 36 |
37 // Overridden from internal::WorkerPoolTask: | 37 // Overridden from internal::WorkerPoolTask: |
38 virtual bool RunOnWorkerThread(unsigned thread_index, | 38 virtual bool RunOnWorkerThread(unsigned thread_index, |
39 void* buffer, | 39 void* buffer, |
40 gfx::Size size, | 40 gfx::Size size, |
41 int stride) OVERRIDE { | 41 int stride) OVERRIDE { |
42 did_raster_ = true; | 42 did_raster_ = true; |
43 return true; | 43 return true; |
44 } | 44 } |
| 45 virtual void RunOnOriginThread() OVERRIDE { |
| 46 did_raster_ = true; |
| 47 } |
45 virtual void CompleteOnOriginThread() OVERRIDE { | 48 virtual void CompleteOnOriginThread() OVERRIDE { |
46 reply_.Run(PicturePileImpl::Analysis(), !HasFinishedRunning(), did_raster_); | 49 reply_.Run(PicturePileImpl::Analysis(), !HasFinishedRunning(), did_raster_); |
47 } | 50 } |
48 | 51 |
49 protected: | 52 protected: |
50 virtual ~TestRasterWorkerPoolTaskImpl() {} | 53 virtual ~TestRasterWorkerPoolTaskImpl() {} |
51 | 54 |
52 private: | 55 private: |
53 const Reply reply_; | 56 const Reply reply_; |
54 bool did_raster_; | 57 bool did_raster_; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 return resource_provider_.get(); | 100 return resource_provider_.get(); |
98 } | 101 } |
99 | 102 |
100 RasterWorkerPool* worker_pool() { | 103 RasterWorkerPool* worker_pool() { |
101 return raster_worker_pool_.get(); | 104 return raster_worker_pool_.get(); |
102 } | 105 } |
103 | 106 |
104 void RunTest(bool use_map_image) { | 107 void RunTest(bool use_map_image) { |
105 if (use_map_image) { | 108 if (use_map_image) { |
106 raster_worker_pool_ = ImageRasterWorkerPool::Create( | 109 raster_worker_pool_ = ImageRasterWorkerPool::Create( |
107 resource_provider(), 1, GL_TEXTURE_2D); | 110 resource_provider(), NULL, 1, GL_TEXTURE_2D); |
108 } else { | 111 } else { |
109 raster_worker_pool_ = | 112 raster_worker_pool_ = |
110 PixelBufferRasterWorkerPool::Create( | 113 PixelBufferRasterWorkerPool::Create( |
111 resource_provider(), | 114 resource_provider(), |
| 115 NULL, |
112 1, | 116 1, |
113 std::numeric_limits<size_t>::max()); | 117 std::numeric_limits<size_t>::max()); |
114 } | 118 } |
115 | 119 |
116 raster_worker_pool_->SetClient(this); | 120 raster_worker_pool_->SetClient(this); |
117 | 121 |
118 BeginTest(); | 122 BeginTest(); |
119 | 123 |
120 ScheduleCheckForCompletedTasks(); | 124 ScheduleCheckForCompletedTasks(); |
121 | 125 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 ASSERT_EQ(1u, tasks_.size()); | 287 ASSERT_EQ(1u, tasks_.size()); |
284 tasks_.clear(); | 288 tasks_.clear(); |
285 } | 289 } |
286 }; | 290 }; |
287 | 291 |
288 PIXEL_BUFFER_AND_IMAGE_TEST_F(RasterWorkerPoolTestFailedMapResource); | 292 PIXEL_BUFFER_AND_IMAGE_TEST_F(RasterWorkerPoolTestFailedMapResource); |
289 | 293 |
290 } // namespace | 294 } // namespace |
291 | 295 |
292 } // namespace cc | 296 } // namespace cc |
OLD | NEW |