• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 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 #include "SkSGPlane.h"
9 
10 #include "SkCanvas.h"
11 #include "SkPath.h"
12 
13 namespace sksg {
14 
15 Plane::Plane() = default;
16 
onClip(SkCanvas *,bool) const17 void Plane::onClip(SkCanvas*, bool) const {}
18 
onDraw(SkCanvas * canvas,const SkPaint & paint) const19 void Plane::onDraw(SkCanvas* canvas, const SkPaint& paint) const {
20     canvas->drawPaint(paint);
21 }
22 
onRevalidate(InvalidationController *,const SkMatrix &)23 SkRect Plane::onRevalidate(InvalidationController*, const SkMatrix&) {
24     SkASSERT(this->hasInval());
25 
26     return SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax);
27 }
28 
onAsPath() const29 SkPath Plane::onAsPath() const {
30     SkPath path;
31     path.setFillType(SkPath::kInverseWinding_FillType);
32 
33     return path;
34 }
35 
36 } // namespace sksg
37