* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkPaintPriv_DEFINED
#define SkPaintPriv_DEFINED
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
class SkColorSpace;
class SkReadBuffer;
class SkWriteBuffer;
enum SkColorType : int;
class SK_API SkPaintPriv {
public:
enum ShaderOverrideOpacity {
kNone_ShaderOverrideOpacity,
kOpaque_ShaderOverrideOpacity,
kNotOpaque_ShaderOverrideOpacity,
};
* Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels.
*
* Note: returns conservative true, meaning it may return false even though the paint might
* in fact overwrite its pixels.
*/
static bool Overwrites(const SkPaint* paint, ShaderOverrideOpacity);
static bool ShouldDither(const SkPaint&, SkColorType);
* The luminance color is used to determine which Gamma Canonical color to map to. This is
* really only used by backends which want to cache glyph masks, and need some way to know if
* they need to generate new masks based off a given color.
*/
static SkColor ComputeLuminanceColor(const SkPaint&);
can reconstitute the paint at a later time.
@param buffer SkWriteBuffer receiving the flattened SkPaint data
*/
static void Flatten(const SkPaint& paint, SkWriteBuffer& buffer);
flatten() at an earlier time.
*/
static SkPaint Unflatten(SkReadBuffer& buffer);
static void RemoveColorFilter(SkPaint*, SkColorSpace* dstCS);
};
#endif