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

Side by Side Diff: include/core/SkRSXform.h

Issue 1181913003: add SkCanvas::drawAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warnings Created 5 years, 6 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
« no previous file with comments | « include/core/SkMatrix.h ('k') | include/utils/SkDeferredCanvas.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 2015 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
8 #ifndef SkRSXform_DEFINED
9 #define SkRSXform_DEFINED
10
11 #include "SkScalar.h"
12
13 /**
14 * A compressed form of a rotation+scale matrix.
15 *
16 * [ fSCos -fSSin fTx ]
17 * [ fSSin fSCos fTy ]
18 * [ 0 0 1 ]
19 */
20 struct SkRSXform {
21 SkScalar fSCos;
22 SkScalar fSSin;
23 SkScalar fTx;
24 SkScalar fTy;
25
26 bool rectStaysRect() const {
27 return 0 == fSCos || 0 == fSSin;
28 }
29
30 void setIdentity() {
31 fSCos = 1;
32 fSSin = fTx = fTy = 0;
33 }
34
35 void set(SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty) {
36 fSCos = scos;
37 fSSin = ssin;
38 fTx = tx;
39 fTy = ty;
40 }
41
42 void toQuad(SkScalar width, SkScalar height, SkPoint quad[4]) const;
43 void toQuad(const SkSize& size, SkPoint quad[4]) const {
44 this->toQuad(size.width(), size.height(), quad);
45 }
46 };
47
48 #endif
49
OLDNEW
« no previous file with comments | « include/core/SkMatrix.h ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698