diff options
author | 2016-02-18 12:39:14 -0800 | |
---|---|---|
committer | 2016-02-18 12:39:14 -0800 | |
commit | dd9ffea9ce051a49dbc6544e6aa3cb68fe987f47 (patch) | |
tree | b4002e3cc72d641fa7b8297cc84a711c336f981d /src/core/SkPM4f.h | |
parent | 8528541dd7f09f5bd76f3f1ce5f45d08ac7347c7 (diff) |
make SkPM4f private
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713653002
Review URL: https://codereview.chromium.org/1713653002
Diffstat (limited to 'src/core/SkPM4f.h')
-rw-r--r-- | src/core/SkPM4f.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/SkPM4f.h b/src/core/SkPM4f.h new file mode 100644 index 0000000000..fb22783dcc --- /dev/null +++ b/src/core/SkPM4f.h @@ -0,0 +1,46 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkPM4f_DEFINED +#define SkPM4f_DEFINED + +#include "SkColorPriv.h" + +/* + * The float values are 0...1 premultiplied + */ +struct SkPM4f { + enum { + A = SK_A32_SHIFT/8, + R = SK_R32_SHIFT/8, + G = SK_G32_SHIFT/8, + B = SK_B32_SHIFT/8, + }; + float fVec[4]; + + float a() const { return fVec[A]; } + + SkColor4f unpremul() const; + + static SkPM4f FromPMColor(SkPMColor); + + // half-float routines + void toF16(uint16_t[4]) const; + uint64_t toF16() const; // 4 float16 values packed into uint64_t + static SkPM4f FromF16(const uint16_t[4]); + +#ifdef SK_DEBUG + void assertIsUnit() const; +#else + void assertIsUnit() const {} +#endif +}; + +typedef SkPM4f (*SkXfermodeProc4f)(const SkPM4f& src, const SkPM4f& dst); + + +#endif |