File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ void DisplayList::destroyDisplayListDeferred(DisplayList* displayList) {
143143
144144void DisplayList::clearResources () {
145145 sk_free ((void *) mReader .base ());
146+ mReader .setMemory (NULL , 0 );
146147
147148 delete mTransformMatrix ;
148149 delete mTransformCamera ;
@@ -216,19 +217,19 @@ void DisplayList::clearResources() {
216217
217218void DisplayList::initFromDisplayListRenderer (const DisplayListRenderer& recorder, bool reusing) {
218219 const SkWriter32& writer = recorder.writeStream ();
219- init ();
220-
221- if (writer.size () == 0 ) {
222- mFunctorCount = 0 ;
223- return ;
224- }
225220
226221 if (reusing) {
227222 // re-using display list - clear out previous allocations
228223 clearResources ();
229224 }
225+
226+ init ();
230227 initProperties ();
231228
229+ if (writer.size () == 0 ) {
230+ return ;
231+ }
232+
232233 mSize = writer.size ();
233234 void * buffer = sk_malloc_throw (mSize );
234235 writer.flatten (buffer);
@@ -301,6 +302,7 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde
301302void DisplayList::init () {
302303 mSize = 0 ;
303304 mIsRenderable = true ;
305+ mFunctorCount = 0 ;
304306}
305307
306308size_t DisplayList::getSize () {
You can’t perform that action at this time.
0 commit comments