OLD | NEW |
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 Loading... |
1127 | 1127 |
1128 if (0 == (flags & kClipToLayer_SaveFlag)) { | 1128 if (0 == (flags & kClipToLayer_SaveFlag)) { |
1129 layerFlags |= kDontClipToLayer_PrivateSaveLayerFlag; | 1129 layerFlags |= kDontClipToLayer_PrivateSaveLayerFlag; |
1130 } | 1130 } |
1131 if (0 == (flags & kHasAlphaLayer_SaveFlag)) { | 1131 if (0 == (flags & kHasAlphaLayer_SaveFlag)) { |
1132 layerFlags |= kIsOpaque_SaveLayerFlag; | 1132 layerFlags |= kIsOpaque_SaveLayerFlag; |
1133 } | 1133 } |
1134 return layerFlags; | 1134 return layerFlags; |
1135 } | 1135 } |
1136 | 1136 |
1137 #ifdef SK_SUPPORT_LEGACY_SAVELAYERPARAMS | |
1138 SkCanvas::SaveLayerStrategy SkCanvas::getSaveLayerStrategy(const SaveLayerRec& r
ec) { | |
1139 uint32_t flags = 0; | |
1140 | |
1141 if (0 == (rec.fSaveLayerFlags & kDontClipToLayer_PrivateSaveLayerFlag)) { | |
1142 flags |= kClipToLayer_SaveFlag; | |
1143 } | |
1144 if (0 == (rec.fSaveLayerFlags & kIsOpaque_SaveLayerFlag)) { | |
1145 flags |= kHasAlphaLayer_SaveFlag; | |
1146 } | |
1147 return this->willSaveLayer(rec.fBounds, rec.fPaint, (SaveFlags)flags); | |
1148 } | |
1149 #endif | |
1150 | |
1151 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { | 1137 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { |
1152 return this->saveLayer(SaveLayerRec(bounds, paint, 0)); | 1138 return this->saveLayer(SaveLayerRec(bounds, paint, 0)); |
1153 } | 1139 } |
1154 | 1140 |
1155 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl
ags) { | 1141 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl
ags) { |
1156 return this->saveLayer(SaveLayerRec(bounds, paint, SaveFlagsToSaveLayerFlags
(flags))); | 1142 return this->saveLayer(SaveLayerRec(bounds, paint, SaveFlagsToSaveLayerFlags
(flags))); |
1157 } | 1143 } |
1158 | 1144 |
1159 int SkCanvas::saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPai
nt* paint) { | 1145 int SkCanvas::saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPai
nt* paint) { |
1160 return this->saveLayer(SaveLayerRec(bounds, paint, kPreserveLCDText_SaveLaye
rFlag)); | 1146 return this->saveLayer(SaveLayerRec(bounds, paint, kPreserveLCDText_SaveLaye
rFlag)); |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3041 } | 3027 } |
3042 | 3028 |
3043 if (matrix) { | 3029 if (matrix) { |
3044 canvas->concat(*matrix); | 3030 canvas->concat(*matrix); |
3045 } | 3031 } |
3046 } | 3032 } |
3047 | 3033 |
3048 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3034 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3049 fCanvas->restoreToCount(fSaveCount); | 3035 fCanvas->restoreToCount(fSaveCount); |
3050 } | 3036 } |
OLD | NEW |