Chromium Code Reviews| Index: src/core/SkRecordDraw.cpp |
| diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp |
| index 08c915491c9421c98932fe40e95993f6dfe88987..118c051e39670bdb79aa769179d263bfbfd7fa89 100644 |
| --- a/src/core/SkRecordDraw.cpp |
| +++ b/src/core/SkRecordDraw.cpp |
| @@ -24,12 +24,8 @@ void SkRecordDraw(const SkRecord& record, |
| // is not necessarily in that same space. getClipBounds() returns us |
| // this canvas' clip bounds transformed back into identity space, which |
| // 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); |
| - } |
| + SkRect query = {0,0,0,0}; |
| + (void)canvas->getClipBounds(&query); |
|
reed1
2015/01/05 14:45:30
not sure why the new form is clearer.
mtklein
2015/01/05 14:49:17
You're saying you prefer
SkRect query;
if (!ca
reed1
2015/01/05 16:26:08
danke
|
| SkTDArray<unsigned> ops; |
| bbh->search(query, &ops); |
| @@ -81,7 +77,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 +213,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 +382,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. |