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

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

Issue 1559873003: Add conversion from SaveLayerFlags to SaveFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/SkCanvas.h ('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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 uint32_t layerFlags = 0; 1127 uint32_t layerFlags = 0;
1128 1128
1129 if (0 == (flags & kClipToLayer_SaveFlag)) { 1129 if (0 == (flags & kClipToLayer_SaveFlag)) {
1130 layerFlags |= kDontClipToLayer_PrivateSaveLayerFlag; 1130 layerFlags |= kDontClipToLayer_PrivateSaveLayerFlag;
1131 } 1131 }
1132 if (0 == (flags & kHasAlphaLayer_SaveFlag)) { 1132 if (0 == (flags & kHasAlphaLayer_SaveFlag)) {
1133 layerFlags |= kIsOpaque_SaveLayerFlag; 1133 layerFlags |= kIsOpaque_SaveLayerFlag;
1134 } 1134 }
1135 return layerFlags; 1135 return layerFlags;
1136 } 1136 }
1137
1138 uint32_t SkCanvas::SaveLayerFlagsToSaveFlags(SaveLayerFlags layerFlags) {
1139 uint32_t saveFlags = 0;
1140
1141 if (0 == (layerFlags & kDontClipToLayer_PrivateSaveLayerFlag)) {
1142 saveFlags |= kClipToLayer_SaveFlag;
1143 }
1144 if (0 == (layerFlags & kIsOpaque_SaveLayerFlag)) {
1145 saveFlags |= kHasAlphaLayer_SaveFlag;
1146 }
1147 return saveFlags;
1148 }
1137 #endif 1149 #endif
1138 1150
1139 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { 1151 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) {
1140 return this->saveLayer(SaveLayerRec(bounds, paint, 0)); 1152 return this->saveLayer(SaveLayerRec(bounds, paint, 0));
1141 } 1153 }
1142 1154
1143 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS 1155 #ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
1144 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl ags) { 1156 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl ags) {
1145 return this->saveLayer(SaveLayerRec(bounds, paint, SaveFlagsToSaveLayerFlags (flags))); 1157 return this->saveLayer(SaveLayerRec(bounds, paint, SaveFlagsToSaveLayerFlags (flags)));
1146 } 1158 }
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3010 } 3022 }
3011 3023
3012 if (matrix) { 3024 if (matrix) {
3013 canvas->concat(*matrix); 3025 canvas->concat(*matrix);
3014 } 3026 }
3015 } 3027 }
3016 3028
3017 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3029 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3018 fCanvas->restoreToCount(fSaveCount); 3030 fCanvas->restoreToCount(fSaveCount);
3019 } 3031 }
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698