summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authorskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 22:28:45 +0000
committerskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-26 22:28:45 +0000
commit7ed4751b7860f7248ae7042465d3051867632c56 (patch)
tree4d2fc3b6525453b48461ceeae0611e21c4759648 /cc/test
parent5b409ba35802ce8eba4b3056c5787cf73f81c745 (diff)
downloadchromium_src-7ed4751b7860f7248ae7042465d3051867632c56.zip
chromium_src-7ed4751b7860f7248ae7042465d3051867632c56.tar.gz
chromium_src-7ed4751b7860f7248ae7042465d3051867632c56.tar.bz2
cc: Hook vsync time source to output surface
Let the output surface generate a vsync signal for the vsync time source. This will be used to drive rendering based on a vsync notification from the browser process. BUG=149227 TEST=LayerTreeHostTestVSyncNotification Review URL: https://chromiumcodereview.appspot.com/12674030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_layer_tree_host_impl_client.h1
-rw-r--r--cc/test/fake_output_surface.cc13
-rw-r--r--cc/test/fake_output_surface.h8
3 files changed, 21 insertions, 1 deletions
diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h
index 4ed6442..61555bb 100644
--- a/cc/test/fake_layer_tree_host_impl_client.h
+++ b/cc/test/fake_layer_tree_host_impl_client.h
@@ -17,6 +17,7 @@ class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient {
virtual void OnVSyncParametersChanged(
base::TimeTicks,
base::TimeDelta) OVERRIDE {}
+ virtual void DidVSync(base::TimeTicks frame_time) OVERRIDE {}
virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE {}
virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE {}
virtual void SetNeedsRedrawOnImplThread() OVERRIDE {}
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 0b9a6d3..6369f61 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -4,12 +4,15 @@
#include "cc/test/fake_output_surface.h"
+#include "cc/output/output_surface_client.h"
+
namespace cc {
FakeOutputSurface::FakeOutputSurface(
scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent)
: OutputSurface(context3d.Pass()),
- num_sent_frames_(0) {
+ num_sent_frames_(0),
+ vsync_notification_enabled_(false) {
capabilities_.has_parent_compositor = has_parent;
}
@@ -37,4 +40,12 @@ void FakeOutputSurface::SendFrameToParentCompositor(
++num_sent_frames_;
}
+void FakeOutputSurface::EnableVSyncNotification(bool enable) {
+ vsync_notification_enabled_ = enable;
+}
+
+void FakeOutputSurface::DidVSync(base::TimeTicks frame_time) {
+ client_->DidVSync(frame_time);
+}
+
} // namespace cc
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h
index 8a2217b..e23f8cb 100644
--- a/cc/test/fake_output_surface.h
+++ b/cc/test/fake_output_surface.h
@@ -5,6 +5,7 @@
#ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_
#define CC_TEST_FAKE_OUTPUT_SURFACE_H_
+#include "base/time.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/output_surface.h"
#include "cc/output/software_output_device.h"
@@ -61,6 +62,12 @@ class FakeOutputSurface : public OutputSurface {
CompositorFrame& last_sent_frame() { return last_sent_frame_; }
size_t num_sent_frames() { return num_sent_frames_; }
+ virtual void EnableVSyncNotification(bool enable) OVERRIDE;
+ bool vsync_notification_enabled() const {
+ return vsync_notification_enabled_;
+ }
+ void DidVSync(base::TimeTicks frame_time);
+
private:
FakeOutputSurface(
scoped_ptr<WebKit::WebGraphicsContext3D> context3d,
@@ -72,6 +79,7 @@ class FakeOutputSurface : public OutputSurface {
CompositorFrame last_sent_frame_;
size_t num_sent_frames_;
+ bool vsync_notification_enabled_;
};
static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() {