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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 835813002: Clean up dead clear() code in SkRecord. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clearer? Created 5 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
« no previous file with comments | « no previous file | src/core/SkRecords.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 08c915491c9421c98932fe40e95993f6dfe88987..6b1de4c6132c64e78ce82c9216a028761e9e930a 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -26,9 +26,7 @@ void SkRecordDraw(const SkRecord& record,
// lets us query the BBH.
SkRect query;
if (!canvas->getClipBounds(&query)) {
- // We want to make sure our query rectangle is never totally empty.
- // Clear ignores the clip, so it must draw even if the clip is logically empty.
- query = SkRect::MakeWH(SK_ScalarNearlyZero, SK_ScalarNearlyZero);
+ query.setEmpty();
}
SkTDArray<unsigned> ops;
@@ -81,7 +79,6 @@ template <> void Draw::draw(const NoOp&) {}
DRAW(Restore, restore());
DRAW(Save, save());
DRAW(SaveLayer, saveLayer(r.bounds, r.paint, r.flags));
-DRAW(Clear, clear(r.color));
DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix)));
DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa));
@@ -218,7 +215,6 @@ public:
fCTM->mapRect(&rect);
// Nothing can draw outside the current clip.
- // (Only bounded ops call into this method, so oddballs like Clear don't matter here.)
if (!rect.intersect(fCurrentClipBounds)) {
return Bounds::MakeEmpty();
}
@@ -388,7 +384,6 @@ private:
// FIXME: this method could use better bounds
Bounds bounds(const DrawText&) const { return fCurrentClipBounds; }
- Bounds bounds(const Clear&) const { return fCullRect; } // Ignores the clip.
Bounds bounds(const DrawPaint&) const { return fCurrentClipBounds; }
Bounds bounds(const NoOp&) const { return Bounds::MakeEmpty(); } // NoOps don't draw.
« no previous file with comments | « no previous file | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698