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

Side by Side Diff: src/core/SkMatrixClipStateMgr.cpp

Issue 303373003: Add an OR operator overload for SaveFlags to avoid extra static casts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: spacing Created 6 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 | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698