blob: e88db22b30d7958b15ae9d5fa21edad1bacb03cc [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
bsalomon@google.com30085192011-08-19 15:42:31 +00008
bsalomon@google.comffca4002011-02-22 20:34:01 +00009#include "GrPathRenderer.h"
10
reed@google.comfa35e3d2012-06-26 20:16:17 +000011SK_DEFINE_INST_COUNT(GrPathRenderer)
12
bsalomon@google.comc2099d22012-03-02 21:26:50 +000013GrPathRenderer::GrPathRenderer() {
tomhudson@google.comd22b6e42011-06-24 15:53:40 +000014}
bsalomon@google.com1dd9baa2013-05-20 16:49:06 +000015
16void GrPathRenderer::GetPathDevBounds(const SkPath& path,
17 int devW, int devH,
18 const SkMatrix& matrix,
19 SkRect* bounds) {
20 if (path.isInverseFillType()) {
21 *bounds = SkRect::MakeWH(SkIntToScalar(devW), SkIntToScalar(devH));
22 return;
23 }
24 *bounds = path.getBounds();
25 matrix.mapRect(bounds);
26}