aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBBoxHierarchyRecord.cpp4
-rw-r--r--src/core/SkBBoxHierarchyRecord.h2
-rw-r--r--src/core/SkCanvas.cpp46
-rw-r--r--src/core/SkMatrixClipStateMgr.cpp16
-rw-r--r--src/core/SkMatrixClipStateMgr.h22
-rw-r--r--src/core/SkPicturePlayback.cpp7
-rw-r--r--src/core/SkPictureRecord.cpp24
-rw-r--r--src/core/SkPictureRecord.h4
-rw-r--r--src/core/SkRecordDraw.cpp2
-rw-r--r--src/core/SkRecordOpts.cpp5
-rw-r--r--src/core/SkRecorder.cpp6
-rw-r--r--src/core/SkRecorder.h2
-rw-r--r--src/core/SkRecords.h2
-rw-r--r--src/pipe/SkGPipeRead.cpp2
-rw-r--r--src/pipe/SkGPipeWrite.cpp8
-rw-r--r--src/utils/SkDeferredCanvas.cpp6
-rw-r--r--src/utils/SkDumpCanvas.cpp6
-rw-r--r--src/utils/SkLuaCanvas.cpp4
-rw-r--r--src/utils/SkNWayCanvas.cpp6
-rw-r--r--src/utils/SkProxyCanvas.cpp6
-rw-r--r--src/utils/debugger/SkDebugCanvas.cpp6
-rw-r--r--src/utils/debugger/SkDebugCanvas.h2
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp6
-rw-r--r--src/utils/debugger/SkDrawCommand.h4
-rw-r--r--src/utils/debugger/SkObjectParser.cpp6
25 files changed, 78 insertions, 126 deletions
diff --git a/src/core/SkBBoxHierarchyRecord.cpp b/src/core/SkBBoxHierarchyRecord.cpp
index 96e6cdf102..1868e65325 100644
--- a/src/core/SkBBoxHierarchyRecord.cpp
+++ b/src/core/SkBBoxHierarchyRecord.cpp
@@ -26,9 +26,9 @@ void SkBBoxHierarchyRecord::handleBBox(const SkRect& bounds) {
fBoundingHierarchy->insert(draw, r, true);
}
-void SkBBoxHierarchyRecord::willSave(SaveFlags flags) {
+void SkBBoxHierarchyRecord::willSave() {
fStateTree->appendSave();
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkBBoxHierarchyRecord::willSaveLayer(const SkRect* bounds,
diff --git a/src/core/SkBBoxHierarchyRecord.h b/src/core/SkBBoxHierarchyRecord.h
index ba7d514bc5..7db82d8369 100644
--- a/src/core/SkBBoxHierarchyRecord.h
+++ b/src/core/SkBBoxHierarchyRecord.h
@@ -28,7 +28,7 @@ public:
virtual bool shouldRewind(void* data) SK_OVERRIDE;
protected:
- virtual void willSave(SaveFlags) SK_OVERRIDE;
+ virtual void willSave() SK_OVERRIDE;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
virtual void willRestore() SK_OVERRIDE;
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 2fb5c95124..c35f284432 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -189,7 +189,6 @@ private:
*/
class SkCanvas::MCRec {
public:
- int fFlags;
SkMatrix* fMatrix; // points to either fMatrixStorage or prev MCRec
SkRasterClip* fRasterClip; // points to either fRegionStorage or prev MCRec
SkDrawFilter* fFilter; // the current filter (or null)
@@ -203,21 +202,13 @@ public:
*/
DeviceCM* fTopLayer;
- MCRec(const MCRec* prev, int flags) : fFlags(flags) {
+ MCRec(const MCRec* prev) {
if (NULL != prev) {
- if (flags & SkCanvas::kMatrix_SaveFlag) {
- fMatrixStorage = *prev->fMatrix;
- fMatrix = &fMatrixStorage;
- } else {
- fMatrix = prev->fMatrix;
- }
+ fMatrixStorage = *prev->fMatrix;
+ fMatrix = &fMatrixStorage;
- if (flags & SkCanvas::kClip_SaveFlag) {
- fRasterClipStorage = *prev->fRasterClip;
- fRasterClip = &fRasterClipStorage;
- } else {
- fRasterClip = prev->fRasterClip;
- }
+ fRasterClipStorage = *prev->fRasterClip;
+ fRasterClip = &fRasterClipStorage;
fFilter = prev->fFilter;
SkSafeRef(fFilter);
@@ -449,7 +440,7 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device) {
fMetaData = NULL;
fMCRec = (MCRec*)fMCStack.push_back();
- new (fMCRec) MCRec(NULL, 0);
+ new (fMCRec) MCRec(NULL);
fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL));
fMCRec->fTopLayer = fMCRec->fLayer;
@@ -786,30 +777,21 @@ void SkCanvas::updateDeviceCMCache() {
///////////////////////////////////////////////////////////////////////////////
-int SkCanvas::internalSave(SaveFlags flags) {
+int SkCanvas::internalSave() {
int saveCount = this->getSaveCount(); // record this before the actual save
MCRec* newTop = (MCRec*)fMCStack.push_back();
- new (newTop) MCRec(fMCRec, flags); // balanced in restore()
-
+ new (newTop) MCRec(fMCRec); // balanced in restore()
fMCRec = newTop;
- if (SkCanvas::kClip_SaveFlag & flags) {
- fClipStack.save();
- }
+ fClipStack.save();
return saveCount;
}
int SkCanvas::save() {
- this->willSave(kMatrixClip_SaveFlag);
- return this->internalSave(kMatrixClip_SaveFlag);
-}
-
-int SkCanvas::save(SaveFlags flags) {
- this->willSave(flags);
- // call shared impl
- return this->internalSave(flags);
+ this->willSave();
+ return this->internalSave();
}
static bool bounds_affects_clip(SkCanvas::SaveFlags flags) {
@@ -889,7 +871,7 @@ int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Save
// do this before we create the layer. We don't call the public save() since
// that would invoke a possibly overridden virtual
- int count = this->internalSave(flags);
+ int count = this->internalSave();
fDeviceCMDirty = true;
@@ -974,9 +956,7 @@ void SkCanvas::internalRestore() {
fDeviceCMDirty = true;
fCachedLocalClipBoundsDirty = true;
- if (SkCanvas::kClip_SaveFlag & fMCRec->fFlags) {
- fClipStack.restore();
- }
+ fClipStack.restore();
// reserve our layer (if any)
DeviceCM* layer = fMCRec->fLayer; // may be null
diff --git a/src/core/SkMatrixClipStateMgr.cpp b/src/core/SkMatrixClipStateMgr.cpp
index 1fc7fe8321..680cc364d2 100644
--- a/src/core/SkMatrixClipStateMgr.cpp
+++ b/src/core/SkMatrixClipStateMgr.cpp
@@ -110,7 +110,7 @@ SkMatrixClipStateMgr::SkMatrixClipStateMgr()
fMatrixDict.append()->reset();
fCurMCState = (MatrixClipState*)fMatrixClipStack.push_back();
- new (fCurMCState) MatrixClipState(NULL, 0); // balanced in restore()
+ new (fCurMCState) MatrixClipState(NULL); // balanced in restore()
#ifdef SK_DEBUG
fActualDepth = 0;
@@ -126,9 +126,9 @@ SkMatrixClipStateMgr::~SkMatrixClipStateMgr() {
}
-int SkMatrixClipStateMgr::MCStackPush(SkCanvas::SaveFlags flags) {
+int SkMatrixClipStateMgr::MCStackPush() {
MatrixClipState* newTop = (MatrixClipState*)fMatrixClipStack.push_back();
- new (newTop) MatrixClipState(fCurMCState, flags); // balanced in restore()
+ new (newTop) MatrixClipState(fCurMCState); // balanced in restore()
fCurMCState = newTop;
SkDEBUGCODE(this->validate();)
@@ -136,10 +136,10 @@ int SkMatrixClipStateMgr::MCStackPush(SkCanvas::SaveFlags flags) {
return fMatrixClipStack.count();
}
-int SkMatrixClipStateMgr::save(SkCanvas::SaveFlags flags) {
+int SkMatrixClipStateMgr::save() {
SkDEBUGCODE(this->validate();)
- return this->MCStackPush(flags);
+ return this->MCStackPush();
}
int SkMatrixClipStateMgr::saveLayer(const SkRect* bounds, const SkPaint* paint,
@@ -154,7 +154,7 @@ int SkMatrixClipStateMgr::saveLayer(const SkRect* bounds, const SkPaint* paint,
// out the MC state
SkDEBUGCODE(bool saved =) this->call(kOther_CallType);
- int result = this->MCStackPush(flags);
+ int result = this->MCStackPush();
++fCurMCState->fLayerID;
fCurMCState->fIsSaveLayer = true;
@@ -172,7 +172,7 @@ int SkMatrixClipStateMgr::saveLayer(const SkRect* bounds, const SkPaint* paint,
// restore
fSkipOffsets = SkNEW(SkTDArray<int>);
- fPicRecord->recordSaveLayer(bounds, paint, flags | SkCanvas::kMatrixClip_SaveFlag);
+ fPicRecord->recordSaveLayer(bounds, paint, flags);
#ifdef SK_DEBUG
fActualDepth++;
#endif
@@ -289,7 +289,7 @@ bool SkMatrixClipStateMgr::call(CallType callType) {
SkASSERT(!fCurMCState->fHasOpen);
SkASSERT(0 == fSkipOffsets->count());
fCurMCState->fHasOpen = true;
- fPicRecord->recordSave(SkCanvas::kMatrixClip_SaveFlag);
+ fPicRecord->recordSave();
#ifdef SK_DEBUG
fActualDepth++;
SkASSERT(fActualDepth == fCurMCState->fExpectedDepth);
diff --git a/src/core/SkMatrixClipStateMgr.h b/src/core/SkMatrixClipStateMgr.h
index 016baa008a..9a80b0154e 100644
--- a/src/core/SkMatrixClipStateMgr.h
+++ b/src/core/SkMatrixClipStateMgr.h
@@ -181,7 +181,7 @@ public:
typedef SkNoncopyable INHERITED;
};
- MatrixClipState(MatrixClipState* prev, int flags)
+ MatrixClipState(MatrixClipState* prev)
: fPrev(prev)
{
fHasOpen = false;
@@ -202,19 +202,11 @@ public:
else {
fLayerID = prev->fLayerID;
- if (flags & SkCanvas::kMatrix_SaveFlag) {
- fMatrixInfoStorage = *prev->fMatrixInfo;
- fMatrixInfo = &fMatrixInfoStorage;
- } else {
- fMatrixInfo = prev->fMatrixInfo;
- }
+ fMatrixInfoStorage = *prev->fMatrixInfo;
+ fMatrixInfo = &fMatrixInfoStorage;
- if (flags & SkCanvas::kClip_SaveFlag) {
- // We don't copy the ClipOps of the previous clip states
- fClipInfo = &fClipInfoStorage;
- } else {
- fClipInfo = prev->fClipInfo;
- }
+ // We don't copy the ClipOps of the previous clip states
+ fClipInfo = &fClipInfoStorage;
// Initially a new save/saveLayer represents the same MC state
// as its predecessor.
@@ -275,7 +267,7 @@ public:
// this duplicates effort.
int getSaveCount() const { return fMatrixClipStack.count(); }
- int save(SkCanvas::SaveFlags flags);
+ int save();
int saveLayer(const SkRect* bounds, const SkPaint* paint, SkCanvas::SaveFlags flags);
@@ -372,7 +364,7 @@ protected:
SkDEBUGCODE(void validate();)
- int MCStackPush(SkCanvas::SaveFlags flags);
+ int MCStackPush();
void addClipOffset(size_t offset) {
SkASSERT(NULL != fSkipOffsets);
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 148237a5a8..35e66bb7eb 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -1307,7 +1307,12 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback)
canvas.rotate(reader.readScalar());
break;
case SAVE:
- canvas.save((SkCanvas::SaveFlags) reader.readInt());
+ // SKPs with version < 29 also store a SaveFlags param.
+ if (size > 4) {
+ SkASSERT(8 == size);
+ reader.readInt();
+ }
+ canvas.save();
break;
case SAVE_LAYER: {
const SkRect* boundsPtr = this->getRectPtr(reader);
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 16856d639d..566cb196ba 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -32,7 +32,7 @@ enum {
// A lot of basic types get stored as a uint32_t: bools, ints, paint indices, etc.
static int const kUInt32Size = 4;
-static const uint32_t kSaveSize = 2 * kUInt32Size;
+static const uint32_t kSaveSize = kUInt32Size;
static const uint32_t kSaveLayerNoBoundsSize = 4 * kUInt32Size;
static const uint32_t kSaveLayerWithBoundsSize = 4 * kUInt32Size + sizeof(SkRect);
@@ -151,25 +151,24 @@ static inline size_t getPaintOffset(DrawType op, size_t opSize) {
return gPaintOffsets[op] * sizeof(uint32_t) + overflow;
}
-void SkPictureRecord::willSave(SaveFlags flags) {
+void SkPictureRecord::willSave() {
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
- fMCMgr.save(flags);
+ fMCMgr.save();
#else
// record the offset to us, making it non-positive to distinguish a save
// from a clip entry.
fRestoreOffsetStack.push(-(int32_t)fWriter.bytesWritten());
- this->recordSave(flags);
+ this->recordSave();
#endif
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
-void SkPictureRecord::recordSave(SaveFlags flags) {
- // op + flags
+void SkPictureRecord::recordSave() {
+ // op only
size_t size = kSaveSize;
size_t initialOffset = this->addDraw(SAVE, &size);
- this->addInt(flags);
this->validate(initialOffset, size);
}
@@ -517,15 +516,6 @@ static bool collapse_save_clip_restore(SkWriter32* writer, int32_t offset,
SkASSERT(SAVE == op);
SkASSERT(kSaveSize == opSize);
- // get the save flag (last 4-bytes of the space allocated for the opSize)
- SkCanvas::SaveFlags saveFlags = (SkCanvas::SaveFlags) writer->readTAt<uint32_t>(offset + 4);
- if (SkCanvas::kMatrixClip_SaveFlag != saveFlags) {
- // This function's optimization is only correct for kMatrixClip style saves.
- // TODO: set checkMatrix & checkClip booleans here and then check for the
- // offending operations in the following loop.
- return false;
- }
-
// Walk forward until we get back to either a draw-verb (abort) or we hit
// our restore (success).
int32_t saveOffset = offset;
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 7e5c5c6410..417dde6e82 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -233,7 +233,7 @@ protected:
return NULL;
}
- virtual void willSave(SaveFlags) SK_OVERRIDE;
+ virtual void willSave() SK_OVERRIDE;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
virtual void willRestore() SK_OVERRIDE;
@@ -293,7 +293,7 @@ protected:
size_t recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
size_t recordClipPath(int pathID, SkRegion::Op op, bool doAA);
size_t recordClipRegion(const SkRegion& region, SkRegion::Op op);
- void recordSave(SaveFlags flags);
+ void recordSave();
void recordSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags);
void recordRestore(bool fillInSkips = true);
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index e4c49e4f49..db149100c5 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -36,7 +36,7 @@ template <> void Draw::draw(const NoOp&) {}
#define DRAW(T, call) template <> void Draw::draw(const T& r) { fCanvas->call; }
DRAW(Restore, restore());
-DRAW(Save, save(r.flags));
+DRAW(Save, save());
DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags));
DRAW(PopCull, popCull());
DRAW(PushCull, pushCull(r.rect));
diff --git a/src/core/SkRecordOpts.cpp b/src/core/SkRecordOpts.cpp
index 75f7c62605..cb429cf76c 100644
--- a/src/core/SkRecordOpts.cpp
+++ b/src/core/SkRecordOpts.cpp
@@ -84,11 +84,6 @@ struct SaveNoDrawsRestoreNooper {
Pattern;
bool onMatch(SkRecord* record, Pattern* pattern, unsigned begin, unsigned end) {
- // If restore doesn't revert both matrix and clip, this isn't safe to noop away.
- if (pattern->first<Save>()->flags != SkCanvas::kMatrixClip_SaveFlag) {
- return false;
- }
-
// The entire span between Save and Restore (inclusively) does nothing.
for (unsigned i = begin; i < end; i++) {
record->replace<NoOp>(i);
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 8581257c4a..4c02a35c9f 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -206,9 +206,9 @@ void SkRecorder::drawVertices(VertexMode vmode,
indexCount);
}
-void SkRecorder::willSave(SkCanvas::SaveFlags flags) {
- APPEND(Save, flags);
- INHERITED(willSave, flags);
+void SkRecorder::willSave() {
+ APPEND(Save);
+ INHERITED(willSave);
}
SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index 3e2932d42e..0eb11d7af8 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -62,7 +62,7 @@ public:
int indexCount,
const SkPaint& paint) SK_OVERRIDE;
- void willSave(SkCanvas::SaveFlags) SK_OVERRIDE;
+ void willSave() SK_OVERRIDE;
SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SkCanvas::SaveFlags) SK_OVERRIDE;
void willRestore() SK_OVERRIDE;
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index 581ae21e05..02cfc64032 100644
--- a/src/core/SkRecords.h
+++ b/src/core/SkRecords.h
@@ -183,7 +183,7 @@ private:
RECORD0(NoOp);
RECORD0(Restore);
-RECORD1(Save, SkCanvas::SaveFlags, flags);
+RECORD0(Save);
RECORD3(SaveLayer, Optional<SkRect>, bounds, Optional<SkPaint>, paint, SkCanvas::SaveFlags, flags);
RECORD1(PushCull, SkRect, rect);
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 41c417f92e..9047e8293f 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -317,7 +317,7 @@ static void translate_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
static void save_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
SkGPipeState* state) {
- canvas->save((SkCanvas::SaveFlags)DrawOp_unpackData(op32));
+ canvas->save();
}
static void saveLayer_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index a3c38646bb..6711eb0664 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -266,7 +266,7 @@ public:
bool shuttleBitmap(const SkBitmap&, int32_t slot);
protected:
- virtual void willSave(SaveFlags) SK_OVERRIDE;
+ virtual void willSave() SK_OVERRIDE;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
virtual void willRestore() SK_OVERRIDE;
@@ -515,13 +515,13 @@ uint32_t SkGPipeCanvas::getTypefaceID(SkTypeface* face) {
#define NOTIFY_SETUP(canvas) \
AutoPipeNotify apn(canvas)
-void SkGPipeCanvas::willSave(SaveFlags flags) {
+void SkGPipeCanvas::willSave() {
NOTIFY_SETUP(this);
if (this->needOpBytes()) {
- this->writeOp(kSave_DrawOp, 0, flags);
+ this->writeOp(kSave_DrawOp);
}
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkGPipeCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 641974b1ed..299e7caeea 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -678,10 +678,10 @@ bool SkDeferredCanvas::isFullFrame(const SkRect* rect,
SkIntToScalar(canvasSize.fWidth), SkIntToScalar(canvasSize.fHeight)));
}
-void SkDeferredCanvas::willSave(SaveFlags flags) {
- this->drawingCanvas()->save(flags);
+void SkDeferredCanvas::willSave() {
+ this->drawingCanvas()->save();
this->recordedDrawCommand();
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkDeferredCanvas::willSaveLayer(const SkRect* bounds,
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 4dfed395e0..b12928fbbb 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -192,9 +192,9 @@ void SkDumpCanvas::dump(Verb verb, const SkPaint* paint,
///////////////////////////////////////////////////////////////////////////////
-void SkDumpCanvas::willSave(SaveFlags flags) {
- this->dump(kSave_Verb, NULL, "save(0x%X)", flags);
- this->INHERITED::willSave(flags);
+void SkDumpCanvas::willSave() {
+ this->dump(kSave_Verb, NULL, "save()");
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkDumpCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp
index d9c5dc1d76..b0b912827f 100644
--- a/src/utils/SkLuaCanvas.cpp
+++ b/src/utils/SkLuaCanvas.cpp
@@ -81,9 +81,9 @@ SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[])
SkLuaCanvas::~SkLuaCanvas() {}
-void SkLuaCanvas::willSave(SaveFlags flags) {
+void SkLuaCanvas::willSave() {
AUTO_LUA("save");
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkLuaCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index 505c05cbf1..11e4a65349 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -57,13 +57,13 @@ private:
SkCanvas* fCanvas;
};
-void SkNWayCanvas::willSave(SaveFlags flags) {
+void SkNWayCanvas::willSave() {
Iter iter(fList);
while (iter.next()) {
- iter->save(flags);
+ iter->save();
}
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkNWayCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp
index 5cb54698f6..3aa459cdfa 100644
--- a/src/utils/SkProxyCanvas.cpp
+++ b/src/utils/SkProxyCanvas.cpp
@@ -21,9 +21,9 @@ void SkProxyCanvas::setProxy(SkCanvas* proxy) {
///////////////////////////////// Overrides ///////////
-void SkProxyCanvas::willSave(SaveFlags flags) {
- fProxy->save(flags);
- this->INHERITED::willSave(flags);
+void SkProxyCanvas::willSave() {
+ fProxy->save();
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkProxyCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 8f6dc1b7a2..277e86d84d 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -590,9 +590,9 @@ void SkDebugCanvas::willRestore() {
this->INHERITED::willRestore();
}
-void SkDebugCanvas::willSave(SaveFlags flags) {
- this->addDrawCommand(new SkSaveCommand(flags));
- this->INHERITED::willSave(flags);
+void SkDebugCanvas::willSave() {
+ this->addDrawCommand(new SkSaveCommand());
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index f15b397251..a3902d2a4e 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -231,7 +231,7 @@ public:
}
protected:
- virtual void willSave(SaveFlags) SK_OVERRIDE;
+ virtual void willSave() SK_OVERRIDE;
virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
virtual void willRestore() SK_OVERRIDE;
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index 7c73cec786..c50fa2d3f5 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -840,14 +840,12 @@ void SkRotateCommand::execute(SkCanvas* canvas) {
canvas->rotate(fDegrees);
}
-SkSaveCommand::SkSaveCommand(SkCanvas::SaveFlags flags)
+SkSaveCommand::SkSaveCommand()
: INHERITED(SAVE) {
- fFlags = flags;
- fInfo.push(SkObjectParser::SaveFlagsToString(flags));
}
void SkSaveCommand::execute(SkCanvas* canvas) {
- canvas->save(fFlags);
+ canvas->save();
}
void SkSaveCommand::trackSaveState(int* state) {
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index a0bfb2ddca..f4569931a1 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -522,13 +522,11 @@ private:
class SkSaveCommand : public SkDrawCommand {
public:
- SkSaveCommand(SkCanvas::SaveFlags flags);
+ SkSaveCommand();
virtual void execute(SkCanvas* canvas) SK_OVERRIDE;
virtual void trackSaveState(int* state) SK_OVERRIDE;
virtual Action action() const SK_OVERRIDE { return kPushLayer_Action; }
private:
- SkCanvas::SaveFlags fFlags;
-
typedef SkDrawCommand INHERITED;
};
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp
index b932036a89..a9bad40f71 100644
--- a/src/utils/debugger/SkObjectParser.cpp
+++ b/src/utils/debugger/SkObjectParser.cpp
@@ -300,12 +300,6 @@ SkString* SkObjectParser::RegionToString(const SkRegion& region) {
SkString* SkObjectParser::SaveFlagsToString(SkCanvas::SaveFlags flags) {
SkString* mFlags = new SkString("SkCanvas::SaveFlags: ");
- if (flags & SkCanvas::kMatrix_SaveFlag) {
- mFlags->append("kMatrix_SaveFlag ");
- }
- if (flags & SkCanvas::kClip_SaveFlag) {
- mFlags->append("kClip_SaveFlag ");
- }
if (flags & SkCanvas::kHasAlphaLayer_SaveFlag) {
mFlags->append("kHasAlphaLayer_SaveFlag ");
}