rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkSweepGradient_DEFINED |
| 9 | #define SkSweepGradient_DEFINED |
| 10 | |
| 11 | #include "SkGradientShaderPriv.h" |
| 12 | |
Florin Malita | 5769dd2 | 2017-07-12 13:31:25 -0400 | [diff] [blame] | 13 | class SkSweepGradient final : public SkGradientShaderBase { |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 14 | public: |
Florin Malita | 5a9a981 | 2017-08-01 16:38:08 -0400 | [diff] [blame] | 15 | SkSweepGradient(const SkPoint& center, SkScalar t0, SkScalar t1, const Descriptor&); |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 16 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 17 | GradientType asAGradient(GradientInfo* info) const override; |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 18 | |
bsalomon | c21b09e | 2015-08-28 18:46:56 -0700 | [diff] [blame] | 19 | #if SK_SUPPORT_GPU |
Mike Reed | e3429e6 | 2018-01-19 11:43:34 -0500 | [diff] [blame] | 20 | std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override; |
bsalomon | c21b09e | 2015-08-28 18:46:56 -0700 | [diff] [blame] | 21 | #endif |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 22 | |
Cary Clark | 9988541 | 2018-04-05 13:09:58 -0400 | [diff] [blame^] | 23 | void toString(SkString* str) const override; |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 24 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSweepGradient) |
| 25 | |
| 26 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 27 | void flatten(SkWriteBuffer& buffer) const override; |
Matt Sarett | 6cc6ae7 | 2017-04-18 18:29:12 -0400 | [diff] [blame] | 28 | sk_sp<SkShader> onMakeColorSpace(SkColorSpaceXformer* xformer) const override; |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 29 | |
Florin Malita | 50b2084 | 2017-07-29 19:08:28 -0400 | [diff] [blame] | 30 | void appendGradientStages(SkArenaAlloc* alloc, SkRasterPipeline* tPipeline, |
| 31 | SkRasterPipeline* postPipeline) const override; |
Herb Derby | 7eb8698 | 2017-05-02 19:04:39 -0400 | [diff] [blame] | 32 | |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 33 | private: |
Florin Malita | 5a9a981 | 2017-08-01 16:38:08 -0400 | [diff] [blame] | 34 | const SkPoint fCenter; |
| 35 | const SkScalar fTBias, |
| 36 | fTScale; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 37 | |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 38 | friend class SkGradientShader; |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 39 | typedef SkGradientShaderBase INHERITED; |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
rileya@google.com | 589708b | 2012-07-26 20:04:23 +0000 | [diff] [blame] | 42 | #endif |