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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     2 /*
     3  * Copyright 2011 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  */
    11 #ifndef SkEmptyShader_DEFINED
    12 #define SkEmptyShader_DEFINED
    14 #include "SkShader.h"
    16 /**
    17  *  \class SkEmptyShader
    18  *  A Shader that always draws nothing. Its setContext always returns false,
    19  *  so it never expects that its shadeSpan() methods will get called.
    20  */
    21 class SK_API SkEmptyShader : public SkShader {
    22 public:
    23     SkEmptyShader() {}
    25     virtual uint32_t getFlags() SK_OVERRIDE;
    26     virtual uint8_t getSpan16Alpha() const SK_OVERRIDE;
    27     virtual bool setContext(const SkBitmap&, const SkPaint&,
    28                             const SkMatrix&) SK_OVERRIDE;
    29     virtual void shadeSpan(int x, int y, SkPMColor span[], int count) SK_OVERRIDE;
    30     virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;
    31     virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) SK_OVERRIDE;
    33     SK_TO_STRING_OVERRIDE()
    34     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
    36 protected:
    37     SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {}
    39 private:
    40     typedef SkShader INHERITED;
    41 };
    43 #endif

mercurial