Home | History | Annotate | Download | only in paint
      1 /*
      2  * Copyright 2017 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 SkSGColor_DEFINED
      9 #define SkSGColor_DEFINED
     10 
     11 #include "SkSGPaintNode.h"
     12 
     13 #include "SkColor.h"
     14 
     15 namespace sksg {
     16 
     17 /**
     18  * Concrete Paint node, wrapping an SkColor.
     19  */
     20 class Color : public PaintNode {
     21 public:
     22     static sk_sp<Color> Make(SkColor c) { return sk_sp<Color>(new Color(c)); }
     23 
     24     SG_ATTRIBUTE(Color, SkColor, fColor)
     25 
     26 protected:
     27     void onApplyToPaint(SkPaint*) const override;
     28 
     29 private:
     30     explicit Color(SkColor);
     31 
     32     SkColor fColor;
     33 };
     34 
     35 } // namespace sksg
     36 
     37 #endif // SkSGColor_DEFINED
     38