summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/layers/picture_image_layer_impl_unittest.cc3
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc10
-rw-r--r--cc/resources/direct_raster_worker_pool.cc10
-rw-r--r--cc/resources/direct_raster_worker_pool.h4
-rw-r--r--cc/resources/image_raster_worker_pool.cc10
-rw-r--r--cc/resources/image_raster_worker_pool.h4
-rw-r--r--cc/resources/pixel_buffer_raster_worker_pool.cc11
-rw-r--r--cc/resources/pixel_buffer_raster_worker_pool.h4
-rw-r--r--cc/resources/raster_worker_pool.cc24
-rw-r--r--cc/resources/raster_worker_pool.h5
-rw-r--r--cc/resources/raster_worker_pool_delegate.cc9
-rw-r--r--cc/resources/raster_worker_pool_delegate.h3
-rw-r--r--cc/resources/raster_worker_pool_perftest.cc10
-rw-r--r--cc/resources/raster_worker_pool_unittest.cc9
-rw-r--r--cc/resources/tile_manager.cc19
-rw-r--r--cc/resources/tile_manager.h2
-rw-r--r--cc/test/fake_impl_proxy.h4
-rw-r--r--cc/test/fake_tile_manager.cc6
-rw-r--r--cc/trees/layer_tree_host_impl.cc2
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc2
20 files changed, 101 insertions, 50 deletions
diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc
index ce4c26c..4eefa7f 100644
--- a/cc/layers/picture_image_layer_impl_unittest.cc
+++ b/cc/layers/picture_image_layer_impl_unittest.cc
@@ -32,7 +32,8 @@ class TestablePictureImageLayerImpl : public PictureImageLayerImpl {
class PictureImageLayerImplTest : public testing::Test {
public:
PictureImageLayerImplTest()
- : host_impl_(ImplSidePaintingSettings(), &proxy_) {
+ : proxy_(base::MessageLoopProxy::current()),
+ host_impl_(ImplSidePaintingSettings(), &proxy_) {
tiling_client_.SetTileSize(ImplSidePaintingSettings().default_tile_size);
host_impl_.CreatePendingTree();
host_impl_.InitializeRenderer(
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 62edc57..02c8e6c 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -40,10 +40,9 @@ class MockCanvas : public SkCanvas {
class PictureLayerImplTest : public testing::Test {
public:
PictureLayerImplTest()
- : host_impl_(ImplSidePaintingSettings(), &proxy_), id_(7) {}
-
- explicit PictureLayerImplTest(const LayerTreeSettings& settings)
- : host_impl_(settings, &proxy_), id_(7) {}
+ : proxy_(base::MessageLoopProxy::current()),
+ host_impl_(ImplSidePaintingSettings(), &proxy_),
+ id_(7) {}
virtual ~PictureLayerImplTest() {
}
@@ -1509,9 +1508,6 @@ TEST_F(PictureLayerImplTest, PinchingTooSmall) {
class DeferredInitPictureLayerImplTest : public PictureLayerImplTest {
public:
- DeferredInitPictureLayerImplTest()
- : PictureLayerImplTest(ImplSidePaintingSettings()) {}
-
virtual void InitializeRenderer() OVERRIDE {
host_impl_.InitializeRenderer(FakeOutputSurface::CreateDeferredGL(
scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice))
diff --git a/cc/resources/direct_raster_worker_pool.cc b/cc/resources/direct_raster_worker_pool.cc
index ba08306..fb0eab5 100644
--- a/cc/resources/direct_raster_worker_pool.cc
+++ b/cc/resources/direct_raster_worker_pool.cc
@@ -14,16 +14,18 @@ namespace cc {
// static
scoped_ptr<RasterWorkerPool> DirectRasterWorkerPool::Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider) {
- return make_scoped_ptr<RasterWorkerPool>(
- new DirectRasterWorkerPool(resource_provider, context_provider));
+ return make_scoped_ptr<RasterWorkerPool>(new DirectRasterWorkerPool(
+ task_runner, resource_provider, context_provider));
}
DirectRasterWorkerPool::DirectRasterWorkerPool(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider)
- : RasterWorkerPool(NULL, resource_provider),
+ : RasterWorkerPool(task_runner, NULL, resource_provider),
context_provider_(context_provider),
run_tasks_on_origin_thread_pending_(false),
raster_tasks_pending_(false),
@@ -131,7 +133,7 @@ void DirectRasterWorkerPool::ScheduleRunTasksOnOriginThread() {
if (run_tasks_on_origin_thread_pending_)
return;
- base::MessageLoopProxy::current()->PostTask(
+ task_runner()->PostTask(
FROM_HERE,
base::Bind(&DirectRasterWorkerPool::RunTasksOnOriginThread,
weak_factory_.GetWeakPtr()));
diff --git a/cc/resources/direct_raster_worker_pool.h b/cc/resources/direct_raster_worker_pool.h
index 8dc8942..d2a6fd5 100644
--- a/cc/resources/direct_raster_worker_pool.h
+++ b/cc/resources/direct_raster_worker_pool.h
@@ -16,6 +16,7 @@ class CC_EXPORT DirectRasterWorkerPool : public RasterWorkerPool {
virtual ~DirectRasterWorkerPool();
static scoped_ptr<RasterWorkerPool> Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider);
@@ -32,7 +33,8 @@ class CC_EXPORT DirectRasterWorkerPool : public RasterWorkerPool {
const Resource* resource) OVERRIDE;
protected:
- DirectRasterWorkerPool(ResourceProvider* resource_provider,
+ DirectRasterWorkerPool(base::SequencedTaskRunner* task_runner,
+ ResourceProvider* resource_provider,
ContextProvider* context_provider);
private:
diff --git a/cc/resources/image_raster_worker_pool.cc b/cc/resources/image_raster_worker_pool.cc
index a892b3e..bffebf2 100644
--- a/cc/resources/image_raster_worker_pool.cc
+++ b/cc/resources/image_raster_worker_pool.cc
@@ -13,19 +13,19 @@ namespace cc {
// static
scoped_ptr<RasterWorkerPool> ImageRasterWorkerPool::Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
unsigned texture_target) {
- return make_scoped_ptr<RasterWorkerPool>(
- new ImageRasterWorkerPool(GetTaskGraphRunner(),
- resource_provider,
- texture_target));
+ return make_scoped_ptr<RasterWorkerPool>(new ImageRasterWorkerPool(
+ task_runner, GetTaskGraphRunner(), resource_provider, texture_target));
}
ImageRasterWorkerPool::ImageRasterWorkerPool(
+ base::SequencedTaskRunner* task_runner,
internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
unsigned texture_target)
- : RasterWorkerPool(task_graph_runner, resource_provider),
+ : RasterWorkerPool(task_runner, task_graph_runner, resource_provider),
texture_target_(texture_target),
raster_tasks_pending_(false),
raster_tasks_required_for_activation_pending_(false) {}
diff --git a/cc/resources/image_raster_worker_pool.h b/cc/resources/image_raster_worker_pool.h
index aa7817b..4f28929 100644
--- a/cc/resources/image_raster_worker_pool.h
+++ b/cc/resources/image_raster_worker_pool.h
@@ -14,6 +14,7 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool {
virtual ~ImageRasterWorkerPool();
static scoped_ptr<RasterWorkerPool> Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
unsigned texture_target);
@@ -30,7 +31,8 @@ class CC_EXPORT ImageRasterWorkerPool : public RasterWorkerPool {
const Resource* resource) OVERRIDE;
protected:
- ImageRasterWorkerPool(internal::TaskGraphRunner* task_graph_runner,
+ ImageRasterWorkerPool(base::SequencedTaskRunner* task_runner,
+ internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
unsigned texture_target);
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index 752cbcd..af3a086 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -24,19 +24,22 @@ typedef base::StackVector<internal::WorkerPoolTask*, kMaxScheduledRasterTasks>
// static
scoped_ptr<RasterWorkerPool> PixelBufferRasterWorkerPool::Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
size_t max_transfer_buffer_usage_bytes) {
return make_scoped_ptr<RasterWorkerPool>(
- new PixelBufferRasterWorkerPool(GetTaskGraphRunner(),
+ new PixelBufferRasterWorkerPool(task_runner,
+ GetTaskGraphRunner(),
resource_provider,
max_transfer_buffer_usage_bytes));
}
PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool(
+ base::SequencedTaskRunner* task_runner,
internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
size_t max_transfer_buffer_usage_bytes)
- : RasterWorkerPool(task_graph_runner, resource_provider),
+ : RasterWorkerPool(task_runner, task_graph_runner, resource_provider),
shutdown_(false),
scheduled_raster_task_count_(0u),
raster_tasks_required_for_activation_count_(0u),
@@ -373,7 +376,7 @@ void PixelBufferRasterWorkerPool::ScheduleCheckForCompletedRasterTasks() {
if (check_for_completed_raster_tasks_pending_)
return;
- base::MessageLoopProxy::current()->PostDelayedTask(
+ task_runner()->PostDelayedTask(
FROM_HERE,
base::Bind(&PixelBufferRasterWorkerPool::OnCheckForCompletedRasterTasks,
weak_factory_.GetWeakPtr()),
@@ -393,7 +396,7 @@ void PixelBufferRasterWorkerPool::OnCheckForCompletedRasterTasks() {
// Post another delayed task if it is not yet time to check for completed
// raster tasks.
if (delay > base::TimeDelta()) {
- base::MessageLoopProxy::current()->PostDelayedTask(
+ task_runner()->PostDelayedTask(
FROM_HERE,
base::Bind(&PixelBufferRasterWorkerPool::OnCheckForCompletedRasterTasks,
weak_factory_.GetWeakPtr()),
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.h b/cc/resources/pixel_buffer_raster_worker_pool.h
index fe34d1b..61ed979 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.h
+++ b/cc/resources/pixel_buffer_raster_worker_pool.h
@@ -28,6 +28,7 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool {
virtual ~PixelBufferRasterWorkerPool();
static scoped_ptr<RasterWorkerPool> Create(
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
size_t max_transfer_buffer_usage_bytes);
@@ -45,7 +46,8 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool {
const Resource* resource) OVERRIDE;
protected:
- PixelBufferRasterWorkerPool(internal::TaskGraphRunner* task_graph_runner,
+ PixelBufferRasterWorkerPool(base::SequencedTaskRunner* task_runner,
+ internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
size_t max_transfer_buffer_usage_bytes);
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index 859f57e..e1470c4 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -297,8 +297,9 @@ class RasterFinishedWorkerPoolTaskImpl : public internal::WorkerPoolTask {
typedef base::Callback<void(const internal::WorkerPoolTask* source)> Callback;
explicit RasterFinishedWorkerPoolTaskImpl(
+ base::SequencedTaskRunner* task_runner,
const Callback& on_raster_finished_callback)
- : origin_loop_(base::MessageLoopProxy::current().get()),
+ : task_runner_(task_runner),
on_raster_finished_callback_(on_raster_finished_callback) {}
// Overridden from internal::Task:
@@ -322,7 +323,7 @@ class RasterFinishedWorkerPoolTaskImpl : public internal::WorkerPoolTask {
virtual ~RasterFinishedWorkerPoolTaskImpl() {}
void RasterFinished() {
- origin_loop_->PostTask(
+ task_runner_->PostTask(
FROM_HERE,
base::Bind(
&RasterFinishedWorkerPoolTaskImpl::OnRasterFinishedOnOriginThread,
@@ -334,7 +335,7 @@ class RasterFinishedWorkerPoolTaskImpl : public internal::WorkerPoolTask {
on_raster_finished_callback_.Run(this);
}
- scoped_refptr<base::MessageLoopProxy> origin_loop_;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
const Callback on_raster_finished_callback_;
DISALLOW_COPY_AND_ASSIGN(RasterFinishedWorkerPoolTaskImpl);
@@ -344,9 +345,11 @@ class RasterRequiredForActivationFinishedWorkerPoolTaskImpl
: public RasterFinishedWorkerPoolTaskImpl {
public:
RasterRequiredForActivationFinishedWorkerPoolTaskImpl(
+ base::SequencedTaskRunner* task_runner,
const Callback& on_raster_finished_callback,
size_t tasks_required_for_activation_count)
- : RasterFinishedWorkerPoolTaskImpl(on_raster_finished_callback),
+ : RasterFinishedWorkerPoolTaskImpl(task_runner,
+ on_raster_finished_callback),
tasks_required_for_activation_count_(
tasks_required_for_activation_count) {
if (tasks_required_for_activation_count_) {
@@ -475,9 +478,11 @@ unsigned RasterWorkerPool::kRasterRequiredForActivationFinishedTaskPriority =
1u;
unsigned RasterWorkerPool::kRasterTaskPriorityBase = 3u;
-RasterWorkerPool::RasterWorkerPool(internal::TaskGraphRunner* task_graph_runner,
+RasterWorkerPool::RasterWorkerPool(base::SequencedTaskRunner* task_runner,
+ internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider)
- : task_graph_runner_(task_graph_runner),
+ : task_runner_(task_runner),
+ task_graph_runner_(task_graph_runner),
client_(NULL),
resource_provider_(resource_provider),
weak_ptr_factory_(this) {
@@ -594,8 +599,10 @@ void RasterWorkerPool::CollectCompletedWorkerPoolTasks(
scoped_refptr<internal::WorkerPoolTask>
RasterWorkerPool::CreateRasterFinishedTask() {
- return make_scoped_refptr(new RasterFinishedWorkerPoolTaskImpl(base::Bind(
- &RasterWorkerPool::OnRasterFinished, weak_ptr_factory_.GetWeakPtr())));
+ return make_scoped_refptr(new RasterFinishedWorkerPoolTaskImpl(
+ task_runner_,
+ base::Bind(&RasterWorkerPool::OnRasterFinished,
+ weak_ptr_factory_.GetWeakPtr())));
}
scoped_refptr<internal::WorkerPoolTask>
@@ -603,6 +610,7 @@ RasterWorkerPool::CreateRasterRequiredForActivationFinishedTask(
size_t tasks_required_for_activation_count) {
return make_scoped_refptr(
new RasterRequiredForActivationFinishedWorkerPoolTaskImpl(
+ task_runner_,
base::Bind(&RasterWorkerPool::OnRasterRequiredForActivationFinished,
weak_ptr_factory_.GetWeakPtr()),
tasks_required_for_activation_count));
diff --git a/cc/resources/raster_worker_pool.h b/cc/resources/raster_worker_pool.h
index a0ce885..520efba 100644
--- a/cc/resources/raster_worker_pool.h
+++ b/cc/resources/raster_worker_pool.h
@@ -192,7 +192,8 @@ class CC_EXPORT RasterWorkerPool : public internal::WorkerPoolTaskClient {
typedef std::vector<scoped_refptr<internal::RasterWorkerPoolTask> >
RasterTaskVector;
- RasterWorkerPool(internal::TaskGraphRunner* task_graph_runner,
+ RasterWorkerPool(base::SequencedTaskRunner* task_runner,
+ internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider);
virtual void OnRasterTasksFinished() = 0;
@@ -201,6 +202,7 @@ class CC_EXPORT RasterWorkerPool : public internal::WorkerPoolTaskClient {
void SetTaskGraph(internal::TaskGraph* graph);
void CollectCompletedWorkerPoolTasks(internal::Task::Vector* completed_tasks);
+ base::SequencedTaskRunner* task_runner() const { return task_runner_; }
RasterWorkerPoolClient* client() const { return client_; }
ResourceProvider* resource_provider() const { return resource_provider_; }
@@ -244,6 +246,7 @@ class CC_EXPORT RasterWorkerPool : public internal::WorkerPoolTaskClient {
void OnRasterRequiredForActivationFinished(
const internal::WorkerPoolTask* source);
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
internal::TaskGraphRunner* task_graph_runner_;
internal::NamespaceToken namespace_token_;
RasterWorkerPoolClient* client_;
diff --git a/cc/resources/raster_worker_pool_delegate.cc b/cc/resources/raster_worker_pool_delegate.cc
index f91f25a..690b135 100644
--- a/cc/resources/raster_worker_pool_delegate.cc
+++ b/cc/resources/raster_worker_pool_delegate.cc
@@ -4,15 +4,15 @@
#include "cc/resources/raster_worker_pool_delegate.h"
-#include "base/message_loop/message_loop_proxy.h"
-
namespace cc {
RasterWorkerPoolDelegate::RasterWorkerPoolDelegate(
RasterWorkerPoolClient* client,
+ base::SequencedTaskRunner* task_runner,
RasterWorkerPool** raster_worker_pools,
size_t num_raster_worker_pools)
: client_(client),
+ task_runner_(task_runner),
raster_worker_pools_(raster_worker_pools,
raster_worker_pools + num_raster_worker_pools),
did_finish_running_tasks_pending_(num_raster_worker_pools, false),
@@ -32,10 +32,11 @@ RasterWorkerPoolDelegate::~RasterWorkerPoolDelegate() {}
// static
scoped_ptr<RasterWorkerPoolDelegate> RasterWorkerPoolDelegate::Create(
RasterWorkerPoolClient* client,
+ base::SequencedTaskRunner* task_runner,
RasterWorkerPool** raster_worker_pools,
size_t num_raster_worker_pools) {
return make_scoped_ptr(new RasterWorkerPoolDelegate(
- client, raster_worker_pools, num_raster_worker_pools));
+ client, task_runner, raster_worker_pools, num_raster_worker_pools));
}
void RasterWorkerPoolDelegate::Shutdown() {
@@ -99,7 +100,7 @@ void RasterWorkerPoolDelegate::ScheduleRunDidFinishRunningTasks() {
if (run_did_finish_running_tasks_pending_)
return;
- base::MessageLoopProxy::current()->PostTask(
+ task_runner_->PostTask(
FROM_HERE,
base::Bind(&RasterWorkerPoolDelegate::OnRunDidFinishRunningTasks,
weak_ptr_factory_.GetWeakPtr()));
diff --git a/cc/resources/raster_worker_pool_delegate.h b/cc/resources/raster_worker_pool_delegate.h
index 1d7234e..3eec088 100644
--- a/cc/resources/raster_worker_pool_delegate.h
+++ b/cc/resources/raster_worker_pool_delegate.h
@@ -18,6 +18,7 @@ class RasterWorkerPoolDelegate : public RasterWorkerPoolClient {
static scoped_ptr<RasterWorkerPoolDelegate> Create(
RasterWorkerPoolClient* client,
+ base::SequencedTaskRunner* task_runner,
RasterWorkerPool** raster_worker_pools,
size_t num_raster_worker_pools);
@@ -33,6 +34,7 @@ class RasterWorkerPoolDelegate : public RasterWorkerPoolClient {
private:
RasterWorkerPoolDelegate(RasterWorkerPoolClient* client,
+ base::SequencedTaskRunner* task_runner,
RasterWorkerPool** raster_worker_pools,
size_t num_raster_worker_pools);
@@ -41,6 +43,7 @@ class RasterWorkerPoolDelegate : public RasterWorkerPoolClient {
void RunDidFinishRunningTasks();
RasterWorkerPoolClient* client_;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
typedef std::vector<RasterWorkerPool*> RasterWorkerPoolVector;
RasterWorkerPoolVector raster_worker_pools_;
std::vector<bool> did_finish_running_tasks_pending_;
diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc
index dfd3955..9fb7dfc 100644
--- a/cc/resources/raster_worker_pool_perftest.cc
+++ b/cc/resources/raster_worker_pool_perftest.cc
@@ -104,7 +104,8 @@ class PerfPixelBufferRasterWorkerPoolImpl : public PixelBufferRasterWorkerPool {
PerfPixelBufferRasterWorkerPoolImpl(
internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider)
- : PixelBufferRasterWorkerPool(task_graph_runner,
+ : PixelBufferRasterWorkerPool(base::MessageLoopProxy::current().get(),
+ task_graph_runner,
resource_provider,
std::numeric_limits<size_t>::max()) {}
};
@@ -113,7 +114,8 @@ class PerfImageRasterWorkerPoolImpl : public ImageRasterWorkerPool {
public:
PerfImageRasterWorkerPoolImpl(internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider)
- : ImageRasterWorkerPool(task_graph_runner,
+ : ImageRasterWorkerPool(base::MessageLoopProxy::current().get(),
+ task_graph_runner,
resource_provider,
GL_TEXTURE_2D) {}
};
@@ -122,7 +124,9 @@ class PerfDirectRasterWorkerPoolImpl : public DirectRasterWorkerPool {
public:
PerfDirectRasterWorkerPoolImpl(ResourceProvider* resource_provider,
ContextProvider* context_provider)
- : DirectRasterWorkerPool(resource_provider, context_provider) {}
+ : DirectRasterWorkerPool(base::MessageLoopProxy::current().get(),
+ resource_provider,
+ context_provider) {}
};
class RasterWorkerPoolPerfTestBase {
diff --git a/cc/resources/raster_worker_pool_unittest.cc b/cc/resources/raster_worker_pool_unittest.cc
index 791273d..613c946 100644
--- a/cc/resources/raster_worker_pool_unittest.cc
+++ b/cc/resources/raster_worker_pool_unittest.cc
@@ -135,16 +135,21 @@ class RasterWorkerPoolTest
switch (GetParam()) {
case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER:
raster_worker_pool_ = PixelBufferRasterWorkerPool::Create(
+ base::MessageLoopProxy::current().get(),
resource_provider_.get(),
std::numeric_limits<size_t>::max());
break;
case RASTER_WORKER_POOL_TYPE_IMAGE:
raster_worker_pool_ = ImageRasterWorkerPool::Create(
- resource_provider_.get(), GL_TEXTURE_2D);
+ base::MessageLoopProxy::current().get(),
+ resource_provider_.get(),
+ GL_TEXTURE_2D);
break;
case RASTER_WORKER_POOL_TYPE_DIRECT:
raster_worker_pool_ = DirectRasterWorkerPool::Create(
- resource_provider_.get(), context_provider_.get());
+ base::MessageLoopProxy::current().get(),
+ resource_provider_.get(),
+ context_provider_.get());
break;
}
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index f36a2cd..c2cb67b 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -148,6 +148,7 @@ scoped_ptr<base::Value> RasterTaskCompletionStatsAsValue(
// static
scoped_ptr<TileManager> TileManager::Create(
TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
@@ -158,13 +159,18 @@ scoped_ptr<TileManager> TileManager::Create(
unsigned map_image_texture_target) {
return make_scoped_ptr(new TileManager(
client,
+ task_runner,
resource_provider,
context_provider,
- use_map_image ? ImageRasterWorkerPool::Create(resource_provider,
- map_image_texture_target)
- : PixelBufferRasterWorkerPool::Create(
- resource_provider, max_transfer_buffer_usage_bytes),
- DirectRasterWorkerPool::Create(resource_provider, context_provider),
+ use_map_image
+ ? ImageRasterWorkerPool::Create(
+ task_runner, resource_provider, map_image_texture_target)
+ : PixelBufferRasterWorkerPool::Create(
+ task_runner,
+ resource_provider,
+ max_transfer_buffer_usage_bytes),
+ DirectRasterWorkerPool::Create(
+ task_runner, resource_provider, context_provider),
max_raster_usage_bytes,
rendering_stats_instrumentation,
use_rasterize_on_demand));
@@ -172,6 +178,7 @@ scoped_ptr<TileManager> TileManager::Create(
TileManager::TileManager(
TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider,
scoped_ptr<RasterWorkerPool> raster_worker_pool,
@@ -205,7 +212,7 @@ TileManager::TileManager(
direct_raster_worker_pool_.get() // RASTER_WORKER_POOL_TYPE_DIRECT
};
raster_worker_pool_delegate_ = RasterWorkerPoolDelegate::Create(
- this, raster_worker_pools, arraysize(raster_worker_pools));
+ this, task_runner, raster_worker_pools, arraysize(raster_worker_pools));
}
TileManager::~TileManager() {
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index 1a33876..d691d035 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -52,6 +52,7 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient,
public:
static scoped_ptr<TileManager> Create(
TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
@@ -118,6 +119,7 @@ class CC_EXPORT TileManager : public RasterWorkerPoolClient,
protected:
TileManager(TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
ResourceProvider* resource_provider,
ContextProvider* context_provider,
scoped_ptr<RasterWorkerPool> raster_worker_pool,
diff --git a/cc/test/fake_impl_proxy.h b/cc/test/fake_impl_proxy.h
index b52fea4..b401bb9 100644
--- a/cc/test/fake_impl_proxy.h
+++ b/cc/test/fake_impl_proxy.h
@@ -14,6 +14,10 @@ class FakeImplProxy : public FakeProxy {
public:
FakeImplProxy() : set_impl_thread_(this) {}
+ explicit FakeImplProxy(
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
+ : FakeProxy(impl_task_runner), set_impl_thread_(this) {}
+
private:
DebugScopedSetImplThread set_impl_thread_;
};
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc
index cbd09f2..cf797f1 100644
--- a/cc/test/fake_tile_manager.cc
+++ b/cc/test/fake_tile_manager.cc
@@ -15,7 +15,7 @@ namespace {
class FakeRasterWorkerPool : public RasterWorkerPool {
public:
- FakeRasterWorkerPool() : RasterWorkerPool(NULL, NULL) {}
+ FakeRasterWorkerPool() : RasterWorkerPool(NULL, NULL, NULL) {}
// Overridden from RasterWorkerPool:
virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE {
@@ -72,6 +72,7 @@ class FakeRasterWorkerPool : public RasterWorkerPool {
FakeTileManager::FakeTileManager(TileManagerClient* client)
: TileManager(client,
+ base::MessageLoopProxy::current().get(),
NULL,
NULL,
make_scoped_ptr<RasterWorkerPool>(new FakeRasterWorkerPool),
@@ -83,6 +84,7 @@ FakeTileManager::FakeTileManager(TileManagerClient* client)
FakeTileManager::FakeTileManager(TileManagerClient* client,
ResourceProvider* resource_provider)
: TileManager(client,
+ base::MessageLoopProxy::current().get(),
resource_provider,
NULL,
make_scoped_ptr<RasterWorkerPool>(new FakeRasterWorkerPool),
@@ -95,6 +97,7 @@ FakeTileManager::FakeTileManager(TileManagerClient* client,
ResourceProvider* resource_provider,
bool allow_on_demand_raster)
: TileManager(client,
+ base::MessageLoopProxy::current().get(),
resource_provider,
NULL,
make_scoped_ptr<RasterWorkerPool>(new FakeRasterWorkerPool),
@@ -107,6 +110,7 @@ FakeTileManager::FakeTileManager(TileManagerClient* client,
ResourceProvider* resource_provider,
size_t raster_task_limit_bytes)
: TileManager(client,
+ base::MessageLoopProxy::current().get(),
resource_provider,
NULL,
make_scoped_ptr<RasterWorkerPool>(new FakeRasterWorkerPool),
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 1789640..50a6c41 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1772,8 +1772,10 @@ void LayerTreeHostImpl::CreateAndSetTileManager(
bool allow_rasterize_on_demand) {
DCHECK(settings_.impl_side_painting);
DCHECK(resource_provider);
+ DCHECK(proxy_->ImplThreadTaskRunner());
tile_manager_ =
TileManager::Create(this,
+ proxy_->ImplThreadTaskRunner(),
resource_provider,
context_provider,
rendering_stats_instrumentation_,
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 2333d97..006ac196 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -75,7 +75,7 @@ class LayerTreeHostImplTest : public testing::Test,
public LayerTreeHostImplClient {
public:
LayerTreeHostImplTest()
- : proxy_(),
+ : proxy_(base::MessageLoopProxy::current()),
always_impl_thread_(&proxy_),
always_main_thread_blocked_(&proxy_),
on_can_draw_state_changed_called_(false),