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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 fCurMCState->fExpectedDepth++; // 1 for saveLayer | 165 fCurMCState->fExpectedDepth++; // 1 for saveLayer |
166 #endif | 166 #endif |
167 | 167 |
168 *fStateIDStack.append() = fCurOpenStateID; | 168 *fStateIDStack.append() = fCurOpenStateID; |
169 fCurMCState->fSavedSkipOffsets = fSkipOffsets; | 169 fCurMCState->fSavedSkipOffsets = fSkipOffsets; |
170 | 170 |
171 // TODO: recycle these rather then new & deleting them on every saveLayer/ | 171 // TODO: recycle these rather then new & deleting them on every saveLayer/ |
172 // restore | 172 // restore |
173 fSkipOffsets = SkNEW(SkTDArray<int>); | 173 fSkipOffsets = SkNEW(SkTDArray<int>); |
174 | 174 |
175 fPicRecord->recordSaveLayer(bounds, paint, | 175 fPicRecord->recordSaveLayer(bounds, paint, flags | SkCanvas::kMatrixClip_Sav
eFlag); |
176 (SkCanvas::SaveFlags)(flags| SkCanvas::kMatrixCl
ip_SaveFlag)); | |
177 #ifdef SK_DEBUG | 176 #ifdef SK_DEBUG |
178 fActualDepth++; | 177 fActualDepth++; |
179 #endif | 178 #endif |
180 return result; | 179 return result; |
181 } | 180 } |
182 | 181 |
183 void SkMatrixClipStateMgr::restore() { | 182 void SkMatrixClipStateMgr::restore() { |
184 SkDEBUGCODE(this->validate();) | 183 SkDEBUGCODE(this->validate();) |
185 | 184 |
186 if (fCurMCState->fIsSaveLayer) { | 185 if (fCurMCState->fIsSaveLayer) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 410 } |
412 | 411 |
413 int SkMatrixClipStateMgr::addMatToDict(const SkMatrix& mat) { | 412 int SkMatrixClipStateMgr::addMatToDict(const SkMatrix& mat) { |
414 if (mat.isIdentity()) { | 413 if (mat.isIdentity()) { |
415 return kIdentityMatID; | 414 return kIdentityMatID; |
416 } | 415 } |
417 | 416 |
418 *fMatrixDict.append() = mat; | 417 *fMatrixDict.append() = mat; |
419 return fMatrixDict.count()-1; | 418 return fMatrixDict.count()-1; |
420 } | 419 } |
OLD | NEW |