Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: cc/resources/raster_worker_pool_unittest.cc

Issue 141163019: Re-land: cc: Remove WorkerPool class and instead use TaskGraphRunner directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mode of task_graph_runner.h Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/raster_worker_pool_perftest.cc ('k') | cc/resources/task_graph_runner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 RASTER_THREAD_ORIGIN, 27 RASTER_THREAD_ORIGIN,
28 RASTER_THREAD_WORKER 28 RASTER_THREAD_WORKER
29 }; 29 };
30 typedef base::Callback<void(const PicturePileImpl::Analysis& analysis, 30 typedef base::Callback<void(const PicturePileImpl::Analysis& analysis,
31 bool was_canceled, 31 bool was_canceled,
32 RasterThread raster_thread)> Reply; 32 RasterThread raster_thread)> Reply;
33 33
34 TestRasterWorkerPoolTaskImpl( 34 TestRasterWorkerPoolTaskImpl(
35 const Resource* resource, 35 const Resource* resource,
36 const Reply& reply, 36 const Reply& reply,
37 TaskVector* dependencies, 37 internal::Task::Vector* dependencies,
38 bool use_gpu_rasterization) 38 bool use_gpu_rasterization)
39 : internal::RasterWorkerPoolTask(resource, 39 : internal::RasterWorkerPoolTask(resource,
40 dependencies, 40 dependencies,
41 use_gpu_rasterization), 41 use_gpu_rasterization),
42 reply_(reply), 42 reply_(reply),
43 raster_thread_(RASTER_THREAD_NONE) {} 43 raster_thread_(RASTER_THREAD_NONE) {}
44 44
45 // Overridden from internal::WorkerPoolTask: 45 // Overridden from internal::RasterWorkerPoolTask:
46 virtual bool RunOnWorkerThread(unsigned thread_index, 46 virtual bool RunOnWorkerThread(unsigned thread_index,
47 void* buffer, 47 void* buffer,
48 gfx::Size size, 48 gfx::Size size,
49 int stride) OVERRIDE { 49 int stride) OVERRIDE {
50 raster_thread_ = RASTER_THREAD_WORKER; 50 raster_thread_ = RASTER_THREAD_WORKER;
51 return true; 51 return true;
52 } 52 }
53 virtual void RunOnOriginThread(ResourceProvider* resource_provider, 53 virtual void RunOnOriginThread(ResourceProvider* resource_provider,
54 ContextProvider* context_provider) OVERRIDE { 54 ContextProvider* context_provider) OVERRIDE {
55 raster_thread_ = RASTER_THREAD_ORIGIN; 55 raster_thread_ = RASTER_THREAD_ORIGIN;
(...skipping 12 matching lines...) Expand all
68 RasterThread raster_thread_; 68 RasterThread raster_thread_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(TestRasterWorkerPoolTaskImpl); 70 DISALLOW_COPY_AND_ASSIGN(TestRasterWorkerPoolTaskImpl);
71 }; 71 };
72 72
73 class BlockingRasterWorkerPoolTaskImpl : public TestRasterWorkerPoolTaskImpl { 73 class BlockingRasterWorkerPoolTaskImpl : public TestRasterWorkerPoolTaskImpl {
74 public: 74 public:
75 BlockingRasterWorkerPoolTaskImpl(const Resource* resource, 75 BlockingRasterWorkerPoolTaskImpl(const Resource* resource,
76 const Reply& reply, 76 const Reply& reply,
77 base::Lock* lock, 77 base::Lock* lock,
78 TaskVector* dependencies, 78 internal::Task::Vector* dependencies,
79 bool use_gpu_rasterization) 79 bool use_gpu_rasterization)
80 : TestRasterWorkerPoolTaskImpl(resource, 80 : TestRasterWorkerPoolTaskImpl(resource,
81 reply, 81 reply,
82 dependencies, 82 dependencies,
83 use_gpu_rasterization), 83 use_gpu_rasterization),
84 lock_(lock) {} 84 lock_(lock) {}
85 85
86 // Overridden from TestRasterWorkerPoolTaskImpl: 86 // Overridden from internal::RasterWorkerPoolTask:
87 virtual bool RunOnWorkerThread(unsigned thread_index, 87 virtual bool RunOnWorkerThread(unsigned thread_index,
88 void* buffer, 88 void* buffer,
89 gfx::Size size, 89 gfx::Size size,
90 int stride) OVERRIDE { 90 int stride) OVERRIDE {
91 base::AutoLock lock(*lock_); 91 base::AutoLock lock(*lock_);
92 return TestRasterWorkerPoolTaskImpl::RunOnWorkerThread( 92 return TestRasterWorkerPoolTaskImpl::RunOnWorkerThread(
93 thread_index, buffer, size, stride); 93 thread_index, buffer, size, stride);
94 } 94 }
95 virtual void CompleteOnOriginThread() OVERRIDE {} 95 virtual void CompleteOnOriginThread() OVERRIDE {}
96 96
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 462 }
463 463
464 base::Lock lock_; 464 base::Lock lock_;
465 }; 465 };
466 466
467 PIXEL_BUFFER_AND_IMAGE_TEST_F(RasterWorkerPoolTestFalseThrottling); 467 PIXEL_BUFFER_AND_IMAGE_TEST_F(RasterWorkerPoolTestFalseThrottling);
468 468
469 } // namespace 469 } // namespace
470 470
471 } // namespace cc 471 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool_perftest.cc ('k') | cc/resources/task_graph_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698