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

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: add virtuals for device and picture 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
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 struct SkRSXform {
14 SkScalar fSCos;
15 SkScalar fSSin;
16 SkScalar fTx;
17 SkScalar fTy;
18
19 bool rectStaysRect() const {
20 return 0 == fSCos || 0 == fSSin;
21 }
22
23 void setIdentity() {
24 fSCos = 1;
25 fSSin = fTx = fTy = 0;
26 }
27
28 void set(SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty) {
29 fSCos = scos;
30 fSSin = ssin;
31 fTx = tx;
32 fTy = ty;
33 }
34
35 void toQuad(SkScalar width, SkScalar height, SkPoint quad[4]) const;
mtklein 2015/06/15 20:45:40 // In SkMatrix.cpp ?
36 void toQuad(const SkSize& size, SkPoint quad[4]) const {
37 this->toQuad(size.width(), size.height(), quad);
38 }
39 };
40
41 #endif
42
OLDNEW
« no previous file with comments | « include/core/SkMatrix.h ('k') | samplecode/SampleAtlas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698