Index: cc/output/output_surface.cc |
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc |
index 27b3fbddfc2c6997cace8420531e0d158135d15a..dfb8047f9ba23db7d21ce5d5b8d7ff017b1dee7f 100644 |
--- a/cc/output/output_surface.cc |
+++ b/cc/output/output_surface.cc |
@@ -11,6 +11,7 @@ |
#include "base/bind.h" |
#include "base/debug/trace_event.h" |
+#include "base/debug/trace_event_argument.h" |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
#include "base/metrics/histogram.h" |
@@ -43,6 +44,8 @@ namespace cc { |
OutputSurface::OutputSurface( |
const scoped_refptr<ContextProvider>& context_provider) |
: client_(NULL), |
+ vsync_observer_(NULL), |
+ begin_frame_observer_(NULL), |
context_provider_(context_provider), |
device_scale_factor_(-1), |
external_stencil_test_enabled_(false), |
@@ -52,6 +55,8 @@ OutputSurface::OutputSurface( |
OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device) |
: client_(NULL), |
+ vsync_observer_(NULL), |
+ begin_frame_observer_(NULL), |
software_device_(software_device.Pass()), |
device_scale_factor_(-1), |
external_stencil_test_enabled_(false), |
@@ -63,6 +68,8 @@ OutputSurface::OutputSurface( |
const scoped_refptr<ContextProvider>& context_provider, |
scoped_ptr<SoftwareOutputDevice> software_device) |
: client_(NULL), |
+ vsync_observer_(NULL), |
+ begin_frame_observer_(NULL), |
context_provider_(context_provider), |
software_device_(software_device.Pass()), |
device_scale_factor_(-1), |
@@ -79,7 +86,18 @@ void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase, |
(timebase - base::TimeTicks()).InSecondsF(), |
"interval", |
interval.InSecondsF()); |
- client_->CommitVSyncParameters(timebase, interval); |
+ if (vsync_observer_) |
+ vsync_observer_->OnUpdateVSyncParameters(timebase, interval); |
+} |
+ |
+void OutputSurface::SetNeedsBeginFrames(bool needs_begin_frames) { |
+ needs_begin_frames_ = needs_begin_frames; |
+} |
+bool OutputSurface::NeedsBeginFrames() const { |
+ return needs_begin_frames_; |
+} |
+void OutputSurface::AsValueInto(base::debug::TracedValue* dict) const { |
+ dict->SetString("type", "OutputSurface"); |
} |
// Forwarded to OutputSurfaceClient |