OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkMatrixClipStateMgr.h" | 8 #include "SkMatrixClipStateMgr.h" |
9 #include "SkPictureRecord.h" | 9 #include "SkPictureRecord.h" |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // mgr->writeDeltaMat... | 62 // mgr->writeDeltaMat... |
63 // *curMatID... | 63 // *curMatID... |
64 // } | 64 // } |
65 // Right now this optimization would throw off the testing harness. | 65 // Right now this optimization would throw off the testing harness. |
66 // TODO: right now we're writing out the delta matrix from the prior | 66 // TODO: right now we're writing out the delta matrix from the prior |
67 // matrix state. This is a side-effect of writing out the entire | 67 // matrix state. This is a side-effect of writing out the entire |
68 // clip stack and should be resolved when that is fixed. | 68 // clip stack and should be resolved when that is fixed. |
69 mgr->writeDeltaMat(*curMatID, curClip.fMatrixID); | 69 mgr->writeDeltaMat(*curMatID, curClip.fMatrixID); |
70 *curMatID = curClip.fMatrixID; | 70 *curMatID = curClip.fMatrixID; |
71 | 71 |
72 int offset = 0; | 72 size_t offset = 0; |
73 | 73 |
74 switch (curClip.fClipType) { | 74 switch (curClip.fClipType) { |
75 case kRect_ClipType: | 75 case kRect_ClipType: |
76 offset = mgr->getPicRecord()->recordClipRect(curClip.fGeom.fRRect.re
ct(), | 76 offset = mgr->getPicRecord()->recordClipRect(curClip.fGeom.fRRect.re
ct(), |
77 curClip.fOp, curClip.fD
oAA); | 77 curClip.fOp, curClip.fD
oAA); |
78 break; | 78 break; |
79 case kRRect_ClipType: | 79 case kRRect_ClipType: |
80 offset = mgr->getPicRecord()->recordClipRRect(curClip.fGeom.fRRect,
curClip.fOp, | 80 offset = mgr->getPicRecord()->recordClipRRect(curClip.fGeom.fRRect,
curClip.fOp, |
81 curClip.fDoAA); | 81 curClip.fDoAA); |
82 break; | 82 break; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 | 412 |
413 int SkMatrixClipStateMgr::addMatToDict(const SkMatrix& mat) { | 413 int SkMatrixClipStateMgr::addMatToDict(const SkMatrix& mat) { |
414 if (mat.isIdentity()) { | 414 if (mat.isIdentity()) { |
415 return kIdentityMatID; | 415 return kIdentityMatID; |
416 } | 416 } |
417 | 417 |
418 *fMatrixDict.append() = mat; | 418 *fMatrixDict.append() = mat; |
419 return fMatrixDict.count()-1; | 419 return fMatrixDict.count()-1; |
420 } | 420 } |
OLD | NEW |