Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: src/pathops/SkPathOpsBounds.cpp

Issue 12827020: Add base types for path ops (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkPathOpsBounds.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 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 */
7 #include "SkPathOpsBounds.h"
8 #include "SkPathOpsCubic.h"
9 #include "SkPathOpsLine.h"
10 #include "SkPathOpsQuad.h"
11
12 void SkPathOpsBounds::setCubicBounds(const SkPoint a[4]) {
13 SkDCubic cubic;
14 cubic.set(a);
15 SkDRect dRect;
16 dRect.setBounds(cubic);
17 set(SkDoubleToScalar(dRect.fLeft), SkDoubleToScalar(dRect.fTop),
18 SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom));
19 }
20
21 void SkPathOpsBounds::setLineBounds(const SkPoint a[2]) {
22 setPointBounds(a[0]);
23 add(a[1]);
24 }
25
26 void SkPathOpsBounds::setQuadBounds(const SkPoint a[3]) {
27 SkDQuad quad;
28 quad.set(a);
29 SkDRect dRect;
30 dRect.setBounds(quad);
31 set(SkDoubleToScalar(dRect.fLeft), SkDoubleToScalar(dRect.fTop),
32 SkDoubleToScalar(dRect.fRight), SkDoubleToScalar(dRect.fBottom));
33 }
34
35 void (SkPathOpsBounds::*SetCurveBounds[])(const SkPoint[]) = {
36 NULL,
37 &SkPathOpsBounds::setLineBounds,
38 &SkPathOpsBounds::setQuadBounds,
39 &SkPathOpsBounds::setCubicBounds
40 };
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsBounds.h ('k') | src/pathops/SkPathOpsCubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698