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

Unified Diff: src/effects/SkLayerDrawLooper.cpp

Issue 180483004: remove SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS -- not needed (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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
« include/effects/SkLayerDrawLooper.h ('K') | « include/effects/SkLayerDrawLooper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLayerDrawLooper.cpp
diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp
index cb60ff1e974a641dfc59d1a0c67d99c5cf0161a7..cfe673db925f2183d80dc2c67e6d6580f80238e8 100644
--- a/src/effects/SkLayerDrawLooper.cpp
+++ b/src/effects/SkLayerDrawLooper.cpp
@@ -15,9 +15,6 @@
#include "SkUnPreMultiply.h"
SkLayerDrawLooper::LayerInfo::LayerInfo() {
-#ifdef SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS
- fFlagsMask = 0; // ignore layerinfo's paint flags
-#endif
fPaintBits = 0; // ignore our paint fields
fColorMode = SkXfermode::kDst_Mode; // ignore our color
fOffset.set(0, 0);
@@ -104,10 +101,6 @@ static SkColor xferColor(SkColor src, SkColor dst, SkXfermode::Mode mode) {
void SkLayerDrawLooper::ApplyInfo(SkPaint* dst, const SkPaint& src,
const LayerInfo& info) {
-#ifdef SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS
- uint32_t mask = info.fFlagsMask;
- dst->setFlags((dst->getFlags() & ~mask) | (src.getFlags() & mask));
-#endif
dst->setColor(xferColor(src.getColor(), dst->getColor(), info.fColorMode));
BitFlags bits = info.fPaintBits;
@@ -215,11 +208,9 @@ void SkLayerDrawLooper::flatten(SkWriteBuffer& buffer) const {
Rec* rec = fRecs;
for (int i = 0; i < fCount; i++) {
-#ifdef SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS
- buffer.writeInt(rec->fInfo.fFlagsMask);
-#else
- buffer.writeInt(0); // remove eventually, when we can bump the version
-#endif
+ // Legacy "flagsmask" field -- now ignored, remove when we bump version
+ buffer.writeInt(0);
+
buffer.writeInt(rec->fInfo.fPaintBits);
buffer.writeInt(rec->fInfo.fColorMode);
buffer.writePoint(rec->fInfo.fOffset);
@@ -235,11 +226,9 @@ SkFlattenable* SkLayerDrawLooper::CreateProc(SkReadBuffer& buffer) {
Builder builder;
for (int i = 0; i < count; i++) {
LayerInfo info;
-#ifdef SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS
- info.fFlagsMask = buffer.readInt();
-#else
+ // Legacy "flagsmask" field -- now ignored, remove when we bump version
(void)buffer.readInt();
-#endif
+
info.fPaintBits = buffer.readInt();
info.fColorMode = (SkXfermode::Mode)buffer.readInt();
buffer.readPoint(&info.fOffset);
@@ -270,46 +259,7 @@ void SkLayerDrawLooper::toString(SkString* str) const {
Rec* rec = fRecs;
for (int i = 0; i < fCount; i++) {
- str->appendf("%d: ", i);
-
-#ifdef SK_SUPPORT_LEGACY_LAYERDRAWLOOPER_PAINTFLAGS
- str->append("flagsMask: (");
- if (0 == rec->fInfo.fFlagsMask) {
- str->append("None");
- } else {
- bool needSeparator = false;
- SkAddFlagToString(str, SkToBool(SkPaint::kAntiAlias_Flag & rec->fInfo.fFlagsMask),
- "AntiAlias", &needSeparator);
-// SkAddFlagToString(str, SkToBool(SkPaint::kFilterBitmap_Flag & rec->fInfo.fFlagsMask), "FilterBitmap", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kDither_Flag & rec->fInfo.fFlagsMask),
- "Dither", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kUnderlineText_Flag & rec->fInfo.fFlagsMask),
- "UnderlineText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kStrikeThruText_Flag & rec->fInfo.fFlagsMask),
- "StrikeThruText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kFakeBoldText_Flag & rec->fInfo.fFlagsMask),
- "FakeBoldText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kLinearText_Flag & rec->fInfo.fFlagsMask),
- "LinearText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kSubpixelText_Flag & rec->fInfo.fFlagsMask),
- "SubpixelText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kDevKernText_Flag & rec->fInfo.fFlagsMask),
- "DevKernText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kLCDRenderText_Flag & rec->fInfo.fFlagsMask),
- "LCDRenderText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kEmbeddedBitmapText_Flag & rec->fInfo.fFlagsMask),
- "EmbeddedBitmapText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kAutoHinting_Flag & rec->fInfo.fFlagsMask),
- "Autohinted", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kVerticalText_Flag & rec->fInfo.fFlagsMask),
- "VerticalText", &needSeparator);
- SkAddFlagToString(str, SkToBool(SkPaint::kGenA8FromLCD_Flag & rec->fInfo.fFlagsMask),
- "GenA8FromLCD", &needSeparator);
- }
-#endif
- str->append(") ");
-
- str->append("paintBits: (");
+ str->appendf("%d: paintBits: (", i);
if (0 == rec->fInfo.fPaintBits) {
str->append("None");
} else if (kEntirePaint_Bits == rec->fInfo.fPaintBits) {
« include/effects/SkLayerDrawLooper.h ('K') | « include/effects/SkLayerDrawLooper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698