1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/*
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project
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 */
8ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkDrawLine.h"
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkAnimateMaker.h"
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkCanvas.h"
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkPaint.h"
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#if SK_USE_CONDENSED_INFO == 0
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comconst SkMemberInfo SkLine::fInfo[] = {
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SK_MEMBER(x1, Float),
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SK_MEMBER(x2, Float),
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SK_MEMBER(y1, Float),
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SK_MEMBER(y2, Float)
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comDEFINE_GET_MEMBER(SkLine);
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
28d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.comSkLine::SkLine() : x1(0), x2(0), y1(0), y2(0) {
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com}
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.combool SkLine::draw(SkAnimateMaker& maker) {
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkBoundableAuto boundable(this, maker);
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    maker.fCanvas->drawLine(x1, y1, x2, y2, *maker.fPaint);
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    return false;
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com}
36