}
void PictureSet::add(const SkRegion& area, SkPicture* picture,
- uint32_t elapsed, bool split)
+ uint32_t elapsed, bool split, bool empty)
{
DBG_SET_LOGD("%p area={%d,%d,r=%d,b=%d} pict=%p elapsed=%d split=%d", this,
area.getBounds().fLeft, area.getBounds().fTop,
for (Pictures* working = mPictures.begin(); working != last; working++)
diff.op(working->mArea, SkRegion::kDifference_Op);
Pictures pictureAndBounds = {area, picture, area.getBounds(),
- elapsed, split, false, diff.isEmpty() == false};
+ elapsed, split, false, diff.isEmpty() == false, empty};
mPictures.append(pictureAndBounds);
}
{
const Pictures* last = mPictures.end();
for (const Pictures* working = mPictures.begin(); working != last; working++) {
- if (emptyPicture(working->mPicture) == false)
+ if (!working->mEmpty)
return false;
}
return true;
{
mPictures[i].mPicture->safeUnref();
mPictures[i].mPicture = p;
+ mPictures[i].mEmpty = emptyPicture(p);
}
void PictureSet::split(PictureSet* out) const
split ? "true" : "false");
if (multiUnsplitFastPictures <= 1 || split) {
total->op(working->mArea, SkRegion::kDifference_Op);
- out->add(working->mArea, working->mPicture, elapsed, split);
+ out->add(working->mArea, working->mPicture, elapsed, split,
+ working->mEmpty);
} else if (balance < elapsed)
balance = elapsed;
continue;
SkIRect cBounds;
cBounds.set(left, top, right, bottom);
out->add(SkRegion(cBounds), (across | down) != 1 ? NULL :
- working->mPicture, elapsed, true);
+ working->mPicture, elapsed, true,
+ (across | down) != 1 ? false : working->mEmpty);
left = right;
}
top = bottom;
this, mWidth, mHeight, total->isEmpty() ? "true" : "false",
multiUnsplitFastPictures);
if (!total->isEmpty() && multiUnsplitFastPictures > 1)
- out->add(*total, NULL, balance, false);
+ out->add(*total, NULL, balance, false, false);
delete total;
validate(__FUNCTION__);
out->dump("split-out");
PictureSet(const PictureSet& src) { set(src); }
virtual ~PictureSet();
void add(const SkRegion& area, SkPicture* picture,
- uint32_t elapsed, bool split);
+ uint32_t elapsed, bool split)
+ {
+ add(area, picture, elapsed, split, emptyPicture(picture));
+ }
+ void add(const SkRegion& area, SkPicture* picture,
+ uint32_t elapsed, bool split, bool empty);
const SkIRect& bounds(size_t i) const {
return mPictures[i].mArea.getBounds(); }
bool build();
bool mSplit : 8;
bool mWroteElapsed : 8;
bool mBase : 8; // true if nothing is drawn underneath this
+ bool mEmpty : 8; // true if the picture only draws white
};
void add(const Pictures* temp);
WTF::Vector<Pictures> mPictures;