1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com 2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/* 3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2011 Google Inc. 4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * 5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be 6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file. 7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com */ 88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkBGViewArtist.h" 98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkCanvas.h" 108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkParsePaint.h" 118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comSkBGViewArtist::SkBGViewArtist(SkColor c) 138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 14d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com fPaint.setColor(c); 158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comSkBGViewArtist::~SkBGViewArtist() 188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid SkBGViewArtist::onDraw(SkView*, SkCanvas* canvas) 228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 23d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com // only works for views that are clipped their bounds. 24d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com canvas->drawPaint(fPaint); 258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comvoid SkBGViewArtist::onInflate(const SkDOM& dom, const SkDOM::Node* node) 288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 29d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com SkPaint_Inflate(&fPaint, dom, node); 308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 31