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

Unified Diff: cc/resources/raster_worker_pool.cc

Issue 83183005: Add synthetic delay points for latency testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Begin delay on one thread and end it on another. Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/raster_worker_pool.cc
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index 67c548f19df92fe1f0990475689a157718a7d392..60a780b2e75702dc0ca2266c618b37bf582fbabb 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -4,6 +4,7 @@
#include "cc/resources/raster_worker_pool.h"
+#include "base/debug/trace_event_synthetic_delay.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "base/values.h"
@@ -18,6 +19,10 @@ namespace cc {
namespace {
+// Synthetic delay for raster tasks that are required for activation. Global to
+// avoid static initializer on critical path.
+base::debug::TraceEventSyntheticDelay* g_raster_required_for_activation_delay;
+
// Subclass of Allocator that takes a suitably allocated pointer and uses
// it as the pixel memory for the bitmap.
class IdentityAllocator : public SkBitmap::Allocator {
@@ -191,6 +196,7 @@ class RasterWorkerPoolTaskImpl : public internal::RasterWorkerPoolTask {
}
ChangeBitmapConfigIfNeeded(bitmap, buffer);
+ g_raster_required_for_activation_delay->End();
return true;
}
@@ -466,6 +472,9 @@ RasterWorkerPool::RasterWorkerPool(ResourceProvider* resource_provider,
client_(NULL),
resource_provider_(resource_provider),
weak_ptr_factory_(this) {
+ g_raster_required_for_activation_delay =
+ base::debug::TraceEventSyntheticDelay::Lookup(
+ "cc.RasterRequiredForActivation");
}
RasterWorkerPool::~RasterWorkerPool() {
@@ -487,6 +496,10 @@ void RasterWorkerPool::SetRasterTasks(RasterTask::Queue* queue) {
raster_tasks_.swap(queue->tasks_);
raster_tasks_required_for_activation_.swap(
queue->tasks_required_for_activation_);
+ if (!raster_tasks_required_for_activation_.empty()) {
+ g_raster_required_for_activation_delay->ResetAndBeginMultiple(
+ raster_tasks_required_for_activation_.size());
+ }
}
bool RasterWorkerPool::IsRasterTaskRequiredForActivation(

Powered by Google App Engine
This is Rietveld 408576698