NOTREECHECKS=true
BUG=skia:
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/
470333002
// Takes ref on listener.
void addDeletionListener(DeletionListener* listener) const;
+ /** Return the approximate number of operations in this picture. This
+ * number may be greater or less than the number of SkCanvas calls
+ * recorded: some calls may be recorded as more than one operation, or some
+ * calls may be optimized away.
+ */
+ int approximateOpCount() const;
+
private:
// V2 : adds SkPixelRef's generation ID.
// V3 : PictInfo tag at beginning, and EOF tag at the end
fDeletionListeners.unrefAll();
}
+
+// fRecord OK
+int SkPicture::approximateOpCount() const {
+ SkASSERT(fRecord.get() || fData.get());
+ if (fRecord.get()) {
+ return fRecord->count();
+ }
+ if (fData.get()) {
+ return fData->opCount();
+ }
+ return 0;
+}
bool containsBitmaps() const;
+ int opCount() const { return fContentInfo.numOperations(); }
+
const SkData* opData() const { return fOpData; }
protected:
return &(*fPaints)[index - 1];
}
- void initIterator(SkPictureStateTree::Iterator* iter,
+ void initIterator(SkPictureStateTree::Iterator* iter,
const SkTDArray<void*>& draws,
SkCanvas* canvas) const {
if (NULL != fStateTree) {