Make BBH parameter to SkRecordComputeLayers and SkRecordFillBounds optional
Chromium creates a picture to contain their picture pile in order to use MultiPictureDraw. They currently do not create a bounding box for that picture but I still need layer information for it. This change allows Chromium to continue without a BBH but still have layer information.
In the future, the brute force BBH might be suitable for their use case.
Please see gpu_raster_worker_pool.cc in (Add flag to beginRecording to request saveLayer information - https://codereview.chromium.org/721883002/) for where this is happening in Chromium.
Review URL: https://codereview.chromium.org/733963004
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index e35e5a0..77235fd 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -168,8 +168,9 @@
}
// Finally feed all stored bounds into the BBH. They'll be returned in this order.
- SkASSERT(bbh);
- bbh->insert(&fBounds, fNumRecords);
+ if (bbh) {
+ bbh->insert(&fBounds, fNumRecords);
+ }
}
template <typename T> void operator()(const T& op) {