Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: src/core/SkMultiPictureDraw.cpp

Issue 791473006: fix images in multi-thread by doing shallow-copies (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMultiPictureDraw.cpp
diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp
index ed099a02e16b741c2f9e108e9be2d2b8e356f392..c85c56735ccd64cfdfe20cfa7de3df7709c96ca4 100644
--- a/src/core/SkMultiPictureDraw.cpp
+++ b/src/core/SkMultiPictureDraw.cpp
@@ -84,13 +84,22 @@ public:
~AutoMPDReset() { fMPD->reset(); }
};
+//#define FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
+
void SkMultiPictureDraw::draw() {
AutoMPDReset mpdreset(this);
+
+#ifdef FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
+ for (int i = 0; i < fThreadSafeDrawData.count(); ++i) {
+ DrawData* dd = &fThreadSafeDrawData.begin()[i];
+ dd->fCanvas->drawPicture(dd->fPicture, &dd->fMatrix, dd->fPaint);
+ }
+#else
// we place the taskgroup after the MPDReset, to ensure that we don't delete the DrawData
// objects until after we're finished the tasks (which have pointers to the data).
-
SkTaskGroup group;
group.batch(DrawData::Draw, fThreadSafeDrawData.begin(), fThreadSafeDrawData.count());
+#endif
// we deliberately don't call wait() here, since the destructor will do that, this allows us
// to continue processing gpu-data without having to wait on the cpu tasks.
« no previous file with comments | « no previous file | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698