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

Unified Diff: src/core/SkCanvas.cpp

Issue 1535993003: hide old SaveFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: aaaaaargh Created 5 years 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
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index a232177c6bb96be677e9153b580bfd51121de0b2..68afc187a235b2aa02015bf54f9f3a5069169d2e 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1122,6 +1122,7 @@ 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;
@@ -1133,14 +1134,17 @@ uint32_t SkCanvas::SaveFlagsToSaveLayerFlags(SaveFlags flags) {
}
return layerFlags;
}
+#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));
@@ -1269,9 +1273,16 @@ void SkCanvas::internalSaveLayer(const SaveLayerRec& rec, SaveLayerStrategy stra
}
int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha) {
- return this->saveLayerAlpha(bounds, alpha, kARGB_ClipLayer_SaveFlag);
+ if (0xFF == alpha) {
+ return this->saveLayer(bounds, nullptr);
+ } else {
+ SkPaint tmpPaint;
+ tmpPaint.setAlpha(alpha);
+ return this->saveLayer(bounds, &tmpPaint);
+ }
}
+#ifdef SK_SUPPORT_LEGACY_SAVEFLAGS
int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
SaveFlags flags) {
if (0xFF == alpha) {
@@ -1282,6 +1293,7 @@ int SkCanvas::saveLayerAlpha(const SkRect* bounds, U8CPU alpha,
return this->saveLayer(bounds, &tmpPaint, flags);
}
}
+#endif
void SkCanvas::internalRestore() {
SkASSERT(fMCStack.count() != 0);
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698