| Index: cc/resources/tile_data.cc
|
| diff --git a/cc/resources/tile_data.cc b/cc/resources/tile_data.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4a27e3d57e92749efe25361239edadb6c81a8444
|
| --- /dev/null
|
| +++ b/cc/resources/tile_data.cc
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 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/resources/tile_data.h"
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/values.h"
|
| +#include "cc/debug/traced_value.h"
|
| +#include "cc/resources/tile_priority.h"
|
| +
|
| +namespace cc {
|
| +
|
| +scoped_ptr<base::Value> RasterModeAsValue(RasterMode raster_mode) {
|
| + switch (raster_mode) {
|
| + case HIGH_QUALITY_NO_LCD_RASTER_MODE:
|
| + return scoped_ptr<base::Value>(
|
| + base::Value::CreateStringValue("HIGH_QUALITY_NO_LCD_RASTER_MODE"));
|
| + case HIGH_QUALITY_RASTER_MODE:
|
| + return scoped_ptr<base::Value>(
|
| + base::Value::CreateStringValue("HIGH_QUALITY_RASTER_MODE"));
|
| + case LOW_QUALITY_RASTER_MODE:
|
| + return scoped_ptr<base::Value>(
|
| + base::Value::CreateStringValue("LOW_QUALITY_RASTER_MODE"));
|
| + case NUM_RASTER_MODES:
|
| + default:
|
| + NOTREACHED() << "Unrecognized RasterMode value " << raster_mode;
|
| + return scoped_ptr<base::Value>(
|
| + base::Value::CreateStringValue("<unknown RasterMode value>"));
|
| + }
|
| +}
|
| +
|
| +scoped_ptr<base::Value> RasterTaskMetadata::AsValue() const {
|
| + scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
|
| + res->Set("tile_id", TracedValue::CreateIDRef(tile_id).release());
|
| + res->SetBoolean("is_tile_in_pending_tree_now_bin",
|
| + is_tile_in_pending_tree_now_bin);
|
| + res->Set("resolution", TileResolutionAsValue(tile_resolution).release());
|
| + res->SetInteger("source_frame_number", source_frame_number);
|
| + return res.PassAs<base::Value>();
|
| +}
|
| +
|
| +} // namespace cc
|
|
|