// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "cc/debug/traced_picture.h" #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" #include "base/values.h" #include "cc/debug/traced_value.h" namespace cc { TracedPicture::TracedPicture(scoped_refptr picture) : picture_(picture) { } TracedPicture::~TracedPicture() { } scoped_ptr TracedPicture::AsTraceablePicture(Picture* picture) { TracedPicture* ptr = new TracedPicture(picture); scoped_ptr result(ptr); return result.PassAs(); } void TracedPicture::AppendAsTraceFormat(std::string* out) const { scoped_ptr value = picture_->AsValue(); std::string tmp; base::JSONWriter::Write(value.get(), &tmp); out->append(tmp); } } // namespace cc