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

Unified Diff: src/core/SkCanvas.cpp

Issue 1648773002: SaveFlags begone! (Closed) Base URL: https://chromium.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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6b61efe9113c9ffa570e5d208fe81ebefc50323a..ce08d41a1f76d3673eda3f8de94c34a4e74a0bed 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1115,42 +1115,11 @@ bool SkCanvas::clipRectBounds(const SkRect* bounds, SaveLayerFlags saveLayerFlag
return true;
}
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
-uint32_t SkCanvas::SaveFlagsToSaveLayerFlags(SaveFlags flags) {
- uint32_t layerFlags = 0;
-
- if (0 == (flags & kClipToLayer_SaveFlag)) {
- layerFlags |= kDontClipToLayer_PrivateSaveLayerFlag;
- }
- if (0 == (flags & kHasAlphaLayer_SaveFlag)) {
- layerFlags |= kIsOpaque_SaveLayerFlag;
- }
- return layerFlags;
-}
-
-uint32_t SkCanvas::SaveLayerFlagsToSaveFlags(SaveLayerFlags layerFlags) {
- uint32_t saveFlags = 0;
-
- if (0 == (layerFlags & kDontClipToLayer_PrivateSaveLayerFlag)) {
- saveFlags |= kClipToLayer_SaveFlag;
- }
- if (0 == (layerFlags & kIsOpaque_SaveLayerFlag)) {
- saveFlags |= kHasAlphaLayer_SaveFlag;
- }
- return saveFlags;
-}
-#endif
int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) {
return this->saveLayer(SaveLayerRec(bounds, paint, 0));
}
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
-int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags) {
- return this->saveLayer(SaveLayerRec(bounds, paint, SaveFlagsToSaveLayerFlags(flags)));
-}
-#endif
-
int SkCanvas::saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint) {
return this->saveLayer(SaveLayerRec(bounds, paint, kPreserveLCDText_SaveLayerFlag));
}
@@ -1290,19 +1259,6 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha) {
}
}
-#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
-int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
- SaveFlags flags) {
- if (0xFF == alpha) {
- return this->saveLayer(bounds, nullptr, flags);
- } else {
- SkPaint tmpPaint;
- tmpPaint.setAlpha(alpha);
- return this->saveLayer(bounds, &tmpPaint, flags);
- }
-}
-#endif
-
void SkCanvas::internalRestore() {
SkASSERT(fMCStack.count() != 0);

Powered by Google App Engine
This is Rietveld 408576698