Chromium Code Reviews| Index: src/core/SkMultiPictureDraw.cpp |
| diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp |
| index 19b26ca60775e1b03d89cfd34952a936254525d2..1b8cb9c0a6875833598ffa52aef42ff11796e962 100644 |
| --- a/src/core/SkMultiPictureDraw.cpp |
| +++ b/src/core/SkMultiPictureDraw.cpp |
| @@ -58,7 +58,40 @@ void SkMultiPictureDraw::add(SkCanvas* canvas, |
| #undef SK_IGNORE_GPU_LAYER_HOISTING |
| #define SK_IGNORE_GPU_LAYER_HOISTING 1 |
| +#include "SkTaskGroup.h" |
| + |
|
robertphillips
2014/10/27 12:34:05
a struct?
|
| +struct PictureDrawRunnable : public SkRunnable { |
| + SkCanvas* fCanvas; |
| + const SkPicture* fPicture; |
| + const SkMatrix* fMatrix; |
| + const SkPaint* fPaint; |
| + |
| + void init(SkCanvas* canvas, const SkPicture* picture, const SkMatrix* matrix, |
| + const SkPaint* paint) { |
| + fCanvas = canvas; |
| + fPicture = picture; |
| + fMatrix = matrix; |
| + fPaint = paint; |
| + } |
| + |
| + virtual void run() SK_OVERRIDE { |
| + fCanvas->drawPicture(fPicture, fMatrix, fPaint); |
| + } |
| +}; |
| + |
| void SkMultiPictureDraw::draw() { |
| + |
| + if (true) { |
| + const int count = fDrawData.count(); |
| + SkAutoSTArray<32, PictureDrawRunnable> pdr(count); |
| + SkTaskGroup group; |
| + for (int i = 0; i < count; ++i) { |
|
robertphillips
2014/10/27 12:34:05
It seems like this portion should go with the draw
|
| + const DrawData& data = fDrawData[i]; |
| + pdr[i].init(data.canvas, data.picture, &data.matrix, data.paint); |
| + group.add(&pdr[i]); |
| + } |
| + return; |
| + } |
| #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
| GrContext* context = NULL; |