| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/resources/tile_data.h" |
| 6 |
| 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" |
| 9 #include "cc/debug/traced_value.h" |
| 10 #include "cc/resources/tile_priority.h" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 scoped_ptr<base::Value> RasterModeAsValue(RasterMode raster_mode) { |
| 15 switch (raster_mode) { |
| 16 case HIGH_QUALITY_NO_LCD_RASTER_MODE: |
| 17 return scoped_ptr<base::Value>( |
| 18 base::Value::CreateStringValue("HIGH_QUALITY_NO_LCD_RASTER_MODE")); |
| 19 case HIGH_QUALITY_RASTER_MODE: |
| 20 return scoped_ptr<base::Value>( |
| 21 base::Value::CreateStringValue("HIGH_QUALITY_RASTER_MODE")); |
| 22 case LOW_QUALITY_RASTER_MODE: |
| 23 return scoped_ptr<base::Value>( |
| 24 base::Value::CreateStringValue("LOW_QUALITY_RASTER_MODE")); |
| 25 case NUM_RASTER_MODES: |
| 26 default: |
| 27 NOTREACHED() << "Unrecognized RasterMode value " << raster_mode; |
| 28 return scoped_ptr<base::Value>( |
| 29 base::Value::CreateStringValue("<unknown RasterMode value>")); |
| 30 } |
| 31 } |
| 32 |
| 33 scoped_ptr<base::Value> RasterTaskMetadata::AsValue() const { |
| 34 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); |
| 35 res->Set("tile_id", TracedValue::CreateIDRef(tile_id).release()); |
| 36 res->SetBoolean("is_tile_in_pending_tree_now_bin", |
| 37 is_tile_in_pending_tree_now_bin); |
| 38 res->Set("resolution", TileResolutionAsValue(tile_resolution).release()); |
| 39 res->SetInteger("source_frame_number", source_frame_number); |
| 40 return res.PassAs<base::Value>(); |
| 41 } |
| 42 |
| 43 } // namespace cc |
| OLD | NEW |