1 // Copyright 2015 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_LIB_UI_PAINTING_PAINT_H_ 6 #define FLUTTER_LIB_UI_PAINTING_PAINT_H_ 7 8 #include "flutter/lib/ui/dart_wrapper.h" 9 #include "third_party/skia/include/core/SkPaint.h" 10 11 namespace flutter { 12 13 class Paint { 14 public: 15 Paint() = default; 16 Paint(Dart_Handle paint_objects, Dart_Handle paint_data); 17 Paint(uint32_t encoded_color); 18 paint()19 const SkPaint* paint() const { return is_null_ ? nullptr : &paint_; } 20 paint()21 SkPaint* paint() { return is_null_ ? nullptr : &paint_; } 22 private: 23 24 SkPaint paint_; 25 bool is_null_ = false; 26 }; 27 28 // The PaintData argument is a placeholder to receive encoded data for Paint 29 // objects. The data is actually processed by DartConverter<Paint>, which reads 30 // both at the given index and at the next index (which it assumes is a byte 31 // data for a Paint object). 32 class PaintData {}; 33 34 } // namespace blink 35 36 #endif // FLUTTER_LIB_UI_PAINTING_PAINT_H_ 37