summaryrefslogtreecommitdiff
path: root/chromium/cc/resources/raster_mode.cc
blob: 47d6344c97d8b41731aa169a4c8a3ded2723575f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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/raster_mode.h"

#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.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"));
    default:
      NOTREACHED() << "Unrecognized RasterMode value " << raster_mode;
      return scoped_ptr<base::Value>(
          base::Value::CreateStringValue("<unknown RasterMode value>"));
  }
}

}  // namespace cc