From 666d7cffc8025696c6743889fcd4c9bb2980ba70 Mon Sep 17 00:00:00 2001
From: "vmpstr@chromium.org"
 <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Sat, 12 Oct 2013 01:30:29 +0000
Subject: cc: Add MicroBenchmarkController plumbing.

This patch adds the necessary plumbing for micro benchmark controller.
The plan is as follows:

- MicroBenchmarkController will live on LayerTreeHost
- The schedule functionality will be exposed to
  gpu benchmarking extension
- Javascript bindings will allow external code to schedule certain
  benchmarks (specified by name) to be run right after Layer::Update.

R=enne@chromium.org,nduca@chromium.org

Review URL: https://codereview.chromium.org/26593002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228299 0039d316-1c4b-4281-b951-d872f2087c98
---
 cc/layers/layer.cc | 4 ++++
 cc/layers/layer.h  | 3 +++
 2 files changed, 7 insertions(+)

(limited to 'cc/layers')

diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 5a9f859..15de223 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1086,4 +1086,8 @@ void Layer::RemoveFromClipTree() {
   clip_parent_ = NULL;
 }
 
+void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) {
+  benchmark->RunOnLayer(this);
+}
+
 }  // namespace cc
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 1f8c8ac..6f391ac 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -16,6 +16,7 @@
 #include "cc/base/cc_export.h"
 #include "cc/base/region.h"
 #include "cc/base/scoped_ptr_vector.h"
+#include "cc/debug/micro_benchmark.h"
 #include "cc/layers/compositing_reasons.h"
 #include "cc/layers/draw_properties.h"
 #include "cc/layers/layer_lists.h"
@@ -425,6 +426,8 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
     return num_dependents_need_push_properties_ > 0;
   }
 
+  virtual void RunMicroBenchmark(MicroBenchmark* benchmark);
+
  protected:
   friend class LayerImpl;
   friend class TreeSynchronizer;
-- 
cgit v1.1