blob: a2a629f2c13c45af37b6dca89b7ba16224d2cc61 [file] [log] [blame]
* Copyright 2016 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#include "SkColorFilter.h"
#ifndef SkModeColorFilter_DEFINED
#define SkModeColorFilter_DEFINED
class SkModeColorFilter : public SkColorFilter {
static sk_sp<SkColorFilter> Make(SkColor color, SkBlendMode mode) {
return sk_sp<SkColorFilter>(new SkModeColorFilter(color, mode));
SkColor getColor() const { return fColor; }
SkPMColor getPMColor() const { return fPMColor; }
bool asColorMode(SkColor*, SkBlendMode*) const override;
uint32_t getFlags() const override;
void toString(SkString* str) const override;
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(
GrContext*, const GrColorSpaceInfo&) const override;
SkModeColorFilter(SkColor color, SkBlendMode mode);
void flatten(SkWriteBuffer&) const override;
void onAppendStages(SkRasterPipeline*, SkColorSpace*, SkArenaAlloc*,
bool shaderIsOpaque) const override;
sk_sp<SkColorFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
SkColor fColor;
SkBlendMode fMode;
// cache
SkPMColor fPMColor;
friend class SkColorFilter;
typedef SkColorFilter INHERITED;