blob: 1c530c49a0e7be8737442f58875a5416b6f515db [file] [log] [blame]
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSplicer_shared_DEFINED
#define SkSplicer_shared_DEFINED
// This file contains definitions shared by SkSplicer.cpp (compiled normally as part of Skia)
// and SkSplicer_stages.cpp (compiled offline into SkSplicer_generated.h). Keep it simple!
#include <stdint.h>
// SkSplicer Stages can use constant literals only if they end up baked into the instruction,
// like bit shifts and rounding modes. Any other constant values must be pulled from this struct
// (except 0 and 0.0f, which always end up as some sort of xor instruction).
//
// This constraint makes it much easier to move and reorder the code for each Stage.
struct SkSplicer_constants {
uint32_t _0x000000ff; // 0x000000ff
float _1; // 1.0f
float _255; // 255.0f
float _1_255; // 1/255.0f
// from_srgb
float _00025; // 0.0025f
float _06975; // 0.6975f
float _03000; // 0.3000f
float _1_1292; // 1/12.92f
float _0055; // 0.055f
// to_srgb
float _1246; // 12.46f
float _0411192; // 0.411192f
float _0689206; // 0.689206f
float n_00988; // -0.0988f
float _00043; // 0.0043f
};
#endif//SkSplicer_shared_DEFINED