blob: 18d5ddc0ef64f47ac88c203c68c74a8dcdbdf944 [file] [log] [blame]
rileya@google.com589708b2012-07-26 20:04:23 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef SkSweepGradient_DEFINED
10#define SkSweepGradient_DEFINED
11
12#include "SkGradientShaderPriv.h"
13
14class SkSweepGradient : public SkGradientShaderBase {
15public:
reed@google.com437d6eb2013-05-23 19:03:05 +000016 SkSweepGradient(SkScalar cx, SkScalar cy, const Descriptor&);
rileya@google.com589708b2012-07-26 20:04:23 +000017 virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE;
18 virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
19
20 virtual BitmapType asABitmap(SkBitmap* bitmap,
21 SkMatrix* matrix,
22 TileMode* xy) const SK_OVERRIDE;
23
24 virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
25
bsalomon@google.com0ac6af42013-01-16 15:16:18 +000026 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint&) const SK_OVERRIDE;
rileya@google.com589708b2012-07-26 20:04:23 +000027
robertphillips@google.com76f9e932013-01-15 20:17:47 +000028 SK_DEVELOPER_TO_STRING()
rileya@google.com589708b2012-07-26 20:04:23 +000029 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSweepGradient)
30
31protected:
commit-bot@chromium.org8b0e8ac2014-01-30 18:58:24 +000032 SkSweepGradient(SkReadBuffer& buffer);
33 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
rileya@google.com589708b2012-07-26 20:04:23 +000034
35private:
36 typedef SkGradientShaderBase INHERITED;
37 const SkPoint fCenter;
38};
39
rileya@google.com589708b2012-07-26 20:04:23 +000040#endif