gfx/skia/trunk/include/core/SkEmptyShader.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/core/SkEmptyShader.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2011 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +
    1.14 +#ifndef SkEmptyShader_DEFINED
    1.15 +#define SkEmptyShader_DEFINED
    1.16 +
    1.17 +#include "SkShader.h"
    1.18 +
    1.19 +/**
    1.20 + *  \class SkEmptyShader
    1.21 + *  A Shader that always draws nothing. Its setContext always returns false,
    1.22 + *  so it never expects that its shadeSpan() methods will get called.
    1.23 + */
    1.24 +class SK_API SkEmptyShader : public SkShader {
    1.25 +public:
    1.26 +    SkEmptyShader() {}
    1.27 +
    1.28 +    virtual uint32_t getFlags() SK_OVERRIDE;
    1.29 +    virtual uint8_t getSpan16Alpha() const SK_OVERRIDE;
    1.30 +    virtual bool setContext(const SkBitmap&, const SkPaint&,
    1.31 +                            const SkMatrix&) SK_OVERRIDE;
    1.32 +    virtual void shadeSpan(int x, int y, SkPMColor span[], int count) SK_OVERRIDE;
    1.33 +    virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;
    1.34 +    virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) SK_OVERRIDE;
    1.35 +
    1.36 +    SK_TO_STRING_OVERRIDE()
    1.37 +    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
    1.38 +
    1.39 +protected:
    1.40 +    SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {}
    1.41 +
    1.42 +private:
    1.43 +    typedef SkShader INHERITED;
    1.44 +};
    1.45 +
    1.46 +#endif

mercurial