diff options
Diffstat (limited to 'src/utils/debugger')
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.cpp | 7 | ||||
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.h | 2 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 29 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.h | 13 | ||||
-rw-r--r-- | src/utils/debugger/SkObjectParser.cpp | 13 | ||||
-rw-r--r-- | src/utils/debugger/SkObjectParser.h | 6 |
6 files changed, 32 insertions, 38 deletions
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp index 86937392a6..560976cbb7 100644 --- a/src/utils/debugger/SkDebugCanvas.cpp +++ b/src/utils/debugger/SkDebugCanvas.cpp @@ -524,10 +524,9 @@ void SkDebugCanvas::willSave() { this->INHERITED::willSave(); } -SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint, - SaveFlags flags) { - this->addDrawCommand(new SkSaveLayerCommand(bounds, paint, flags)); - this->INHERITED::willSaveLayer(bounds, paint, flags); +SkCanvas::SaveLayerStrategy SkDebugCanvas::getSaveLayerStrategy(const SaveLayerRec& rec) { + this->addDrawCommand(new SkSaveLayerCommand(rec)); + (void)this->INHERITED::getSaveLayerStrategy(rec); // No need for a full layer. return kNoLayer_SaveLayerStrategy; } diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h index 7de2b59437..217b52e3ce 100644 --- a/src/utils/debugger/SkDebugCanvas.h +++ b/src/utils/debugger/SkDebugCanvas.h @@ -165,7 +165,7 @@ public: protected: void willSave() override; - SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) override; + SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override; void willRestore() override; void didConcat(const SkMatrix&) override; diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index 9ebb81e74a..bb9f2f831d 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -925,36 +925,35 @@ void SkSaveCommand::execute(SkCanvas* canvas) const { canvas->save(); } -SkSaveLayerCommand::SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint, - SkCanvas::SaveFlags flags) +SkSaveLayerCommand::SkSaveLayerCommand(const SkCanvas::SaveLayerRec& rec) : INHERITED(kSaveLayer_OpType) { - if (bounds) { - fBounds = *bounds; + if (rec.fBounds) { + fBounds = *rec.fBounds; } else { fBounds.setEmpty(); } - if (paint) { - fPaint = *paint; + if (rec.fPaint) { + fPaint = *rec.fPaint; fPaintPtr = &fPaint; } else { fPaintPtr = nullptr; } - fFlags = flags; + fSaveLayerFlags = rec.fSaveLayerFlags; - if (bounds) { - fInfo.push(SkObjectParser::RectToString(*bounds, "Bounds: ")); + if (rec.fBounds) { + fInfo.push(SkObjectParser::RectToString(*rec.fBounds, "Bounds: ")); } - if (paint) { - fInfo.push(SkObjectParser::PaintToString(*paint)); + if (rec.fPaint) { + fInfo.push(SkObjectParser::PaintToString(*rec.fPaint)); } - fInfo.push(SkObjectParser::SaveFlagsToString(flags)); + fInfo.push(SkObjectParser::SaveLayerFlagsToString(fSaveLayerFlags)); } void SkSaveLayerCommand::execute(SkCanvas* canvas) const { - canvas->saveLayer(fBounds.isEmpty() ? nullptr : &fBounds, - fPaintPtr, - fFlags); + canvas->saveLayer(SkCanvas::SaveLayerRec(fBounds.isEmpty() ? nullptr : &fBounds, + fPaintPtr, + fSaveLayerFlags)); } void SkSaveLayerCommand::vizExecute(SkCanvas* canvas) const { diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h index 9da05eeedb..f67df92de7 100644 --- a/src/utils/debugger/SkDrawCommand.h +++ b/src/utils/debugger/SkDrawCommand.h @@ -551,8 +551,7 @@ private: class SkSaveLayerCommand : public SkDrawCommand { public: - SkSaveLayerCommand(const SkRect* bounds, const SkPaint* paint, - SkCanvas::SaveFlags flags); + SkSaveLayerCommand(const SkCanvas::SaveLayerRec&); void execute(SkCanvas* canvas) const override; void vizExecute(SkCanvas* canvas) const override; Action action() const override{ return kPushLayer_Action; } @@ -562,12 +561,12 @@ public: const SkPaint* paint() const { return fPaintPtr; } private: - SkRect fBounds; - SkPaint fPaint; - SkPaint* fPaintPtr; - SkCanvas::SaveFlags fFlags; + SkRect fBounds; + SkPaint fPaint; + SkPaint* fPaintPtr; + uint32_t fSaveLayerFlags; - bool fActive; + bool fActive; typedef SkDrawCommand INHERITED; }; diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp index 3dbc03901f..6d71a38b7b 100644 --- a/src/utils/debugger/SkObjectParser.cpp +++ b/src/utils/debugger/SkObjectParser.cpp @@ -338,16 +338,13 @@ SkString* SkObjectParser::RegionToString(const SkRegion& region) { return mRegion; } -SkString* SkObjectParser::SaveFlagsToString(SkCanvas::SaveFlags flags) { +SkString* SkObjectParser::SaveLayerFlagsToString(SkCanvas::SaveLayerFlags saveLayerFlags) { SkString* mFlags = new SkString("SkCanvas::SaveFlags: "); - if (flags & SkCanvas::kHasAlphaLayer_SaveFlag) { - mFlags->append("kHasAlphaLayer_SaveFlag "); + if (saveLayerFlags & SkCanvas::kIsOpaque_SaveLayerFlag) { + mFlags->append("kIsOpaque_SaveLayerFlag "); } - if (flags & SkCanvas::kFullColorLayer_SaveFlag) { - mFlags->append("kFullColorLayer_SaveFlag "); - } - if (flags & SkCanvas::kClipToLayer_SaveFlag) { - mFlags->append("kClipToLayer_SaveFlag "); + if (saveLayerFlags & SkCanvas::kPreserveLCDText_SaveLayerFlag) { + mFlags->append("kPreserveLCDText_SaveLayerFlag "); } return mFlags; } diff --git a/src/utils/debugger/SkObjectParser.h b/src/utils/debugger/SkObjectParser.h index 4c04935257..9bdfad5e79 100644 --- a/src/utils/debugger/SkObjectParser.h +++ b/src/utils/debugger/SkObjectParser.h @@ -110,10 +110,10 @@ public: static SkString* RegionToString(const SkRegion& region); /** - Returns a string representation of the SkCanvas::SaveFlags enum. - @param flags SkCanvas::SaveFlags enum + Returns a string representation of the SkCanvas::SaveLayerFlags enum. + @param flags SkCanvas::SaveLayerFlags enum */ - static SkString* SaveFlagsToString(SkCanvas::SaveFlags flags); + static SkString* SaveLayerFlagsToString(uint32_t saveLayerFlags); /** Returns a string representation of an SkScalar with the text parameter |