Merge "Fix a crash in skia pipeline, when empty reorder block is first"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4a3818ddd3
@@ -40,7 +40,7 @@ void StartReorderBarrierDrawable::onDraw(SkCanvas* canvas) {
|
||||
//mChildren is allocated and initialized only the first time onDraw is called and cached for
|
||||
//subsequent calls
|
||||
mChildren.reserve(mEndChildIndex - mBeginChildIndex + 1);
|
||||
for (unsigned int i = mBeginChildIndex; i <= mEndChildIndex; i++) {
|
||||
for (int i = mBeginChildIndex; i <= mEndChildIndex; i++) {
|
||||
mChildren.push_back(const_cast<RenderNodeDrawable*>(&mDisplayList->mChildNodes[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ protected:
|
||||
virtual void onDraw(SkCanvas* canvas) override;
|
||||
|
||||
private:
|
||||
size_t mEndChildIndex;
|
||||
size_t mBeginChildIndex;
|
||||
int mEndChildIndex;
|
||||
int mBeginChildIndex;
|
||||
FatVector<RenderNodeDrawable*, 16> mChildren;
|
||||
SkiaDisplayList* mDisplayList;
|
||||
|
||||
|
||||
@@ -1530,6 +1530,8 @@ public:
|
||||
RENDERTHREAD_TEST(FrameBuilder, zReorder) {
|
||||
auto parent = TestUtils::createNode<RecordingCanvas>(0, 0, 100, 100,
|
||||
[](RenderProperties& props, RecordingCanvas& canvas) {
|
||||
canvas.insertReorderBarrier(true);
|
||||
canvas.insertReorderBarrier(false);
|
||||
drawOrderedNode(&canvas, 0, 10.0f); // in reorder=false at this point, so played inorder
|
||||
drawOrderedRect(&canvas, 1);
|
||||
canvas.insertReorderBarrier(true);
|
||||
|
||||
@@ -102,6 +102,8 @@ TEST(RenderNodeDrawable, zReorder) {
|
||||
|
||||
auto parent = TestUtils::createSkiaNode(0, 0, 100, 100,
|
||||
[](RenderProperties& props, SkiaRecordingCanvas& canvas) {
|
||||
canvas.insertReorderBarrier(true);
|
||||
canvas.insertReorderBarrier(false);
|
||||
drawOrderedNode(&canvas, 0, 10.0f); // in reorder=false at this point, so played inorder
|
||||
drawOrderedRect(&canvas, 1);
|
||||
canvas.insertReorderBarrier(true);
|
||||
|
||||
Reference in New Issue
Block a user