epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 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 | */ |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 7 | |
bsalomon@google.com | ffca400 | 2011-02-22 20:34:01 +0000 | [diff] [blame] | 8 | #include "GrPathRenderer.h" |
| 9 | |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame] | 10 | GrPathRenderer::GrPathRenderer() { |
tomhudson@google.com | d22b6e4 | 2011-06-24 15:53:40 +0000 | [diff] [blame] | 11 | } |
bsalomon@google.com | 1dd9baa | 2013-05-20 16:49:06 +0000 | [diff] [blame] | 12 | |
| 13 | void GrPathRenderer::GetPathDevBounds(const SkPath& path, |
| 14 | int devW, int devH, |
| 15 | const SkMatrix& matrix, |
| 16 | SkRect* bounds) { |
| 17 | if (path.isInverseFillType()) { |
| 18 | *bounds = SkRect::MakeWH(SkIntToScalar(devW), SkIntToScalar(devH)); |
| 19 | return; |
| 20 | } |
| 21 | *bounds = path.getBounds(); |
| 22 | matrix.mapRect(bounds); |
| 23 | } |