diff options
Diffstat (limited to 'cc/output/begin_frame_args.cc')
-rw-r--r-- | cc/output/begin_frame_args.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cc/output/begin_frame_args.cc b/cc/output/begin_frame_args.cc index 9766b626..2d7cd96 100644 --- a/cc/output/begin_frame_args.cc +++ b/cc/output/begin_frame_args.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/json/json_writer.h" #include "cc/output/begin_frame_args.h" #include "ui/gfx/frame_time.h" @@ -27,6 +28,15 @@ BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time, return BeginFrameArgs(frame_time, deadline, interval); } +scoped_ptr<base::Value> BeginFrameArgs::AsValue() const { + scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); + state->SetString("type", "BeginFrameArgs"); + state->SetDouble("frame_time_us", frame_time.ToInternalValue()); + state->SetDouble("deadline_us", deadline.ToInternalValue()); + state->SetDouble("interval_us", interval.InMicroseconds()); + return state.PassAs<base::Value>(); +} + BeginFrameArgs BeginFrameArgs::CreateForSynchronousCompositor() { // For WebView/SynchronousCompositor, we always want to draw immediately, // so we set the deadline to 0 and guess that the interval is 16 milliseconds. |