blob: 20264aa3e5d5fdc6e0599d779306e41794a5bbb7 [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 SkToSRGBColorFilter_DEFINED
#define SkToSRGBColorFilter_DEFINED
#include "SkFlattenable.h"
#include "SkColorFilter.h"
#include "SkRefCnt.h"
class SkColorSpace;
class SkRasterPipeline;
* Color filter that converts from supplied color space to sRGB (both gamut and transfer function).
class SK_API SkToSRGBColorFilter : public SkColorFilter {
static sk_sp<SkColorFilter> Make(sk_sp<SkColorSpace> srcColorSpace);
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(
GrContext*, const GrColorSpaceInfo&) const override;
Factory getFactory() const override { return CreateProc; }
void flatten(SkWriteBuffer&) const override;
void onAppendStages(SkRasterPipeline*, SkColorSpace*, SkArenaAlloc*,
bool shaderIsOpaque) const override;
static sk_sp<SkFlattenable> CreateProc(SkReadBuffer&);
friend class SkFlattenable::PrivateInitializer;
sk_sp<SkColorSpace> fSrcColorSpace;
typedef SkColorFilter INHERITED;