aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/SkBGViewArtist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/SkBGViewArtist.cpp')
-rw-r--r--src/views/SkBGViewArtist.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/views/SkBGViewArtist.cpp b/src/views/SkBGViewArtist.cpp
new file mode 100644
index 0000000..07da123
--- /dev/null
+++ b/src/views/SkBGViewArtist.cpp
@@ -0,0 +1,24 @@
+#include "SkBGViewArtist.h"
+#include "SkCanvas.h"
+#include "SkParsePaint.h"
+
+SkBGViewArtist::SkBGViewArtist(SkColor c)
+{
+ fPaint.setColor(c);
+}
+
+SkBGViewArtist::~SkBGViewArtist()
+{
+}
+
+void SkBGViewArtist::onDraw(SkView*, SkCanvas* canvas)
+{
+ // only works for views that are clipped their bounds.
+ canvas->drawPaint(fPaint);
+}
+
+void SkBGViewArtist::onInflate(const SkDOM& dom, const SkDOM::Node* node)
+{
+ SkPaint_Inflate(&fPaint, dom, node);
+}
+