Reland "Add base::TimeDelta::Max()"
[chromium-blink-merge.git] / cc / resources / raster_mode.cc
blob61375c266694cb357f81b5002b3c024e574faf11
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.
5 #include "cc/resources/raster_mode.h"
7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h"
11 namespace cc {
13 scoped_ptr<base::Value> RasterModeAsValue(RasterMode raster_mode) {
14 switch (raster_mode) {
15 case HIGH_QUALITY_NO_LCD_RASTER_MODE:
16 return scoped_ptr<base::Value>(
17 new base::StringValue("HIGH_QUALITY_NO_LCD_RASTER_MODE"));
18 case HIGH_QUALITY_RASTER_MODE:
19 return scoped_ptr<base::Value>(
20 new base::StringValue("HIGH_QUALITY_RASTER_MODE"));
21 case LOW_QUALITY_RASTER_MODE:
22 return scoped_ptr<base::Value>(
23 new base::StringValue("LOW_QUALITY_RASTER_MODE"));
24 default:
25 NOTREACHED() << "Unrecognized RasterMode value " << raster_mode;
26 return scoped_ptr<base::Value>(
27 new base::StringValue("<unknown RasterMode value>"));
31 } // namespace cc