blob: e79f21a2350f1e4b958c73c66e631562cc99be87 (
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
32
33
34
35
36
37
38
39
40
|
/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkDeviceProperties_DEFINED
#define SkDeviceProperties_DEFINED
#include "SkSurfacePriv.h"
struct SkDeviceProperties {
enum InitType {
kLegacyLCD_InitType
};
SkDeviceProperties(InitType, float gamma = SK_GAMMA_EXPONENT)
: fGamma(gamma)
, fPixelGeometry(SkSurfacePropsDefaultPixelGeometry())
{}
SkDeviceProperties(SkPixelGeometry geo, float gamma = SK_GAMMA_EXPONENT)
: fGamma(gamma)
, fPixelGeometry(geo)
{}
SkPixelGeometry pixelGeometry() const { return fPixelGeometry; }
float gamma() const { return fGamma; }
void setPixelGeometry(SkPixelGeometry geo) {
fPixelGeometry = geo;
}
private:
const float fGamma;
SkPixelGeometry fPixelGeometry;
};
#endif
|